HTML5 requirements

When building your HTML5 zip bundle, please follow the requirements described below.

  • If you use Google Web Designer to build HTML5 creatives, be sure to select “Ad Manager” as the environment.
  • You can see examples of HTML5 files in the Rich Media Gallery.
  • The following guidelines should work for any browser that supports HTML5. However, some creative functionality may not work as desired in all environments, so please test your HTML5 creative code thoroughly.

Confirm that your bundle is SSL compatible

HTML5 creatives must be SSL compatible to serve to HTTPS sites.

Follow dimension guidelines

  • Unlike images or videos, HTML documents don't have dimensions on their own. Therefore, use the size meta tag to indicate the intended size for your creative and ensure your creative renders at the right dimensions: <meta name="ad.size" content="width=[x],height=[y]">.
  • HTML5 creatives can only have fixed dimensions (e.g., 300x250, 400x400, 728x90, etc.). Dynamic sizes such as “Fluid” aren’t supported.
  • For creative HTML files in Google Web Designer bundles, the minWidth and minHeight properties of the creativeProperties parameter must be non-zero. For example, "creativeProperties":{"minWidth":0,"minHeight":0,"maxWidth":0,"maxHeight":0} results in an error.

Size meta tag example

Here's an example meta tag for a fixed size (such as 300x250):

<meta name="ad.size" content="width=300,height=250">

Follow click tag guidelines

Click tags define click-through URLs for each exit on your HTML5 creative. An exit is any clickable area that directs the browser to a landing page.

  • Learn more about adding HTML5 exits (including exits using Google Web Designer) in the Studio Help Center. This Help Center is intended for creatives generators.

When an exit gets a click, the creative calls Ad Manager for the click-through URL associated with that exit.

  • You can set this URL in your creative or ad, depending on your needs and the creative type.
  • If you set click tags in both the creative and ad, the ad-level setting overrides the creative-level settings.

Ad Manager detects click tags when you upload assets. You can change the click-through URL the click tag uses anytime, even after you export tags. Here are some click tag best practices:

  • Make sure your creative uses the click tag variable as the click destination.
  • The click tag should be easy for the ad server to read — no minification or obfuscation, though you can use minifers in the rest of your code and in other files.
  • We don't recommend hard-coded click-through URLs in your asset because that prevents Ad Manager from tracking clicks and prevents traffickers from updating the URL. After upload, Ad Manager will warn you if there are hardcoded URLs in the asset.

Sample click tag insertion

Here's an example of a click tag inserted in an HTML document:

<meta name="ad.size" content="width=300,height=250">
<script type="text/javascript">
var clickTag = ""; </script>
[The rest of your creative code goes here.]

Your creative must use the click tag variable as the click-through URL:

<a href="">
<img src="images/dclk.png" border=0>
Was this article helpful?
How can we improve it?