View Single Post
Old 11-03-2016, 11:48 AM
masada3336 masada3336 is offline

Senior Member
Join Date: Jan 2009
Posts: 115

Default Re: Facebook Pixel Code for X-Cart 4

I've adapted Mike's code here but the pixel keeps not loading, anyone have any idea what I might be doing wrong?

<!-- Facebook Pixel Code -->
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=f unction(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(argum ents)};if(!f._fbq)f._fbq=n;

fbq('init', 'FACEBOOKCODEHERE');
fbq('track', "PageView");

{if $main eq "cart"}
fbq('track', 'InitiateCheckout');

{if $main eq 'product'}
fbq('track', 'ViewContent');

{if $main eq 'order_message'}
fbq('track', 'Purchase', {value: '{$orders[0]}', currency: 'USD'});

<noscript><img height="1" width="1" style="display:none"
<!-- End Facebook Pixel Code -->

Cart works, Product view works, all other pages work - but the order message isn't working.

Thanks in advance!
4.4.5 - with Customized Smart Template
Reply With Quote