File Types
HTML, JS, CSS, JPG, JPEG, GIF, PNG, and SVG
File Sizes
Initial Load
Subload
Max Initial Load Count
Max Subload File Count
Max File Size
User-Initiated
300 KB maximum
600 KB maximum
10 files
100 files
5 MB maximum
2.2 MB maximum (RCMD)
JavaScript and CSS Libraries
Commonly used JavaScript and CSS libraries (such as jQuery) do not need to be included with the creative.
Image Sprite
To help increase performance from HTML ads, include image sprites instead of many images to decrease the number of file requests made by your creative.
Video Tags
We do not recommend the use of video tags in HTML5.
MUST READ: Most Common Reasons for Rejected Ads
HTML5 File Formatting
The following packaging options are available for HTML5 creatives:
Single HTML File:
Zip Compressed File
HTML5 ClickTAG Parameters
The ClickTAG parameter is provided to the primary .HTML file as a URL parameter. The name of the URL parameter is customizable at the time of creative upload or during editing. This system is similar to how we provide click-tracking information for hosted Flash ads.
We suggest using JavaScript to read the parameter from the document location URL and using it to set up the landing page for your clicks. You can use single quotes (‘) or double quotes (“) in your code, but you can not mix them. Use either all single quote or all double quotes.
Backup/Default Clickthrough Parameter
To correctly call the clickthrough page through the backup ad image, you must supply a clickthrough parameter for that purpose. If you wish to also use that clickthrough URL in your HTML5 creative, you can configure the creative to use the Backup Clickthrough URL as the Default Clickthrough URL.
Retrieving the Click-Tag Parameter
The Click Tag URL can be retrieved using the following code:
function getParameterByName(name) { name = name.replace(/[\[]/, “\\[“).replace(/[\]]/, “\\]”); var regex = new RegExp(“[\\?&]” + name + “=([^&#]*)”), results = regex.exec(location.search); return results === null ? “” : decodeURIComponent(results[1].replace(/\+/g, ” “)); } Plain Text
Using Multiple Clickthrough URLs
By appending a URL escaped landing page to the click tag URL, our system will track the click and redirect the request to the given landing page.
var clickTag = getParameterByName() +
encodeURIComponent();
Different landing pages can be used for different actions.
Using Multiple Clickthrough URLs
By appending a URL escaped landing page to the click tag URL, our system will track the click and redirect the request to the given landing page.
var clickTag = getParameterByName() +
encodeURIComponent();
Different landing pages can be used for different actions.
function getParameterByName(name) { name = name.replace(/[\[]/, “\\[“).replace(/[\]]/, “\\]”); var regex = new RegExp(“[\\?&]” + name + “=([^&#]*)”), results = regex.exec(location.search); return results === null ? “” : decodeURIComponent(results[1].replace(/\+/g, ” “)); } Plain Text
Using the Click-Tracking Parameter
When the advertisement is clicked on, the creative must direct the user to the correct click tag page in a new window.
Sample Creative HTML using ClickTAG
The following code block shows one way to retrieve and implement a creative with a clickthrough URL that has been specified in the DSP.
In this example, a single image is wrapped with an anchor tag which, when clicked, opens a new window with the address stored in the creative’s clickTAG URL query parameter. The URL to open the window with is stored in window.clickTAG at line 11.
A creative may use any number of ways to open a new window to that address on click. This is one just one example.
<html>
<head>
<script type="text/javascript" charset="utf-8">
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/,
"\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" :
decodeURIComponent(results[1].replace(/\+/g, " "));
}
var clickTAG = getParameterByName("clickTAG");
//At this point, the value for the clickthrough URL
is stored in the variable "window.clickTAG"
//clickTAGs are case-sensitive, so make sure
TAG/Tag/tag is uniform throughout the creative and any
supporting files
</script>
</head><body>
<a
href="javascript:window.open(window.clickTAG);
void(0);">
<img src="clickme.jpg"/>
</a>
</body>
</html>