Partner
Put an invisible Asynchronous JavaScript code anywhere in the “thank you for order” or order confirmation page that is displayed to the customer after an order is placed or payment is processed.
Post Affiliate Pro is compatible with nearly ALL merchant accounts, payment gateways, shopping carts and membership systems.
What does integration mean?
Integration is a way to connect the affiliate system to your current website, shopping cart or payment gateway in a way the affiliate system will be notified about purchases. When notified, the affiliate system registers the sale, identifies the referring affiliate (if any) and creates an appropriate commission for them
This particular method presented here is about putting an invisible Asynchronous JavaScript code anywhere in the “thank you for order” or order confirmation page that is displayed to the customer after an order is placed or payment is processed.
Asynchronous JavaScript version of general sales/leads tracking code
JavaScript version of integration code is generally recommended, because it allows using advanced tracking techniques. The Asynchronous JavaScript version of general sales/leads tracking code loads only after your site has been fully loaded, so it won’t cause any delay in the load time of your web site.
Open your order confirmation or “thank you for order” page template, and put the following code somewhere into the page:
<div id='papSaleTrackingPlaceholder'></div>
<script type="text/javascript">
(function(d,t) {
var script = d.createElement(t); script.id= 'pap_x2s6df8d'; script.async = true;
script.src = '//URL_TO_PostAffiliatePro/scripts//trackjs.js';
script.onload = script.onreadystatechange = function() {
var rs = this.readyState; if (rs && (rs != 'complete') && (rs != 'loaded')) return;
PostAffTracker.setAccountId('Account_ID');
var sale = PostAffTracker.createSale();
sale.setTotalCost('120.50');
sale.setOrderID('ORD_12345XYZ');
sale.setProductID('test product');
try { PostAffTracker.track(); } catch (e) {}
}
var placeholder = document.getElementById('papSaleTrackingPlaceholder');
placeholder.parentNode.insertBefore(script, placeholder);
placeholder.parentNode.removeChild(placeholder);
})(document, 'script');
</script>
where the parameters in setTotalCost(), setOrderID() and setProductID() should be replaced with correct values.
- Total Cost -(mandatory for % commissions) – price of the product
- Order ID – (optional) – can be your unique generated order ID to cross-check the sale.
- Product ID – (optional) – the ID of the product bought.
All fields are optional, but without Total Cost the system will not be able to compute percentage commissions. Also, Product ID is required if you want to take advantage of campaign recognition based on product IDs.
If you need to set total sale cost and order id, but you don’t have access to their values in your “Thank you” page, the situation is more complicated. There is no general solution for this. If you know that you can register the sale at some other place where those values (total cost and order id) are available, you can put the tracking code there. Otherwise, you may contact the creator of your shopping cart for some advice regarding the possibility of placing a conversion tracking code into your e-commerce site (shopping cart) or you may contact us and we would try to help you to find a possible solution (if any).