View Single Post
  #15  
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?

Quote:
{literal}
<!-- Facebook Pixel Code -->
<script>
!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;
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', 'FACEBOOKCODEHERE');
fbq('track', "PageView");
{/literal}

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

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

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

{literal}
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=FACEBOOKCODEHERE&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->
{/literal}

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