How to Fix Missing clickTag in HTML5 Banners
A "Missing clickTag" result means the banner never declares the variable the ad server uses to send clicks to the landing page. The fix is two lines of code: declare var clickTag in the <head> of index.html, and open window.clickTag when the banner is clicked. If you have a finished ZIP and no time to rebuild, the clickTag Editor injects the declaration and a full size click layer into the ZIP in your browser. Further down: Adobe Animate canvas banners, and which exit each platform accepts when the banner uses Enabler.exit or ExitApi instead.
What a clickTag is
A clickTag is a JavaScript variable that holds the landing page URL. Instead of hardcoding href="https://example.com" into the creative, the banner reads the variable, and the ad server sets its value when the ad serves. Traffickers can then change the landing page, add tracking and count clicks without a new build.
Which platforms need it: Campaign Manager 360 wants at least one click tag in the primary HTML file, and DV360 says HTML5 display ads must use click tags. Google Ads documents no click variable of its own, because its creatives exit to the final URL set on the ad, but a single standard clickTag is still the portable way to build a hand coded banner. In Google Ads mode the AdCheckLab validator treats a missing clickTag as a pass with a note, and in CM360 and DV360 mode as an error unless the creative exits through Studio or Google Web Designer.
The standard declaration
Put this in the <head> of your primary index.html, before any script that reads it:
<script type="text/javascript">
var clickTag = "https://www.example.com";
</script>
The name is case sensitive. It must be exactly clickTag with a capital T. clicktag, clickTAG and ClickTag are different variables to JavaScript, so the ad server sets one and the banner reads another. DV360's upload troubleshooting names this exact mistake. The validator reports it as Invalid clickTag Casing and lists every miscased name it found.
Binding the click
Once declared, open the variable when someone clicks. Either method works.
Method A: anchor wrapper
This is the form CM360 and DV360 show in their own help pages:
<a href="javascript:window.open(window.clickTag)">
<div id="banner-wrapper">
<!-- Banner creative layers go here -->
</div>
</a>
Method B: JavaScript listener
<div id="click-target-area" style="cursor: pointer;">
<!-- Creative layers -->
</div>
<script type="text/javascript">
document.getElementById("click-target-area").addEventListener("click", function () {
window.open(window.clickTag, "_blank");
});
</script>
DV360 asks for the landing page to open in a new tab or window, which both methods do. Canvas based banners from Adobe Animate need the listener on a button symbol instead, covered in the Adobe Animate section below. Google Web Designer does not use a clickTag at all, see the Google Web Designer exit guide.
Why a clickTag that is there still fails
- Declared with
letorconst. A top levelletorconstnever becomeswindow.clickTag, so an ad server that sets or reads it there misses it. Usevarorwindow.clickTag = "...". The validator warns with clickTag Declared with let or const. - Assigned without a declaration.
clickTag = "..."with novarbreaks in strict mode, and some ad servers do not detect it. - Used but never declared. The banner calls
window.open(clickTag)but nothing declares it, so the click has no destination. The validator reports clickTag Used but Never Declared. - Hidden in a minified bundle. CM360 asks for the click tag without minification or obfuscation. Keep the declaration in a small readable script in the head, and minify everything else.
- Only in a separate JS file. CM360 reads the click tag from the primary HTML file.
- A hardcoded link as well. An
<a href="https://...">around the creative bypasses the ad server, so clicks go uncounted. The validator warns with Hardcoded Destination URLs.
Fix a finished ZIP without rebuilding
- Drop the ZIP into the HTML5 Banner Validator and pick the platform. Confirm the result is Missing clickTag Variable or a casing error.
- For a casing error, open the clickTag Editor and run Remove clickTag first. It clears miscased and numbered declarations such as
clicktagorclickTag2. Then rename any remaining references in your own click handlers, because the editor does not rewrite them. - In the clickTag Editor, enter the landing page, drop the ZIP and choose Inject clickTag & Download. It replaces any existing
clickTagdeclaration, writesvar clickTagas the first thing in the head, adds a click layer over the whole canvas, and gives you a new ZIP. Existing animation code is left alone. - Validate the new ZIP again and click the preview. A panel shows the clickTag value and the URL the click tried to open.
Building from scratch? The clickTag Generator writes the head snippet, the body binding or a complete boilerplate for each size and platform.
clickTag in Adobe Animate HTML5 Canvas banners
An Adobe Animate HTML5 Canvas export draws the whole banner into a <canvas>, so there is no link in the markup for an ad server to rewrite. Declare clickTag in the page yourself and open it from a button inside the animation. Do both in the publish template once, and every size you publish afterwards is ready for Google Ads and Campaign Manager 360.
Put clickTag and ad.size in the publish template
Editing the published index.html by hand works until the next publish overwrites it. Instead, open File, Publish Settings, go to the HTML settings, export the default template, add these lines inside its <head> above Animate's own scripts, and import it back as the template for the document:
<meta name="ad.size" content="width=300,height=250">
<script type="text/javascript">
var clickTag = "https://www.example.com";
</script>
Keep the declaration a top level var, outside Animate's init() function, for the reason in the list above: only then does it become window.clickTag, where ad servers set and read it. Change the width and height in the ad.size tag for every size, or let the clickTag Generator write the pair for each format in the campaign.
Open clickTag from a button on the stage
Draw a transparent rectangle over the whole stage on the top layer, convert it to a Button symbol with a Hit frame, and give the instance a name such as bg_btn. Then add this to frame 1 in the Actions panel (F9):
this.bg_btn.addEventListener("click", function () {
window.open(window.clickTag, "_blank");
});
A full size button is the safest choice for Google Ads, which allows one exit only. Separate exits for separate products make it a CM360 build: declare one click tag per exit in the template and bind each button to its own variable.
Fix the libraries before a Google Ads upload
With Hosted Libraries switched on in the publish settings, Animate loads CreateJS from its own CDN, and Google Ads refuses that reference. There are two ways out:
- Bundle it: switch Hosted Libraries off. CreateJS is then published into the ZIP and counts toward the 600 KB limit.
- Point at Google's copy: replace the script tag with the Studio hosted build under
https://s0.2mdn.net/ads/studio/cached_libs/, for examplecreatejs_2019.11.15_min.js. Pick the build that matches the CreateJS version your Animate release publishes. A hosted copy does not count toward the ZIP weight or the 40 file limit.
Everything else Google Ads lets a banner load from outside the ZIP is in the Google Ads allowlist.
Keep the export light, then test it
- Delete unused library symbols, hidden layers and embedded sounds before publishing.
- Let Animate combine bitmaps into a spritesheet. It cuts the file count, and the Banner Compressor recognises Animate spritesheets listed in
ssMetadataand never downscales them. The compression guide covers the rest of the weight. - Stop the timeline with
this.stop()on the last frame, or count plays so the animation ends within 30 seconds. - Zip the contents of the publish folder, not the folder itself, and drop the ZIP into the HTML5 Banner Validator. It rewrites the image references inside Animate's JavaScript and handles the CreateJS preloader, so the banner plays in the preview without a server. Click the canvas: a panel shows the clickTag value the banner read and the URL it tried to open.
clickTag, Enabler.exit and ExitApi: which exit each platform accepts
Three different pieces of code can send a banner click to a landing page, and they are not interchangeable. clickTag is the standard variable for hand coded HTML5 on Google Ads, Campaign Manager 360 and DV360. Enabler.exit is the Studio exit, used by Studio creatives and by Google Web Designer files built for Display & Video 360. ExitApi.exit was Google Ads' own exit script, and Google Ads now rejects it.
| Exit | Google Ads | CM360 HTML5 upload | DV360 and Studio |
|---|---|---|---|
var clickTag |
Yes, one exit only | Yes, and more than one click tag for more than one exit | Yes for DV360 HTML5 uploads |
Enabler.exit |
No | Only through Studio or Google Web Designer | Yes |
ExitApi.exit |
No, reported as modifying clickability | Not a documented exit, use clickTag | Not a documented exit, use clickTag or Enabler.exit |
ExitApi: remove it
ExitApi.exit() came from a script loaded from Google's ad servers, https://tpc.googlesyndication.com/pagead/gadgets/html5/api/exitapi.js. Google Ads now answers it with "Your HTML5 ad is modifying clickability, which is not supported", and its fix instructions are to remove that script tag from the head of index.html and remove calls such as <button onclick="ExitApi.exit()">. The ad then exits to the final URL set on the ad in Google Ads.
The validator reports Custom Exit Not Allowed in Google Ads mode when it finds either the call or the script. If an earlier version of the AdCheckLab clickTag Editor added an ExitApi wrapper to one of your ZIPs, the current clickTag Editor recognises that wrapper and cleans it up when you inject or remove a clickTag.
Enabler.exit: Studio and Google Web Designer
Studio creatives load the Enabler in the head and name each exit in code. The landing page is entered in Studio after upload, so it can change without a new build, and Studio's help states that every creative needs at least one exit.
<script src="https://s0.2mdn.net/ads/studio/Enabler.js"></script>
<script>
function bgExitHandler(e) {
Enabler.exit('Background Exit');
}
document.getElementById('bg-exit').addEventListener('click', bgExitHandler, false);
</script>
Nothing in the ad should run before the Enabler has initialised: check Enabler.isInitialized() and otherwise wait for studio.events.StudioEvent.INIT. Google Web Designer adds the Enabler automatically when a file uses the Display & Video 360 environment and turns each Tap Area exit into this call; the Google Web Designer guide shows the setup, and why Tap Area exits are not allowed on Google Ads.
An Enabler exit only works where Studio exits are read: Studio itself, and Google Web Designer creatives published to CM360 or DV360. Google Ads allows no external script except Google Fonts and its hosted CreateJS, GreenSock and jQuery builds, so a ZIP that loads Enabler.js is refused there before its click is ever tested.
Switching a banner from one exit to another
- ExitApi to Google Ads: delete the exitapi.js script and every
ExitApi.exitcall, then keep a singlevar clickTagexit. - Studio to CM360 upload: remove the Enabler script and the
Enabler.exithandlers, declarevar clickTagand open it from the same element. - Hand coded to Studio: add the Enabler, replace
window.open(window.clickTag)with a namedEnabler.exit, and set the URL in Studio.
The clickTag Generator writes both the standard snippet and the Studio exit snippet, and the validator tells you which exit a ZIP uses and whether the selected platform accepts it. How the platforms differ beyond exits is in Google Ads vs CM360 vs DV360.
Frequently asked questions
Can I have several clickTags in one ZIP?
On Campaign Manager 360, yes. It supports more than one click tag, each defining the landing page for a different exit, and the validator accepts numbered click tags such as clickTag2 in CM360 mode. On Google Ads, no: it reports "HTML5 ad contains multiple exits". For DV360, the validator expects a single clickTag or a Studio exit.
What should the default value be?
Any real URL, ideally the landing page, written with https://. The ad server replaces it, so it mainly matters when someone tests the file locally. The validator does not count this default value as an insecure reference.
What about ExitApi or Enabler.exit?
They are different exit mechanisms, not spellings of clickTag. The exit comparison above shows which one each platform accepts and how to switch a banner from one to another. For the other Google Ads upload errors, see the Google Ads HTML5 validator guide, and for testing clicks before trafficking, the HTML5 banner preview guide.