Ixtein Posted April 10, 2014 Share Posted April 10, 2014 (edited) Hi, we have e-shop (Prestashop 1.4.9) and we would like to add Facebook code to track conversion. We've read the discusions here, but we can't still find out, how to make it work. People in discussion solve just a tracking pixel for affilates (is it the same?) and then for Prestashop 1.5. ... We suppose it's not just about adding the code into order-confirmation.tpl? Thank you for your all advices Ix The code: <!-- Facebook Conversion Code for Objednávky --> <script type="text/javascript"> var fb_param = {}; fb_param.pixel_id = 'xxxxxxxx'; fb_param.value = '0.00'; fb_param.currency = 'CZK'; (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=xxxxxxx&value=0¤cy=CZK" /></noscript> Edited April 10, 2014 by Ixtein (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted April 10, 2014 Share Posted April 10, 2014 yess, affiliate is the same as this one. just change these datas fb_param.pixel_id = '6015760270313'; fb_param.value = '0.00'; fb_param.currency = 'CZK'; according to the guides available here on forum Link to comment Share on other sites More sharing options...
Ixtein Posted April 10, 2014 Author Share Posted April 10, 2014 But please, could you help us which instrucions in that discussion should we follow? Which step shoud we start with? Is the 1st step?: go to the:themes/your_theme/order-confirmation.tplpaste your code there and:instead the: __ADD_TRANSACTION_ID__use: {Tools::getvalue('id_order')} and then: open the file:controllers/front/OrderConfirmationController.phpyou've got there:$this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl');right before this code, paste this one: $order = new Order($this->id_order); $cart = new Cart($order->id_cart); $description=""; foreach ($cart->getProducts() AS $k=>$v){ $description.=$v['name']."X".$v['quantity']; } $description=urlencode($description); $this->context->smarty->assign(array( 'total_to_pay'=>$order->getOrdersTotalPaid(), 'description'=>$description ));then in order-confirmation.tpl use:{$total_to_pay} instead the __ADD_SALE_VALUE__{$description} instead the __ADD_DESCRIPTION__ Is this all? Where should we add the Facebook tracking code? We are sory we bother you with that, but we aren't native english speakers and not good programmers Thank you Link to comment Share on other sites More sharing options...
vekia Posted April 12, 2014 Share Posted April 12, 2014 let's clarify something, what variables used in facebook converstion tracking mean? fb_param.pixel_id = '6015760270313'; fb_param.value = '0.00'; fb_param.currency = 'CZK'; fb_param.pixel_id - this is a ID number of pixel, you have to use it? or it's an individual id number of order? param value - order total (with tax? without tax? with shipping? without shipping?) currency - it's obious so i don't need explanation EDIT i wrote an step by step guide: fb conversion pixel you can read here how to add it with html box pro module, it will replace dynamic variables like value of order or currency Link to comment Share on other sites More sharing options...
Ixtein Posted April 12, 2014 Author Share Posted April 12, 2014 well, fb_param.pixel_id - it should be an ID number of a pixel fb_param.value - i'm not sure, but i suppose it shoud be order total with tax without shipping i found just something here: https://www.facebook.com/help/464828030234857 Thank you Link to comment Share on other sites More sharing options...
Recommended Posts