PrestaShop
IMPORTANT!
- Iframe tracking and Big Bear attribution work together to offer the best attribution coverage possible so they both need to work in accordance with they’re specific documentation.
- As affiliates are paid only for the sales they generate, make sure this attribution codes work as long as the affiliate program is active in 2Performant.
Here you can find specific information that can help you install 2Performant attribution codes if you have an online shop on PrestaShop.
The attribution codes are necessary to record the conversions coming from the traffic sent by the affiliates and represent an essential point in the operation of the affiliate program.
The attribution codes that must be implemented and maintained by an advertiser are of 2 types:
- Big Bear attribution / full 1st party tracking
- iframe tracking / 1st party – 3rd party tracking
Big Bear attribution
The attribution codes required for the Big Bear involve 2 different scripts:
- script that must be installed in the footer of all pages
- script to be installed on the thank you page / order confirmation page for fast and normal orders, for orders placed with or without an account and for all payment and shipping methods
In the case of Big Bear attribution, the script details are only available if you log in to your advertiser account and go to the Big Bear section: https://network.2performant.com/advertiser/attribution/big_bear_attribution
From there, you can download personalized PDF documentation for installing Big Bear attribution on your site.
iframe tracking
Iframe tracking code must be placed on the thank you page / order confirmation page for fast and normal orders, for orders placed with or without an account and for all payment and shipping methods.
For script details you will need to log in to your account and go to the iframe section: https://network.2performant.com/advertiser/attribution/iframe_tracking
If you are using PrestaShop as an e-commerce platform, then you will need to edit two files: controllers/front/OrderConfirmationController.php and themes/theme/order-confirmation.tpl (OR themes/theme/templates/checkout/order-confirmation.tpl for Prestashop V1.7.X)
Replace the following placeholders with the program values:
CAMPAIGN_UNIQUE: you received it by e-mail
CONFIRM: you received it by e-mail
initContent()
function, just before setting the template as ‘order-confirmation.tpl’, add:
$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(), 'total_products'=>$order->total_products_wt, 'description'=>$description ));
order-confirmation.tpl
you will need to add the following code, modified with your own variables and values (if you want to substract the VAT from the order total):
<iframe height='1' width='1' scrolling='no' marginheight='0' marginwidth='0' frameborder='0' src='https://event.2performant.com/events/salecheck?amount={$total_products}&campaign_unique=CAMPAIGN_UNIQUE&confirm=CONFIRM&description={$description}&transaction_id={Tools::getvalue('id_order')}&'></iframe>
For Prestashop V1.7.X, the above code should be added just before the last {/block}. Please make sure to clear the cache after saving the template (in Admin: Configure\Advanced parameters\Performance\Clear cache) .