facebook pixel code

Home Forums Legacy Support Support queries Setup issues facebook pixel code

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #19704
    Kupka
    Spectator
    Hi I would like to add the  facebook pixel code into the header of the whole site. Can you assist where I do that with this theme? I put it into the google analytics code put it was running to slow.  Thanks. Daniel
    #19707
    Kupka
    Spectator
    FYI https://www.facebook.com/business/help/952192354843755
    #19765
    Anshuman Sahu
    Keymaster
    You can add it like this : add the code in your wplms-customizer.php file at the end before "?>"  in wplms customizer plugin  : add_action('wp_head','add_pixel_code'); function add_pixel_code(){ ?> <!--Put your fb code here --> <?php   } like this :   add_action('wp_head','add_pixel_code'); function add_pixel_code(){ ?> <!-- Facebook Pixel Code --> <script> !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','//connect.facebook.net/en_US/fbevents.js');   fbq('init', '982394608508824'); fbq('track', "PageView");</script> <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=982394608508824&ev=PageView&noscript=1" /></noscript> <!-- End Facebook Pixel Code --> <?php   }
    #19837
    Kupka
    Spectator
    thanks. is that correct? http://prntscr.com/9tb718
    #20010
    H.K. Latiyan
    Participant
    Yes, thats correct.
    #77024
    ulyssesw
    Spectator
    Hi, The above is for putting the Facebook pixel base code, to the entire website. How about for the event code for specific pages? For example adding fbq('track', 'AddToCart'); to the cart page.
    #77051
    H.K. Latiyan
    Participant
    @ulyssew: Please create your own topic for your issues.
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘facebook pixel code’ is closed to new replies.