Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 04-21-2017 10:11:37

lgt
Member
Registered: 11-21-2010
Posts: 272
Website

Facebook Pixel Code

Is there support for Facebook Pixel & conversion code?

Not a huge deal, just wondering.









Offline

 

#2 04-24-2017 07:19:57

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Facebook Pixel Code

Access Store / Component / Settings / Affiliate Settings.  Add whatever you like in the 'Custom Script' field, and set 'Affiliate Order Reporting' to 'Custom Script'.  This works for the facebook pixel you're referring to:

Code:

<?php 

$order    = $this->globals('ecom.thirdpartyaff_order');
$fbid     = 'ENTERFACEBOOKEVIDHERE';
$currency = 'USD';

?>

<script>(function() {
  var _fbq = window._fbq || (window._fbq = []);
  if (!_fbq.loaded) {
    var fbds = document.createElement('script');
    fbds.async = true;
    fbds.src = '//connect.facebook.net/en_US/fbds.js <http://connect.facebook.net/en_US/fbds.js>';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(fbds, s);
    _fbq.loaded = true;
  }
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '<?php print $this->xhtml_encode($fbid); ?>', {'value':'<?php print $this->xhtml_encode($order['ordertotal']); ?>','currency':'<?php print $this->xhtml_encode($currency); ?>'}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=<?php print $this->xhtml_encode($fbid); ?>&amp;cd[value]=<?php print $this->xhtml_encode($order['ordertotal']); ?>&amp;cd[currency]=<?php print $this->xhtml_encode($currency); ?>&amp;noscript=1" /></noscript>

Nick Hendler

Offline

 

Board footer