Skip to main content

How to upload HTML5 banners

How to build an HTML5 banner ZIP and upload it to a campaign.

Written by Oskar Johnson Hägglund

HTML5 banners are ads built with HTML, CSS and JavaScript. They adapt to different screens and can be animated or interactive. You add them on the Ads step when you create a campaign.

Prepare the ZIP file

We deliver campaigns through Adform, so HTML5 banners have to follow Adform's format. Build one ZIP file per banner size:

  • Put manifest.json and the main HTML file at the root of the ZIP. Images, scripts, styles and fonts go in folders the HTML refers to.

  • In the manifest, set the banner's width and height, the landing page under clicktags, and source to the exact name of the HTML file.

  • Load Adform's DHTML library in the <head> of the HTML, and open the click URL from the clickTAG variable instead of hard-coding it.

  • Keep the banner light: aim for 150 KB or less. Adform's maximum is 300 KB for desktop and 200 KB for mobile and tablet, measured after unzipping. The app accepts ZIP files up to 2 MB, but heavier banners can be rejected when we review the campaign.

  • Stop all animation within 30 seconds.

An example manifest:

{
  "version": "1.0",
  "title": "Acme 300x250",
  "description": "Standard HTML5 display banner",
  "width": "300", "height": "250",
  "events": { "enabled": 0, "list": {} },
  "clicktags": { "clickTAG": "https://example.com" },
  "source": "banner.html"
}

Load the library in the <head>, before any code that uses dhtml:

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

Then make the clickable element (here id="clickArea") open the click URL:

<script>
  var area = document.getElementById('clickArea');
  var url = dhtml.getVar('clickTAG', 'https://example.com');
  var target = dhtml.getVar('landingPageTarget', '_blank');
  area.addEventListener('click', function () {
    window.open(url, target);
  });
</script>

The clickTAG name is case-sensitive, and every extra click tag has to be listed in the manifest. Banners for in-app inventory need MRAID instead of the DHTML library. Ask us before you build one.

Upload the banner

  1. On the Ads step, click Create new ads and open the Upload HTML tab.

  2. Enter the Banner width and Banner height in pixels, click Choose file and pick your ZIP file.

  3. Give the banner a name under Ad name and click Save.

The banner now shows in your list of ads. Click Create new ads to add more banners, or Book campaign to finish.

HTML5 banners have no preview in the app. On the Ads tab under ABM they show as a file icon instead of an image.

Did this answer your question?