Integration with PayWhirl is done by using a PayWhirl's built-in App called "Custom Tracking Scripts"

1.

Install the app

To start with the integration, navigate to your PayWhirl account and then to Apps&Integrations. Find and install an app called Custom Tracking Scripts

Once installed you will see two different tabs on the settings page. One section will load scripts on EVERY page PayWhirl provides and the other section will only load scripts AFTER CONVERSIONS, when people complete checkout successfully - this is what we will use.

2.

Sale tracking

The first step is to give your app a name. You can name it e.g. Post Affiliate Pro

Now, choose the 'Conversion' tab and use the following code in 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();
sale.setTotalCost('{{ invoice.subtotal }}');
sale.setOrderID('{{ invoice.id }}');
sale.setProductID('{{ subscription.plan_id }}');
sale.setData1('{{ customer.email }}');
PostAffTracker.register();
</script>

If you scroll down a little you will see a full list of available variables, so if you was to customize the sale tracking code, feel free to do so using the available variables.


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.

Do not forget to integrate your site with the click tracking code.