Integration for online games

  • Updated

Admitad tracking method

When a user follows an affiliate link, Admitad generates a unique identifier that is passed through a redirect to the advertiser's page. The advertiser stores the identifier in their database or in cookies. If the user performs an action, the advertiser passes this identifier to the Admitad system.

 

Admitad tracking algorithm

1. A user follows the affiliate link of the publisher, which leads to our server (for example, https://ad.admitad.com/g/e8f129b05eb7e16523946213826a88/)

2. At this moment, our server generates a UID (unique user identifier that stores information about the publisher, click time, and click source), and inserts it as a value into the corresponding GET parameter of the transition link to your website. Along with the UID, other parameters are also passed, such as the publisher's ID, and static parameters, like UTM tags for Google Analytics.

Thus, a transition link may look as follows:
http://yoursite.ru/?utm_source=admitad&utm_medium=cpa&admwm={{publisher_id}}
&admitad_uid=0123456789abcdef0123456789abcdef

where utm_source and utm_medium are the parameters with static values for Google Analytics, admwm is the parameter for passing the publisher's ID, and admitad_uid is the parameter for passing the unique user ID (UID).

Admitad provides an opportunity to obtain more information about publishers’ traffic. For example, publishers use the subid parameter to label traffic from different sources within the same ad space.

Thus, you will be able not only to identify the traffic from a specific publisher using publisher_id, but also to assess the quality of each source using subid. This will let you flexibly and efficiently manage publisher's traffic, without disconnecting these publishers.

Parameters and their variables are named, allocated and adjusted on the Admitad side, and requires approval from the Tracking Department.

3. After the link with all necessary parameters and their values is generated, the redirect from our server to your website occurs. You need to track each redirect with appropriate GET parameters according to the Last Paid Click attribution model.

4. After the redirect occurs, you should save the value of the unique user ID (admitad_uid) to the database or to the cookie, the cookie lifetime should be the same as specified in your contract.

5. Now this user will be associated with Admitad, all further actions (logging in to a game, achieving levels) should be passed the same way and with the same admitad_uid.

 

Integration via tracking code

Admitad transition link

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

Link example
https://site.ru/?utm_source=admitad&utm_medium=cpa

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.
 

Tracking code setup

Note:

  • 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, quick order forms, or 1-click order forms, make sure that they are also integrated.

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

During integration, we will send you the {your_campaign_code} value.

Expand
<script src="https://www.artfut.com/static/tagtag.min.js?campaign_code={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+"/";o.open("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/"+window.ADMITAD.dynamic.name.slice(1)+window.ADMITAD.dynamic.name.slice(0,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.

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

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

Example of the code for action type “Registration"

Expand
<script type="text/javascript">
ADMITAD = window.ADMITAD || {};
ADMITAD.Invoice = ADMITAD.Invoice || {};
ADMITAD.Invoice.broker = "adm";  // deduplication parameter (for Admitad by default)
ADMITAD.Invoice.category = "1";  // action code (action_code)

var orderedItem = [];  // temporary array

orderedItem.push({
  Product: {
     category: '1',  // tariff_code (defined during integration)
  },
  additionalType: "lead"          
});

ADMITAD.Invoice.referencesOrder = ADMITAD.Invoice.referencesOrder || [];

ADMITAD.Invoice.referencesOrder.push({
  orderNumber: "Reg_{{order number}}",  // internal registration ID (not more than 100 characters)
  orderedItem: orderedItem
});

// Note! If order data is loaded via AJAX, uncomment this string.
// ADMITAD.Tracking.processPositions();
</script>

 

Integration via postback 

Postback (post back, post-back) is sometimes called “pingback”, “server to server pixel (s2s pixel)”, “s2s postback” or “server tracking post back”.

Postback is used for tracking user's actions, the request is sent from server to server using a secret key - postback_key/pk, when a certain event happens.

Postback example

An example for a program that pays rewards for such actions as registration, logging in to the game, and achieving a level (active player).

Registration:
https://ad.admitad.com/r?campaign_code=123123cbde&pb=1&pk=5583743172688F1f069dCaF21F142c16&ac=1&tc=1&uid={{admitad_uid}}&oid=reg_{{id}}

Active registration (entering the game):
https://ad.admitad.com/r?campaign_code=123123cbde&pb=1&pk=5583743172688F1f069dCaF21F142c16&ac=2&tc=1&uid={{admitad_uid}}&oid=eff_{{id}}

Active player (achieving a level):
https://ad.admitad.com/r?campaign_code=123123cbde&pb=1&pk=5583743172688F1f069dCaF21F142c16&ac=3&tc=1&uid={{admitad_uid}}&oid=ap_{{id}}

 

Required parameters

Parameter name
(aliases are in italics)

Description Type Comment
uid Admitad ID  string, 32 symbols the generated value, received in the admitad_uid parameter when the user comes to the website
campaign_code program code string, 10 symbols a constant, its value is specified in the postback request that was sent to you at the beginning of integration
action_code, ac, product, product_code action code integer a variable, its value is sent to you by a specialist of the tracking department at the beginning of integration
tariff_code, tc rate code integer a variable, its value is sent to you by a specialist of the tracking department at the beginning of integration
postback, pb key for authorizing a postback request string, 1 symbol a constant, value = 1
postback_key, postback_hash, pk key for identifying a postback request string, 32 symbols a constant, its value is specified in the postback request that was sent to you at the beginning of integration
oid  user/action ID an arbitrary string or numeric value used for identifying actions generated by the advertiser

For oid, prefixes are used, since the system accepts only unique values. For example, registration is reg_123; active registration: eff_123; active player: ap_123; purchase in the game: pay_123. Where 123 is the advertiser's user ID.

 

Integration via XML

This information will help you to create and configure an XML file with orders for sending the data to Admitad.
Correct and up-to-date XML files directly impact the stability of your affiliate program and, consequently, the efficiency of the publishers who generate sales for your program.

1. Place XML files on a reliable server that will always be available and supports uploading a file via a direct link.

2. Loading XML files from an FTP server, protection of XML files with the use of basic HTTP authorization, and the use of GET parameters in the link are supported.

3. XML files may be protected with IP address filtering (the IP addresses of our server can be provided by Admitad technical specialists).

4. After configuring an XML file, it is necessarily tested by an Admitad specialist.

5. If you have suggestions for the test order (a special test account, a special phone number, and/or comment to the order), make sure to inform the Admitad employee before the testing of the installed codes.

6. Besides, be sure to inform the Admitad employee about the name of the cookie that identifies the publisher and the traffic source.

Required parameters

Parameter name
(aliases are in italics)
Description Type Comment
 uid, key Admitad ID  string, 32 symbols the generated value, received in the admitad_uid parameter when a user comes to the website
order_id, oid your internal order ID string, 1-100 symbols

your internal order ID

action_code, ac, product, product_code action code integer a variable, its value is sent to you by a specialist of the tracking department in the beginning of integration
tariff_code, tc rate code integer a variable, its value is sent to you by a specialist of the tracking department in the beginning of integration
datetime_action,  now action time integer or fractional  
price price of an item integer or fractional  
comment comment arbitrary value  

Fractional numeric values, except for price, are not allowed.

 

Example of an XML file 

<payment_list>
<payment>
   <key>fc49ebe81383f4df15f62e96439ecd3a</key>
   <oid>reg_2000412116922</oid>
   <product_code>1</product_code>
   <comment>lead</comment>
</payment>
<payment>
   <key>fc49ebe81383f4df15f62e96439ecd3a</key>
   <oid>reg_2000410857716</oid>
   <product_code>1</product_code>
   <comment>lead</comment>
</payment>
<payment>
   <key>f657d55c840b0743f5c6b856611f0a1a</key>
   <oid>eff_2000412458735</oid>
   <product_code>2</product_code>
   <comment>sale</comment>
</payment>
</payment_list>

Was this article helpful?