CommerceV3 (CV3)

CV3 is the leading full service cloud platform for high volume digital commerce.

CommerceV3 (CV3) allows full customization of all templates and that is what we'll use for the integration.

1.

Add click tracking code

In your CommerceV3 (CV3) admin panel go to Content->Design->Template Library and under Site Design Templates find and edit the Footer (footer.tpl) template. Insert the following code to the beginning of the file, save it and publish it:

{literal}
<script id="pap_x2s6df8d" src="http://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
PostAffTracker.setAccountId('Account_ID');
try {
PostAffTracker.track();
} catch (err) { }
</script>
{/literal}

2.

Add sale tracking code

In your CommerceV3 (CV3) admin panel go to Content->Design->Template Library and under Checkout Templates find and edit the Checkout Thank You Page (checkout_thanks.tpl) template. Insert the following code to the end of the file, save it and publish it:

<script id="pap_x2s6df8d" src="http://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
PostAffTracker.setAccountId('Account_ID');
var sale = PostAffTracker.createSale();
productIds = '';
{foreach from=$cart item=prods}
productIds += '{if $prods.att_sku == ''}{$prods.sku}{else}{$prods.att_sku}{/if}, ';
{/foreach}
productIds = productIds.slice(0,-2);
sale.setTotalCost('{$placed.totals.subtotal}');
sale.setOrderID('{$placed.order.id}');
sale.setProductID(productIds);

PostAffTracker.register();
</script>

To allow Lifetime Commissions you can save the contact's email to Data 1 field of the commission by adding this line to the code above:
sale.setData1('{$placed.info.billing.email}');

If you wish to save additional customer details you can use these variables:
{$placed.info.billing.first_name}
{$placed.info.billing.last_name}
{$placed.info.billing.phone}


It is now integrated. Every time customer enters the thank you for order page, the tracking code is fired, and it will register a commission for the referring affiliate.