Integration via tracking code for financial programs

  • Updated

Purpose of the tracking code

The tracking code is a JavaScript code that you are to place on your website.

Tracking code tracks data about users’ actions on your website and sends it to the Admitad Partner Network statistics. When the tracking code is triggered, the Admitad Partner Network server receives a request with information about this action (order ID, order amount, etc.).


Besides, the tracking code is used for order deduplication and cross-device tracking.


  • Insert the code in the <head> tag before all other scripts, otherwise, a user may close the page before the script is triggered.
  • We do not recommend installing it in Google Tag Manager (GTM), as it may be blocked by popular ad blockers. This can lead to losses of orders, discrepancies in the analytics, and problems with verifications.
  • When the site is updated, it is necessary to check out that the code has not been deleted and continues working.
  • If there is a mobile version of the website or a mobile app, or several order forms, make sure that the tracking code is installed there, too.

To get started with Admitad Partner Network, provide a link to your website with all GET parameters and UTM parameters you need.

Link example

This link will be used for generating affiliate links for our publishers. In the future, they will place affiliate links on their ad spaces and drive traffic to your website.

You can provide several links, but only one of them will be set as a default link of your program.

Setup of the tracking code

To set up the tracking code, insert the script to all pages of your website.

During integration, we will send you the campaign_code value.

  • <script src="{your_campaign_code}" async onerror='var self = this;window.ADMITAD=window.ADMITAD||{},ADMITAD.Helpers=ADMITAD.Helpers||{},ADMITAD.Helpers.generateDomains=function(){for(var e=new Date,n=Math.floor(new Date(2020,e.getMonth(),e.getDate()).setUTCHours(0,0,0,0)/1e3),t=parseInt(1e12*(Math.sin(n)+1)).toString(30),i=["de"],o=[],a=0;a<i.length;++a)o.push({domain:t+"."+i[a],name:t});return o},ADMITAD.Helpers.findTodaysDomain=function(e){function n(){var o=new XMLHttpRequest,a=i[t].domain,D="https://"+a+"/";"HEAD",D,!0),o.onload=function(){setTimeout(e,0,i[t])},o.onerror=function(){++t<i.length?setTimeout(n,0):setTimeout(e,0,void 0)},o.send()}var t=0,i=ADMITAD.Helpers.generateDomains();n()},window.ADMITAD=window.ADMITAD||{},ADMITAD.Helpers.findTodaysDomain(function(e){if(window.ADMITAD.dynamic=e,window.ADMITAD.dynamic){var n=function(){return function(){return self.src?self:""}}(),t=n(),i=(/campaign_code=([^&]+)/.exec(t.src)||[])[1]||"";t.parentNode.removeChild(t);var o=document.getElementsByTagName("head")[0],a=document.createElement("script");a.src="https://www."+window.ADMITAD.dynamic.domain+"/static/",1)+".min.js?campaign_code="+i,o.appendChild(a)}});'></script>

The code in the onerror attribute prevents erroneous blocking of the script loading by ad blockers and antivirus software.

Setup of the order data transmission

Transfer of order information

If you work with one of the major affiliate networks, the Admitad Partner Network tracking code can independently collect order information using already configured integration. Go to the Order deduplication section to see examples for other affiliate networks. Skip this section, if you have found your affiliate network in the examples.

After you insert the script to all pages, set up the transfer of order data. To do this, add the code from the example below to the thank you page.

Example of the code

