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!

Event Tracking

Adform's Event tracking can be applied to different types of user interactions: clicks on specific HTML banner areas, mouseovers, etc.

1. The HTML asset should contain a manifest.json file and an HTML file zipped together with images, scripts, and other material.

2. The manifest.json file must contain information about events used in the banner:

{

    "version": "1.0",

    "title": "980x400 standard html", 
    "description": "",  

    "width" : "980", 
    "height": "400", 


"events": {
        "enabled": 1, // events capable
        "list": { // events list {id}: {eventName}
            "1": "myEventName1",
            "2": "myEventName2",
            "3": "myEventName3"
        }
},

"clicktags": { "clickTAG": "http://www.adform.com" }, 

"source": "980x400.html" 
}

3. The HTML file should include an Adform HTML library which enables the banner to receive a clickTAG variable:

<script>
document.write('<script src="'+ (window.API_URL || 'https://s1.adform.net/banners/scripts/rmb/Adform.DHTML.js?bv='+ Math.random()) +'"><\/script>');
</script>

 

  • Events with static values

    Include in HTML file event calls on specific events which you want to track:

    dhtml.sendEvent(event_id, event_name);
    • event_id – a whole number between 1 and 20 which represents a unique event in the banner. Reserved banner events IDs can be found here
    • event_name – static string (do not use dynamic values). 

    An example of a static event call:

    dhtml.sendEvent('1', 'banner click');
  • Events with dynamic values

    Include in HTML file event calls on specific events which you want to track:

    dhtml.sendEvent(event_id, event_name, eventVars);
    • event_id – a whole number between 1 and 20 which represents a unique event in the banner. Reserved banner events IDs can be found here.
    • event_name – static string (do not use dynamic values). 
    • eventVars – custom variable which should be assigned to a current event. Variable names are limited to the following: bv1, bv2, ..., bv100. Their values should be of "String" type.

    An example of eventVars:

    event.onclick = function() {
               var id = 1,
                   name = 'banner click',
                   eventVars = {
                       bv1: "John",
                       bv2: "Colin",
                       bv3: "24"
                   };

    An example of dynamic event call:

    dhtml.sendEvent('1', 'banner click', eventVars);