Integration with Zoey supports per product, coupon codes and lifetime commissions tracking.

1.

Locate the Order Success page

After logging in to your Zoey account you need to click the Edit My Design option in the left side menu and locate the Order Success page to edit it.

Once there you need to click the plus icon + in the upper left corner of the editor and add the general Order Success code to the page. Double click the added section to add your preferred sale tracking code from the following sections, make sure you remove the prefilled content from the section.

Decide whether you wish to create one commission per whole order or separate commission for each purchased product. The latter is recommended only if you wish to have different commissions for different products.

2.

Adding click tracking code

Click tracking code is required for creating customer-affiliate relation.

When editing the Order Success page click the gear icon in the upper right corner, then click Manage Assets. In the popup choose HTML After Body section and click on Edit HTML button at the right side. Insert the following click tracking code:

<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>

3.

Adding per order tracking code

Insert the following code to the Order Success section of the Order Success page:

<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 papItems = [orderItems];
    var purchasedProductSKUs = '';
    for (i=0; i < papItems.length; i++) {
        purchasedProductSKUs += papItems[i].sku + ', ';
    }
    var sale = PostAffTracker.createSale();
    sale.setTotalCost('[orderSubtotal]');
    sale.setOrderID('[orderNumber]');
    sale.setProductID(purchasedProductSKUs.slice(0, -2));
    sale.setData1('[customerEmail]');
    sale.setCoupon('[couponCode]');
    
    PostAffTracker.register();
</script>

4.

Adding per product tracking code

Insert the following code to the Order Success section of the Order Success page:

<script id="pap_x2s6df8d" src="http://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
    PostAffTracker.setAccountId('Account_ID');
    discountedperc = 1 + [discountAmount] / ([orderSubtotal]);
    var papItems = [orderItems];
    for (i=0; i < papItems.length; i++) {
        var sale = PostAffTracker.createSale();
        sale.setTotalCost(papItems[i].price * papItems[i].qty * discountedperc);
        sale.setOrderID('[orderNumber](' + (i + 1) + ')');
        sale.setProductID(papItems[i].sku);
        sale.setData1('[customerEmail]');
        sale.setCoupon('[couponCode]');
        
        if (i != papItems.length -1) {
            sale.doNotDeleteCookies();
        }
        PostAffTracker.register();
    }
</script>


Make sure you save all your changes as you do them and when you are done press the Save & Publish button in the upper right corner to push your changes to your live website.