How to use HTML banners with multiple clickTAGs

Many of our templates support HTML creatives (banners).
These creatives should be hosted on your servers and used via a hosted URL.

⚠️ Note: Google Ad Manager (GAM) does not allow uploading an HTML creative (ZIP bundle) directly when adding a creative from a template.

Since our templates serve HTML creatives via URLs, clickTAG values are passed through the URL. Therefore, the HTML creative itself must be able to read clickTAG values from the URL in order to handle correct click-through URLs and click tracking.

Template fields for click tracking

To ensure proper click tracking with HTML creatives, templates include the following fields:

  • “Click URL” (or “Click through URL”)
    Destination URL for the click.
  • “Add Global clickTAG”
    Determines whether the template should place an invisible clickable layer over the entire creative to provide click functionality with tracking.
    • Set to YES if the creative has a single clickable area (a single click-through URL). In this case, setup is simple—just provide the click URL, and the template will handle the rest.
    • Set to NO if the creative has multiple clickable areas or if you do not want the entire area to be clickable.
  • “clickTAG name”
    Here you can define custom clickTAG variables.

    ⚠️ Keep in mind that these variables are case-sensitive (clickTag and clickTAG are treated as different variables).

Multiple clickTAGs

If you want to provide multiple click URLs and clickTAG variables, separate them with a vertical bar (|).

For example:

  • Click URL:
    https://www.genecy.com|https://www.genecy.com/gam/release-notes/
  • clickTAG name:
    clickTag1|clickTag2

That completes the template-side setup.

However, the HTML creative itself must support reading clickTAG values from the URL. If it doesn’t, you will need to either modify the creative code or ask the creative provider to implement this functionality.

Implementing clickTAG support

You can implement clickTAG reading from the URL in two common ways:

1. Using Google Web Designer (GWD)

When adding a click event for a tap area in GWD, use a custom action.
We have a step-by-step guide here: How to add clickTAG to banners in Google Web Designer

2. Replacing built-in clickTAG variables in the HTML

If you see lines like:

var clickTag = 'https://test-click.com/';

…then clickTAG variables are defined globally.

In that case, insert the following JavaScript code before the closing </body> tag:

<script>
(function() {
    const url = new URL(window.location.href);
    for (const [key, value] of url.searchParams.entries()) {
        if (typeof window[key] === 'undefined') {
            continue;
        }
        window[key] = value;
    }
})();
</script>

This script replaces the predefined clickTag variables with the values provided via the template form (i.e., from the click-through URLs passed in the URL).