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
FYI https://www.facebook.com/business/help/952192354843755
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
}
thanks. is that correct? http://prntscr.com/9tb718
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.
@ulyssew: Please create your own topic for your issues.