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!

Polite Load Ad

There are two types of Polite Load Ads:

a) Polite Image + Main Banner (such banner can be easily setup in our system without special code snippets)
b) Main banner with Polite load snippet

Polite image + Main banner

This solution is the easy to make and setup in Adform system. All you need is polite image and main banner. The idea is that when site is loading Adform displays polite image, when site is fully loaded polite image is automatically swapped with main banner (which is just standard HTML5 ad).

It is easy to create such ad using Adform Studio, simply select image and upload using button in the left bottom of Studio panel:

 

Polite banner from one file (with code snippet inside)

Basic idea of polite loading in HTML5 banner would be that you implement polite source in html file, for example image that is shown before page is loaded and after page loaded event fires, you load heavy content with javascript. Polite Loading functionality in javascript can be implemented via Adform's dhtml library. It consists of 2 parts:

1. Define a function which loads heavy content like this:

dhtml.sharedEvents.once('pageLoadComplete', function() {
    // code that loads heavy content
});


2. Enable polite loading for banner:

dhtml.external.initPoliteMode();

One thing to note, is that pageLoadComplete event works only when banner is served from Adform system. Therefore, if you want to simulate polite loading when testing locally, you can use something like this:

var bn = dhtml.getVar('bn', 0);
if (bn) 
{
    // when banner is served from tag
    dhtml.sharedEvents.once('pageLoadComplete', init);
    dhtml.external.initPoliteMode();
}
else 
{
    // when testing locally
    setTimeout(init, 2000);
}

function init() {
    // load heavy content
}


bn - is a variable that will be 0 when testing locally and will be banner's tag number, when served from Adform.

Such type Polite loading ads can be easily tested in Adform Studio. There is a fake 5sec page load in banner preview window. This means that for 5sec you'll see polite stuff 

Note: Please note that if user rolls over the banner when page is loading Adform scripts identifies this as user interaction and fires Polite Loaded event.