What Is clickTag? A Plain-English Guide for HTML5 Ads

A clickTag is the variable an ad network fills with the real destination URL when your HTML5 ad is served. Here is how it works, how to code it, and where it goes wrong.

By the PlayableRun team··7 min read

Key takeaways - A clickTag is a variable in your HTML5 ad that holds the click-through URL. The ad network fills it in at serve time, so the creative never contains the real destination. - Your code must read that variable and open it when the user taps. Hardcoding a URL is a common reason clicks do not register or an ad is rejected. - The name matters. Google Ads expects clickTag with that exact capitalization. Other networks may use different conventions, and many in-app networks use MRAID instead. - Fire the click only on deliberate actions, such as the call to action or the end card, not on every tap during gameplay. - Test locally with a placeholder URL, then test again in the network's preview, because the network overwrites your value.

What is clickTag?

A clickTag is a named variable inside an HTML5 ad that stores the URL a user should land on after tapping. You do not decide that URL in the creative file. The ad platform injects it when the ad is served, based on the destination you entered in the campaign or ad settings.

In practice it is a short declaration near the top of the page, plus a short call in your click handler. The declaration sets a placeholder, such as var clickTag = "https://www.example.com";. The click handler opens whatever value the network has put there, such as window.open(window.clickTag, "_blank");.

The placeholder exists for local testing. When the network serves the ad, it replaces the value.

Why clickTag exists

It looks like an extra step, but each part of the arrangement solves a real problem.

  • Click measurement. The network needs to count the click before sending the user on. If your ad navigated straight to a store page, the network would never see it, and would have nothing to report, bill or optimize against.
  • Destination control. Networks enforce rules about where ads may send people. Keeping the URL outside the creative lets them apply those rules consistently.
  • Reusability. You can run the same creative against different destinations, such as a store listing in one campaign and a landing page in another, without rebuilding the ZIP.
  • Tracking templates. Click macros, redirects and attribution parameters are added around your URL by the platform. The creative stays clean.

If you are new to what the package contains, What Is an HTML5 Ad? What's Inside the ZIP covers the structure around this one variable.

How a clickTag works, step by step

  1. You build the ad with a placeholder clickTag variable defined in a script in the page.
  2. You upload the ZIP. The network's validator checks that the variable exists and, depending on the platform, that your code uses it.
  3. At serve time, the network sets the variable to the real destination, usually wrapped in its own tracking redirect.
  4. The user taps the call to action. Your code opens the variable's value in a new window or tab.
  5. The network registers the click, then forwards the user to the destination.

From your side, only steps one and four are code you write. Everything else is the platform's job. That is also why a missing or misspelled variable fails so visibly: the platform has nowhere to put the URL.

Implementing it correctly

The details are small, and each one has a reason.

Use the exact variable name

JavaScript is case-sensitive. Google Ads looks for clickTag. A variable named clicktag or ClickTag is a different variable, so the network's value never reaches your code. Copy the name exactly rather than retyping it from memory.

Declare it in the page itself

Put the declaration in a script block in the main HTML file, not in a separate file that loads later. Validators and ad servers inspect the main document. If the declaration lives somewhere they do not look, they may report it as missing even though the ad works on your machine.

Read the variable at click time

Do not copy the value into another variable at load and use that copy. Reading window.clickTag inside the handler means you always use whatever the network last set. It also keeps your code simple enough to audit in a minute.

Open in a new window

Ads usually render inside an iframe. Navigating the frame itself can be blocked, or can replace the ad with a page that was never meant to load there. Use window.open with a new-tab target. The MDN reference for window.open explains the target argument and how browsers treat popups. The call should happen directly inside a tap or click handler, not after a timer, because browsers are far more willing to allow a popup that follows a user gesture.

Never hardcode the final URL

It is tempting to paste your store link into the handler "just to be safe." Don't. It bypasses measurement, and many networks will reject the ad for it. If you want a fallback for local previews, keep it in the clickTag declaration, where the network overwrites it.

clickTag in playable ads

