Reference · Google Ad Manager · Click macros

Google Ad Manager Click Macros: %%CLICK_URL_UNESC%% vs ESC vs ESC_ESC

GAM has three click tokens and the only thing that decides between them is where the macro sits in the tag. Pick by position and clicks track; pick by habit and they quietly don't. These are the tokens CreativeValidator has behaviorally verified against a GAM test network — not just read out of the docs.

The tokens, by position

Position in the tag Token Encoding
URL prefix (redirect-chain head) or standalone attribute / JS variable %%CLICK_URL_UNESC%% None
Placeholder inside a URL query-param value %%CLICK_URL_ESC%% Single-encoded
Inside an already-percent-encoded URL %%CLICK_URL_ESC_ESC%% Double-encoded
Cachebuster (anywhere a random number is needed) %%CACHEBUSTER%%

The rule of thumb: count how many URLs deep the click macro sits. Zero deep — the macro leads, the landing URL follows — is UNESC. One deep — the click URL is a query-param value inside another URL — is ESC. Two deep — inside a URL that is itself already percent-encoded — is ESC_ESC.

DCM INS tags: the click tracker is an attribute

CM360 INS tags don't carry a GAM click macro at all. Click truth lives in the data-dcm-click-tracker attribute: a filled attribute counts as working click tracking, because the CM360 chain reports the clicks. An empty or missing data-dcm-click-tracker does not — the tag renders fine and looks healthy, but GAM never hears about the click. CreativeValidator checks the attribute's fill state, not just its presence.

A correct GAM tag

<!-- Image creative trafficked to Google Ad Manager:
     UNESC as the URL prefix, right before the landing URL -->
<a href="%%CLICK_URL_UNESC%%https://example.com/spring-sale" target="_blank">
  <img src="https://cdn.example.com/creatives/spring-300x250.jpg"
       width="300" height="250" border="0" alt="Spring Sale" />
</a>

<!-- Click URL handed to a vendor script as a query-param value:
     the single-encoded ESC form, plus the GAM cachebuster -->
<script src="https://ad.example.net/serve.js?click=%%CLICK_URL_ESC%%&amp;ord=%%CACHEBUSTER%%"></script>

The wrong-platform trap

GAM expands only its own %% tokens. Paste a DV360/Xandr token like ${CLICK_URL}, Adform's %%c1;cpdir=, or Equativ's [countgo] into a tag trafficked to Google Ad Manager and GAM serves the token as literal text: the browser navigates to a URL that literally contains it, the landing page usually still loads, and click reporting is silently lost — no error, no warning, just a hole in the campaign's numbers. CreativeValidator classifies any foreign click token as WRONG PLATFORM MACRO so it's caught before trafficking, not after the flight.

Source and verification

Primary source: Google Ad Manager macro documentation. Unlike the other platforms in this series, the GAM tokens above are additionally behaviorally verified — CreativeValidator trafficked them through a real GAM test network and confirmed the expansions.

Paste your tag — the validator renders it and tells you if clicks will actually track: native macro, unfilled placeholder, wrong-platform token, or hardcoded URL.

Test a GAM tag now →

Every rule cites its primary source — see the Policy Studio.

FAQ

What is the difference between %%CLICK_URL_ESC%% and %%CLICK_URL_ESC_ESC%%?

%%CLICK_URL_ESC%% is the single-encoded form, used when the click URL is a placeholder inside another URL's query-parameter value. %%CLICK_URL_ESC_ESC%% is the double-encoded form, used when the macro sits inside an already-percent-encoded URL.

When should I use %%CLICK_URL_UNESC%%?

When the macro is a URL prefix at the head of the redirect chain — placed immediately before the landing URL — or when it stands alone as an attribute value or JavaScript variable.

Do DCM INS tags need a GAM click macro?

No. A DCM/CM360 INS tag tracks clicks through its data-dcm-click-tracker attribute. Filled: the CM360 chain reports clicks. Empty or missing: it doesn't.

What happens if I use a DV360 or Xandr macro in a GAM tag?

GAM serves the foreign token as literal text and the click goes untracked. CreativeValidator flags it as WRONG PLATFORM MACRO.