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!

Floating HTML Ad


Floating HTML ad
consists of one HTML asset.

Floating HTML Banner Asset

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

Note: Please note that manifest.json and HTML files should be in the root directory of the .zip file, not in deeper directories.


2. manifest.json file should define the ad dimension and the HTML file which should be used as a banner source:

{
    "version": "1.0",

    "title": "floating html ad", 
    "description": "",  

    "width" : "600", 
    "height": "600", 

    "events": {
        "enabled": 1, 
        "list": { }
    },

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

    "source": "600x600.html"
}

3. Floating banner should contain a clickTAG.

4. The ad should also have a Close button.

5. HTML file should include Adfrom HTML library:

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

6. Adform HTML library enables the banner to receive a clickTAG variable and activates the Close button:

<script>
    var banner = document.getElementById('banner');
    clickTAGvalue = dhtml.getVar('clickTAG', 'http://www.example.com');
    landingpagetarget = dhtml.getVar('landingPageTarget', '_blank');

    var closebutton = document.getElementById('closeImage');
    var banner = document.getElementById('banner');

    closebutton.onclick = function() {
        dhtml.sendEvent(dhtml.CLOSE_BUTTON_PRESS);
        close();
    }

    banner.onclick = function() {
        window.open(clickTAGvalue, landingpagetarget);
    }

    function close() {
        dhtml.external.close && dhtml.external.close();
    }
</script>

7. close() function uses public method to close the ad. Please find more information about the public methods here.