How to setup Refersion affiliate tracking with PayWhirl

This article explains how to track affiliate sales on PayWhirl using Refersion tracking scripts.

Ryan P. avatar
Written by Ryan P.
Updated over a week ago

To set up affiliate tracking with Refersion (https://www.refersion.com/tracking) you will need to set up the PayWhirl Custom Scripts App and paste the provided codes from Refersion into the app.

Once you have the PayWhirl custom scripts app installed you will see TWO tabs where you can paste tracking codes from 3rd parties:

On Refersion, you need to track VISiTS AND CONVERSIONS, so we will use both tabs. In the "Every Page" tab, we will paste our Refersion code to track all visits.

<!-- REFERSION TRACKING: BEGIN -->

<script src="//www.refersion.com/tracker/v3/pub_0123456789DEMO.js"></script>
<script>_refersion();</script>

<!-- REFERSION TRACKING: END -->

DON'T FORGET TO UPDATE YOUR REFERSION PUB-ID IN THE URL OF ALL SCRIPTS FROM REFERSION BEFORE YOU PASTE THEM INTO PAYWHIRL!!!

Refersion PUB-ID's looks like this: pub_0123456789DEMO.js

Finally, in the "Conversion" tab, we need to paste the script from Refersion that will load only after customers have made a purchase (aka the "thank you" or conversion page).

<!-- REFERSION TRACKING: BEGIN -->

<script src="//www.refersion.com/tracker/v3/pub_0123456789DEMO.js"></script>
<script>
_refersion(function(){

_rfsn._addTrans({
'order_id': '{{ invoice.id }}',
'shipping': '{{ invoice.shipping_total }}',
'tax': '{{ invoice.tax_total }}',
'discount_code': '{{ invoice.promo_code }}',
'currency_code': 'USD'
});

_rfsn._addCustomer({
'first_name': '{{ customer.first_name }}',
'last_name': '{{ customer.last_name }} ',
'email': '{{ customer.email }}'
});

         {% for item in invoice.items %}

         _rfsn._addItem({    
                'sku': '{{ item.sku }}',    
                'quantity': '{{ item.quantity }}',    
                'price': '{{ item.amount }}'
         });

         {% endfor %}

_rfsn._sendConversion();

});
</script>
<!-- REFERSION TRACKING: END -->

That's it on the PayWhirl side... However, you might still need to install the Refersion visitor tracking script on every page of your main website as well. If so, you can find the instructions under step #1 on this page of their website. 

Related Articles:

Please let us know if you have any questions.

Sincerely,
The PayWhirl Team

Did this answer your question?