From September, Flash will no longer be supported by Chrome. Prepare for the shift towards HTML5 by visiting our Flash to HTML5 help page

Check it out!

Variables

Introduction

Adform custom variables enable to pass additional information such as sales, order ids, product names or other custom values via the tracking point calls together with information collected by default - such as browser type, operating system or screen size.
The data is being sent to Adform servers and later can be used for retargeting or analytics purposes.

Order and Product level variables

Variables can be passed either on order (single value) and/or product (multiple value) levels.

Order level

Order level variables are used for values unique per each activation and are used when a single value needs to be passed at a time, such as the order ID or total sales amount of a purchase made. Such variables are defined in the scope of 'order' object:

Example of the tracking code with sales, order id and currency variables:

window.adf&&adf.ClickTrack(this,{trackingID},'Example tracking point',{sales:'insert sales value here',orderid:'insert order id value here',currency:'insert currency value here'});
Product level

Product level variables are used to pass information about each individual item, such as product cart details. Such variables are defined in the 'itms' array, which is added to the 'order' object:

Example of the tracking code with product name, id, and sales variables:

window.adf&&adf.ClickTrack(this,{trackingID},'Example tracking point',{'itms':[{productname:'insert product name value here',productid:'insert product id value here',productsales:'insert product sales value here'}]});

If there are several items which need to be passed that can be done by creating an additional item in the array:

itms: [{
    productname: 'insert product 1 name value here',
    productid: 'insert product 1 id value here',
    productsales: 'insert product 1 sales value here',
},{
    productname: 'insert product 2 name value here',
    productid: 'insert product 2 id value here',
    productsales: 'insert product 2 sales value here',
},{
    productname: 'insert product 3 name value here',
    productid: 'insert product 3 id value here',
    productsales: 'insert product 3 sales value here',
}]

Example tracking code with order and product level variables added:

window.adf&&adf.ClickTrack(this, {trackingID}, 'Example tracking point', {
    sales: 'insert sales value here>',
    orderid: 'insert order id value here',
    'itms': [{
        productname: 'insert product 1 name value here',
        productid: 'insert product 1 id value here',
        productsales: 'insert product 1 sales value here'
    }, {
        productname: 'insert product 2 name value here',
        productid: 'insert product 2 id value here',
        productsales: 'insert product 2 sales value here'
    }, {
        productname: 'insert product 3 name value here',
        productid: 'insert product 3 id value here',
        productsales: 'insert product 3 sales value here'
    }]
});
Custom variables

Variables in Adform come with predefined names, like (sales, ordered etc.) and also custom ones, which are to be renamed in Adform platform.
These variables can be passed either in the Order, or Product levels.

svn1 and svn2

svn1 and svn2 variables are used to pass a real number (integer) only, which can be later used for custom analytics report creating.

sv(x)

These variables (such as SV1, SV2) support any kind of string to be passed, and they can vary up to SV96.

var(x)

var(x) (such as var1, var2) support any kind of string to be passed, and they can vary up to var10. There variables can only be used in order level.

Example part of tracking code with custom variables:

window.adf&&adf.ClickTrack(this, {trackingID}, 'Example tracking point', {
    sv1: 'insert sv1 value here',
    svn1: 'insert svn1 value here',
    var1: 'insert var1 value here',
    'itms': [{
        sv2: 'insert sv2 value here',
        svn2: 'insert svn2 value here',
        var2: 'insert var2 value here'
    }]
});

 Supported variables:

Name JS variable name Used in Value Decoded parameter name Report type
Order level variables
Sales sales Order Real sl Custom reports
Order ID orderid Order String id Data exports
Currency currency Order String cur Custom reports
Gender gender Order  String gen Custom reports
Age group agegroup Order  String age Custom reports
Country country Order  String cntr Custom reports
Product level variables
Product name productname Product String pnm Custom reports
Product sales productsales Product Real psl Custom reports
Product ID productid Product String pid Custom reports
Product category categoryname Product String pgr Custom reports
Product category ID(DCO) categoryid Product String cid N/A
Product count productcount Product Integer pcnt Custom reports
Weight(DCO weight in rotation) weight Product Integer weight N/A 
Step(DCO view, basket or purchase event) step Product Integer step N/A 
Custom variables
var1 … var10 var1 … var10 Order String var1 … var10 Data exports
sv1 … sv7 sv1 … sv7 Both String sv1 … sv7 Custom reports
sv8 … sv89 sv8 … sv89 Both String sv8 … sv89 Data exports

svn1 and svn2 svn1 and svn2 Both Real svn1 and svn2 Custom reports

Implementation check

After variables have been implemented it can be confirmed if it is successfully passed to Adform using the Adform site tracking testing browser extension - it is available to be downloaded for Chrome browser here.

Alternatively, you can check network requests via browser’s developer tools:

 Click

Successful activation will result in two network requests which are:

1) Tracking point library;

2) Tracking point request, which contains the tracking setup id, tracking point name and other information sent.

 Javascript variables are encoded in Base 64 function before sending the tracking point request to Adform servers where the data is decoded:

Example Request URL:

https://track.adform.net/Serving/TrackPoint/?pm={trackingId}&ADFPageName=Example%20tracking%20point&ADFdivider=%7C&ord=896447548360&Set1=en-US%7Cen-US%7C1600x900%7C24&ADFtpmode=2&itm=eyJzbCI6IjYwIiwiaWQiOiIxMjM0NSIsIml0bXMiOlt7InBubSI6IlByb2R1Y3QgQSIsInBzbCI6IjQwIn0seyJwbm0iOiJQcm9kdWN0IEIiLCJwc2wiOiIyMCJ9XX0&loc=http%3A%2F%2Fsite.adform.com%2F

The variables are sent in the 'itm' property:

eyJzbCI6IjYwIiwiaWQiOiIxMjM0NSIsIml0bXMiOlt7InBubSI6IlByb2R1Y3QgQSIsInBzbCI6IjQwIn0seyJwbm0iOiJQcm9kdWN0IEIiLCJwc2wiOiIyMCJ9XX0

Decoding this value in Base 64 outputs in the variables and values which were passed:

{"sl":"60","id":"12345","itms":[{"pnm":"Product A","psl":"40"},{"pnm":"Product B","psl":"20"}]}

For additional information please contact site tracking team at site-tracking@adform.com