Integration with Chargify is achieved by placing a sale tracking script into the thank you page using a simple JavaScript logic.

1.

First step

The first step would be to find the needed section where you can place the click tracking and sale tracking code. In your Chargify account navigate to Settings> Public Page Default Settings and find the section called Custom JavaScript

2.

Sale tracking

Put the following code into the section described in the previous step:

</script>
<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();
try {
PostAffTracker.track();
} catch (err) { }

if (document.getElementById('analytics-signup-payment-id') != null) {
PostAffTracker.setAccountId('default1');
var sale = PostAffTracker.createSale();
sale.setTotalCost($('#analytics-signup-revenue').html());
sale.setOrderID($('#analytics-signup-payment-id').html());
sale.setProductID($('#analytics-product-id').html());
sale.setCurrency($('#analytics-currency').html());

PostAffTracker.register();
}


It is now integrated. Every time a customer enters the order confirmation page, the tracking code is called, and it will register a sale for referring affiliate.