Jump to content

Add Facebook Ad Conversion Tracking to checkout


Recommended Posts

Hi,

 

I want help to add a Facebook Ad Conversion Tracking code to prestashop 1.5.6 checkout so I can track sales that are coming directly from my facebook ads.

 

The code I need to add is as following:

 

<!-- Facebook Conversion Code for CHECKOUT -->

<script type="text/javascript">

var fb_param = {};

fb_param.pixel_id = 'xxxxxxxxxxxxx';

fb_param.value = '0.01';

fb_param.currency = 'USD';

(function(){

var fpw = document.createElement('script');

fpw.async = true;

fpw.src = '//connect.facebook.net/en_US/fp.js';

var ref = document.getElementsByTagName('script')[0];

ref.parentNode.insertBefore(fpw, ref);

})();

</script>

<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/offsite_event.php?id=xxxxxxxxxxxxx&value=0.01&currency=USD" /></noscript>

 

Thank you and I am looking forward to youer help.

 

Greetings from Morocco.

Link to comment
Share on other sites

hello

but you can find there detailed instuctions.

for example, check this: http://www.prestashop.com/forums/topic/250595-solved-affiliate-tracking-code/

 

then, in the last tpl file paste this code

<!-- Facebook Conversion Code for CHECKOUT -->
<script type="text/javascript">
var fb_param = {};
fb_param.pixel_id = 'xxxxxxxxxxxxx';
fb_param.value = '0.01';
fb_param.currency = 'USD';
(function(){
var fpw = document.createElement('script');
fpw.async = true;
fpw.src = '//connect.facebook.net/en_US/fp.js';
var ref = document.getElementsByTagName('script')[0];
ref.parentNode.insertBefore(fpw, ref);
})();
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook...38;currency=USD" /></noscript>
 

and change things like USD, 0.01, xxxxxxxxxxxxx with variables like in example that i linked above

Link to comment
Share on other sites

Hi there,

 

If you are  interested in a easier and straightforward solution, then there is already a module on PrestaShop Addons market place that will automatically detect the order confirmation pages and add the Facebook tracking pixel on the order confirmation page to track the conversions. Below is the link to the module.

 
 
All you have to do is to insert your Facebook pixel id in the configuration screen of the module, rest is handled by the module.
 
I hope you find it useful. Support response is readily available (depending on timezone differences) should you need any help.
Link to comment
Share on other sites

×
×
  • Create New...