Skip to main content
Skip table of contents

Webgains Leads Conversion Tracking

Here you can find information about integrating as a Webgains advertiser tracking Leads conversions, which consists of two pieces of code that need adding to your site that allow us to track leads generated by Webgains affiliates.

Prior to this, please ensure you have your Program ID, and have been contacted by your Webgains Integration Manager regarding the set-up.

To comply with the regulations governing cookies under the GDPR and the ePrivacy Directive you must receive users' consent before you use any marketing cookies, including the landing page script.

Step 1 - The Landing Page Script

The Landing Page Script must be placed on every page of your website. It is used to record our WGU value to track where the request has originated from (which campaign) so we can track sales to that publisher campaign for that session.

The landing page script is copy & paste script (below), replacing “XXXXXX” in line 9 with your unique program ID. If you are unsure of your program ID please speak to your Integration Manager. This script needs to be added to every page of your website.

CODE
<script>
(function(src) {
var o = 'ITCLKQ';
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/XXXXXX/main.min.js');
ITCLKQ('set', 'internal.api', true);
ITCLKQ('set', 'internal.cookie', true);
ITCLKQ('click');
</script>

We also use this script to activate our additional Publisher Services, should you wish to work with any.

More information on this can be found here and the services can be activated within your account under the Tracking page.

Step 2 - The Conversion Script

This script must be added at the bottom of the ‘confirmation’ page of your site. That is, the page a customer reaches after successfully completing a Lead.

If the page is developed in HTML, then please make sure the code lies between the <BODY></BODY> tags.

The tracking code consists of various elements that you report back to us. Depending on the type of commission you have opted for, some of the variables are omitted accordingly. For full details on the script values, please view our full tracking guide here.

The default conversion script is as below, replacing “XXXXXX” in lines 2 and 3 with your unique program ID and commission event ID (respectively). If you are unsure of your program and event IDs, please speak to your Integration Manager.

CODE
<script> 
var programid = 'XXXXXX'; 
var eventid = 'XXXXXXX'; 
var ts = Math.round((new Date()).getTime() / 1000); 
(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: '0.00',
currency: '',
language: 'en_EN',
eventId: eventid,
orderReference: ts, 
comment: '',
multiple: '',
checksum: '',
items: '', customerId:'',
customerType: '',
voucherId: '',
location: document.location.href 
});
ITCVRQ('conversion');
</script>

The order value is set as "0.00", and we include a script function which generate an 'order reference' time stamp value for each lead we track.

After the code has been implemented, please let your integration manager know and they will test that this has been configured correctly and advise of any changes that need to be made.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.