External Webgains Knowledge Hub
Breadcrumbs

How to set-up Voucher Tracking

Voucher level tracking can optionally be added within your Webgains Tracking Script, so that you can report on which voucher code was used within a Webgains generated transaction.

This enables you to manage and report on the performance of voucher codes through the Webgains affiliate channel within our Reporting Suite.

Additionally, you can enable Voucher Commission, so you can offer a variable commission rate if a specific voucher code is used within a transaction. To learn more on how to set this up, please view: How do I set up Voucher Code commission on the platform?

Adding within the Tracking

Within your Webgains Conversion Script (located in your Order Confirmation page) is a number of elements you can set up in your tracking. Some will have already been configured during your Integration onto the Webgains network.

If you do not already track voucher codes within your Webgains transactions, you can do this via the voucherId: '', variable (line 25).

<script>
var programid = 'XXXXXX';
var eventid = 'XXXXXXX';
(function(src) {
var o = 'ITCVRQ';
window[o] = window[o] || function() {(window[o].q=window[o].q||[]).push(arguments)};
window[o].l = 1 * new Date();
var s = document.createElement('script');
var f = document.getElementsByTagName('script')[0];
s.async = 1;s.src = src;f.parentNode.insertBefore(s,f);
})('https://analytics.webgains.io/'+programid+'/main.min.js');
ITCVRQ('set', 'trk.programId', programid );
ITCVRQ('set', 'cvr', {
value: '',
currency: '',
language: '',
eventId: eventid,
orderReference: '',
comment: '',
multiple: '',
checksum: '',
items: '',
customerType: '',
customerId:'',
voucherId: '',
location: document.location.href
});
ITCVRQ('conversion');
</script>

Although voucher codes can be applied to particular products in the items array, a single voucher code can be applied to the entire transaction by using the 'voucherId' variable.

If a voucher code has been set in voucherId, any items without individual voucher codes assigned will have the voucherId applied to them.

Please ensure that the voucher discount amount is deducted from the Item Value and total Order Value, so that the values match.