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 Event tracking can be applied for different types of user interactions, e.g. clicks on specific HTML banner areas, a mouse-over specific banner area, and etc

Tip: Create banners easier by using Adform‘s HTML5 Studio. It automatically generates the manifest.json and other Adform-related files, as well as enables you testing and previewing HTML5 banners effortless.

 

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

2. Manifest.json must contain info 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. HTML file should include Adfrom 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

    HTML file should include event calls on specific events which you want to track:

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

     Example:

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

    HTML file should include event calls on specific events which you want to track:

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

    Example of eventVars:

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