Add Facebook tracking conversion pixel

Overview


Track the performance of your Facebook ads by adding a conversion pixel in the Celery confirmation page.

Getting Started


1. Setup the Facebook pixel

https://www.facebook.com/business/help/952192354843755

2. Retrieve your Facebook pixel ID



3. Add the tracking pixel (below) in the custom confirmation scripts

Replace YOUR_FACEBOOK_PIXEL_ID with the pixel ID provided by Facebook.
<!-- Facebook Pixel Code -->
<script>
  var order = App.getOrder({version: 'v1'});
  var total = order.total / 100;
  var currency = order.currency;

  !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', 'YOUR_FACEBOOK_PIXEL_ID'); // TODO
  fbq('track', 'PageView');
  fbq('track', 'Purchase', {value: total, currency: currency});
</script>
<!-- End Facebook Pixel Code -->

Feedback and Knowledge Base