A playable has more places to tap than a banner: gameplay, a fail screen, a win screen, an end card. That makes click placement a design decision, not only a code one.

  • Wire the click to deliberate actions. Use the install button, the end-card call to action, and perhaps the full end-card background. Do not trigger it from every gameplay tap. Accidental exits frustrate users and can look like a trick, which is a policy problem as well as a quality one.
  • Make the target big enough for a thumb. A button that is visually clear but physically tiny creates missed taps that look like disinterest.
  • Keep one click function. Route every call to action through a single function that reads the variable. If something changes, you fix it in one place.
  • Remember the end card. Many playables get the in-game button right and forget that the end card needs its own handler.

Take a simple match-three playable as an example. The player swaps a few tiles, sees a big combo, and lands on an end card with an "Install" button. The only places that should call the click function are that button and, if you choose, the end-card panel around it. The tiles during play should never open the store.

clickTag versus MRAID

Not every network uses clickTag. Many in-app networks load playables inside an SDK webview and expect the ad to call an MRAID function, usually mraid.open(url), to send the user to the store. In that world the destination is handled through the SDK rather than a variable on the page.

This is why one creative is not always portable across networks without changes. A Google Ads package needs the clickTag convention. A package for an in-app network may need the MRAID call, and some networks accept either with a small wrapper. For the full picture, read MRAID for Playable Ads: What Marketers Need to Know. Before you upload anywhere, check the network's current creative spec so you know which click method it wants.

Common clickTag mistakes

  • Wrong capitalization. The most frequent cause of a "no clickTag found" message.
  • Declaration in an external file. The validator reads the HTML and sees nothing.
  • Hardcoded URL in the handler. The click works in your browser and fails review.
  • Navigating the iframe. Using location.href instead of window.open can break the ad's container.
  • Multiple competing handlers. Two listeners on the same button can open two tabs.
  • Click fired on the first touch. Some playables treat "touchstart" anywhere as a click-through. Use a clear button and a normal click or tap event.

If the validator rejects your upload, Google Ads HTML5 Validator Errors Explained walks through the messages you are most likely to see.

How to test a clickTag

  1. Test locally with a dummy URL. Set the placeholder to a harmless page and confirm that tapping each call to action opens it in a new tab.
  2. Change the placeholder and retest. Edit the value to something else. If the click still goes to the old URL, you have a hardcoded link or a copied value somewhere.
  3. Check every click path. Gameplay, fail screen, win screen and end card. Confirm that only the intended ones fire.
  4. Use the network's preview. The preview injects its own value, which is the closest you can get to live behavior before spending anything.
  5. Check on a real phone. Touch handling and popup rules can behave differently from a desktop browser.

If you build playables with PlayableRun, the export targets Google Ads, but the same testing steps apply. Open the network's preview and confirm the click yourself rather than assuming it works.

A short checklist before upload

  • The variable is named exactly as the network expects.
  • It is declared in the main HTML file.
  • Every call to action reads it at click time.
  • No hardcoded destination URLs anywhere in the code.
  • Only deliberate actions trigger the click.
  • You have tested with a changed placeholder and in the network's preview.

None of this is hard, but each item is easy to skip when a deadline is close.

Where to go from here

If you want to see how a finished playable handles its calls to action, the live demos are a quick way to tap through a few. And if you would like to turn a store listing into a playable and check its click behavior yourself, you can create a free account and try it.

Frequently asked questions

›What is a clickTag in simple terms?

It is a variable in your HTML5 ad that stores the click-through URL. The ad network sets its value when the ad is served, and your code opens that value when the user taps the ad.

›Why can't I just hardcode my store link?

A hardcoded link sends users away without the network seeing the click, so it cannot measure, bill or optimize against it. Many networks reject creatives that do this.

›Is clickTag case-sensitive?

Yes. JavaScript variable names are case-sensitive, and Google Ads looks for clickTag with that exact capitalization. Variants like clicktag or ClickTag will not receive the network's value.

›Do playable ads use clickTag or MRAID?

It depends on the network. Google Ads uses clickTag. Many in-app networks expect MRAID calls such as mraid.open instead. Always check the current spec of the network you are uploading to.

›Why does my click work locally but fail after upload?

Locally, your placeholder URL is used. After upload, the network replaces it. Common causes of failure are a misspelled variable name, a declaration the validator cannot find, or a hardcoded URL in the click handler.

Sources

Turn your store listing into a playable

Paste an App Store or Google Play link and get an HTML5 playable you can test in minutes. The first one is free.

Keep reading