InSales integration
With the platform InSales you can create an online store completely independently and quickly, without any help of programmers or developers.
The integration is done directly in the admin panel using a special section designed for custom JavaScript codes for Thank You page.
You can track order ID, order total, you can use per product tracking, and Lifetime Commissions.
Order tracking
To track per order commission, use the code below. Place it to Settings > General in your admin panel – there is a special text area for ‘javascript-code‘.
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">PostAffTracker.setAccountId('Account_ID');
var sale = PostAffTracker.createSale();
sale.setTotalCost('{{order.total_price}}');
sale.setOrderID('{{order.number}}');
sale.setProductID('{% for item in order.items%}{{item.title}}{% if order.items.size> 1%}, {% endif%}{% endfor%}');
sale.setData1('{{order.client.email}}');
PostAffTracker.register ();
</script>
Save your work and you are done!
Per product tracking
In case you want to track each item as a separate commission, use the following code instead.
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">PostAffTracker.setAccountId('Account_ID');
{% for item in order.items %}
var sale{% forloop.counter %} = PostAffTracker.createSale();
sale{% forloop.counter %}.setTotalCost('{{item.total_price}}');
sale{% forloop.counter %}.setOrderID('{{order.number}}({% forloop.counter %})');
sale{% forloop.counter %}.setProductID('{{item.id}}');
sale{% forloop.counter %}.setData1('{{order.client.email}}');
PostAffTracker.register ();
{% endfor %}
</script>
Save your work and that’s it.
Do not forget to integrate your site with the click tracking code – it needs to be added into every page you want to use as a destination URL for your affiliate banners/links.