{{value}} — replace it with a value of a real variable.

  • <script type"text/javascript">
    ADMITAD = window.ADMITAD || {};
    ADMITAD.Invoice = ADMITAD.Invoice || {}; = 'adm';  // deduplication parameter (for Admitad by default)
    ADMITAD.Invoice.category = '1';  // action code (defined during integration)
    var orderedItem = [];  // temporary array
    	Product: {
    		category: '1',  // tariff code (defined during integration)
    		price: '{{price}}',  // product price
    		priceCurrency: 'RUB',  // currency code in the ISO-4217 alfa-3 format
    	orderQuantity: '1',  // always 1
    	additionalType: 'sale'  // always sale
    ADMITAD.Invoice.referencesOrder = ADMITAD.Invoice.referencesOrder || [];
    	orderNumber: '{{order number}}',  // internal order ID (not more than 100 characters)
    	orderedItem: orderedItem
    // Important! If order data is loaded via AJAX, uncomment this string.
    // ADMITAD.Tracking.processPositions();

Be sure to find orders by this orderNumber in your CRM, as it will be used for verifications in the future.

Setting up order data transfer when using AJAX or a 1-click ordering

If the data of an Admitad Partner Network order are loaded via AJAX or if you implement 1-click ordering, add the script below right after the order data collection code. You can see an example of its use above in the "Note" string.

<script type="text/javascript">

Setting up data transfer of unique promo codes

Unique promo codes are promo codes that are linked to a specific publisher. Learn more about them here.

To use unique promo codes:

1. Make sure there is a coupon entry field on the checkout page

2. Enter the unique promo code from the checkout page to the parameter discountCode.

  • ADMITAD.Invoice.referencesOrder = ADMITAD.Invoice.referencesOrder || [];
    // adding items to the order
    	orderNumber: '{{order number}}',  // internal order ID (not more than 100 characters)
    	discountCode: '{{promocode}}',  // unique promo code
    	orderedItem: orderedItem

3. Transferring the unique promo code order information always set up “adm” value to the deduplication parameter as the order belongs to Admitad Partner Network. = 'adm';

Attribution logic

  • integration-via-tracking-code-_BIri04r.png

4. Transferring a regular order (not one with a unique promo code), use the standard deduplication setting.

Order deduplication

If you work only with Admitad Partner Network, use the default value of the deduplication parameter and skip this step.

If you work with more than one paid source, enable order deduplication on your end so that order information gets transferred in accordance with Last Paid Click:

  1. Inform the employee of the Admitad Partner Network tracking department which GET parameter you are going to use for deduplication. By default, the parameter is not added.
  2. Create a deduplication cookie with the source value. Cookie must be stored during the entire period specified in your agreement (the default period is 90 days).
  3. Define the value of the deduplication parameter from the cookie when transmitting order data in the parameter. This way we can define which source the order belongs to. For Admitad Partner Network orders, the value of the deduplication parameter must be adm. Orders with the values of other paid sources will not be created. Orders with an undefined source will be created if a user visited the website by clicking an Admitad Partner Network affiliate link on another device or browser during the cookie lifetime.

Example of the code where the cookie is used to store the click source

  • <script type="text/javascript">
    // name of the cookie that stores the source
    // change if you have another name
    var cookie_name = 'deduplication_cookie';
    // cookie lifetime
    var days_to_store = 90;
    // expected deduplication_cookie value for Admitad
    var deduplication_cookie_value = 'admitad';
    // name of GET parameter for deduplication
    // change if you have another name
    var channel_name = 'deduplication_channel';
    // a function to get the source from the GET parameter
    getSourceParamFromUri = function () {
    	var pattern = channel_name + '=([^&]+)';
    	var re = new RegExp(pattern);
    	return (re.exec( || [])[1] || '';
    // a function to get the source from the cookie named cookie_name
    getSourceCookie = function () {
    	var matches = document.cookie.match(new RegExp(
    		'(?:^|; )' + cookie_name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + '=([^;]*)'
    	return matches ? decodeURIComponent(matches[1]) : undefined;
    // a function to set the source in the cookie named cookie_name
    setSourceCookie = function () {
    	var param = getSourceParamFromUri();
    	if (!param) { return; }
    	var period = days_to_store * 60 * 60 * 24 * 1000; // in seconds
    	var expiresDate = new Date((period) + +new Date);
    	var cookieString = cookie_name + '=' + param + '; path=/; expires=' + expiresDate.toGMTString();
    	document.cookie = cookieString;
    	document.cookie = cookieString + '; domain=.' +;
    // set cookie
    // define a channel for Admitad
    if (!getSourceCookie(cookie_name)) { = 'na';
    } else if (getSourceCookie(cookie_name) != deduplication_cookie_value) { = getSourceCookie(cookie_name);
    } else { = 'adm';

Example of deduplication parameters of other affiliate networks

If you use the tracking code of another affiliate network to integrate with Admitad Partner Network, after you remove it, the integration with Admitad Partner Network will be broken as well. Please inform us before removing the code.

Cross-device tracking

Cross-device tracking allows publishers to get rewards for orders even if users use several devices. This will make the program more appealing to publishers who, for instance, drive mobile traffic.

The function is enabled by default. When users visit the advertiser’s site, we create their unique anonymous profile to collect the relevant data. When a user makes an order, we cross-reference the data collected within their profile and create an order for them in case they already have an admitad_uid. This function works best with the order deduplication setup. To help Admitad Partner Network identify users precisely, transmit their unique identifiers, i.e. email addresses or their website logins. Unique identifiers have priority over anonymous profiles: if you transmit accountId, then the request to Admitad Partner Network does not contain the data of an anonymous profile, but your value is used.

Insert the snippet below to the pages where the user email or login are known.

<script type="text/javascript">
   ADMITAD = window.ADMITAD || {};
   ADMITAD.Invoice = ADMITAD.Invoice || {};
   ADMITAD.Invoice.accountId = '';  // user e-mail or login in your system

Admitad Partner Network does not store the value of this parameter and does not transmit it unsecured.

The value of the variable is irreversibly hashed in Sha256(ADMITAD.Invoice.accountId + salt), and is then used by Admitad Partner Network as a unique identifier of the user’s orders.

This identifier will attribute the order to a certain user, even if the user first opens an Admitad affiliate link on their PC, and then makes the order from a mobile device on their way to work. The order will not be lost; it will still be registered in the Admitad Partner Network statistics.

Tracking testing

1. Make sure that you have set up the tracking code and order data transmission. Note that if you have a mobile website, quick order forms, or 1-click order forms, they should also be integrated.

For this purpose, you can use the Chrome extension TagTag Check. It will check if you have installed all the necessary scripts, parameters, and cookies on your website pages, including the thank you page.

To install the extension, follow this link. Then go to the website and open the extension. If the integration is configured properly, all fields will be ticked. If one of the required elements is missing or incorrect, it will be marked with integration-via-tracking-code-_eebeUdP.png, and in the Details column, there will be an error description.


To check if you have set up the integration on the thank you page, go to it and click the toggle button.


2. After that contact the Admitad Partner Network tracking department and request a test link.

If your program has several actions (e.g. “Registration” and “Paid order”), you need to test each of them.

3. Follow the test link to your website. Check if the address bar contains all required GET parameters and UTM parameters.

4. Perform an action on the website. For example, fill an application or pay for a product.

5. While you are on the thank you page, open the TagTag Check extension and select the Tracking requests tab. Make sure that the request has been sent.

6. If the tracking is set correctly, the action will appear in the Admitad Partner Network statistics (account — Reports — on actions). Check if the action name, action ID, and order amount are correct.


In case you run the tests successfully, inform the Admitad Partner Network specialists about it. They will prepare the program for launch.

Problems that can arise during testing

If the action has not appeared in the statistics, probably, you have made a mistake when installing and setting up the tracking code.

Problem How to fix it
The script does not work. No requests from the script on the Network browser tab. The script is installed incorrectly.
Follow the instructions of the section Setting the tracking code.
The script does not work. There are errors in the browser console. Follow the instructions of the section Setting up order data transmission.
Check the syntax of JavaScript on the thank you page
The script is triggered. There are no errors in the browser console. The order has not appeared in the statistics. The value of the campaign_code parameter is invalid or missing.
Check the value of campaign_code with the Admitad Partner Network specialist.
The script is triggered. There are no errors in the browser console. The value of the campaign_code parameter is correct. The order has not appeared in the statistics. To identify the error, go to the request log (Tools Request log). The error text is specified in the Result field. Correct the error and retest.
Guide on the Request log is available here.
The script is triggered. There are no errors in the browser console. The value of the campaign_code parameter is correct. No errors in the Request log section. The order has not appeared in the statistics. There is a log delay on the Admitad Partner Network side, wait an hour and then check again.
The script is triggered. There are no errors in the browser console. The value of the campaign_code parameter is correct. No errors in the Request log section. The order has not appeared in the statistics within an hour. Ask the Admitad Partner Network specialist for help.

Was this article helpful?