Fix click tracking on third-party ad tags
Clicks not counting, a broken landing page or a cached vendor pixel on a pasted HTML/JS or VAST tag — a 60-second check, a cause table, and where to put Epom's click-redirect macro, its _ESC variants and the $$RANDOM$$ cache buster.
“The tag renders fine, but Epom reports zero clicks.” “Clicks land on a half-encoded, broken landing page.” “The vendor’s pixel sees fewer impressions than we serve — the page caches the tag.” You pasted a third-party HTML/JS or VAST tag into an HTML Code banner; all three are macro-placement problems. A third-party tag doesn’t know about Epom’s click redirector or its cache buster unless you insert them, and they only work in the exact right spot with the exact right encoding.
Example. A verification vendor’s tag carries
href="https://tracker.example/click?id=42&url=https://brand.example.com/landing". Pasted as
is, Epom counts 0 clicks on 48,000 impressions. Putting $$CLICK_REDIRECT_URL$$ in front of
https://tracker.example/... makes every click pass through Epom first: the next day shows
312 clicks (0.65% CTR) and the landing page opens as before. Had the macro been placed inside
the url= parameter instead, the plain variant would have been decoded once by the tracker and
broken the landing URL — that spot needs $$CLICK_REDIRECT_URL_ESC$$ with the landing portion
encoded to the same depth.
This page is the concrete Epom recipe. For the full macro catalogue see the macros reference; for the banner form itself see HTML code and Template banners. Macros are expanded at serve time, so a live impression is the only true test — but Preview shows the substituted markup.
The 60-second check
- Is the macro literally in the preview? Open the banner’s Preview:
$$CLICK_REDIRECT_URL$$shown verbatim means a typo or a context the processor does not reach. - Does the banner have a destination? Without a click-through, both click macros resolve to nothing and are removed — the tag then has no click tracking at all.
- Is the macro at the very start of the click destination? Anything between the macro and the
landing URL (a
?, a space, a parameter) breaks the redirect target (Fix 1). - Is the destination inside another tracker’s parameter? Then the encoding level must match
the number of decode hops:
_ESCfor one,_2_ESCfor two (Fix 2). - Does the vendor’s pixel or
srccarry$$RANDOM$$? A cached pixel is re-served from cache and the vendor under-counts (Fix 4).
Causes at a glance
| Symptom detail | Cause | Check | Fix |
|---|---|---|---|
| Zero clicks; the tag renders | No Epom click macro in the click-through | The href, clickTag variable or tracker url= parameter | Prepend $$CLICK_REDIRECT_URL$$ |
| Zero clicks; the macro is there | The banner has no click-through, so the macro was removed; or the macro is mistyped | Preview: is the macro replaced by a real URL? | Give the banner a destination; fix the spelling and $$…$$ |
| Clicks counted, landing page broken or truncated | Wrong encoding level for the hop the click passes through | Count the trackers that decode the URL | Step the _ESC variant up or down one level; encode the landing portion to the same depth |
| Clicks counted by Epom, the third-party redirector never sees them | Epom’s macro sits behind the third party’s redirector instead of in front | The order of redirectors in the string | Epom first, then the third party, then the landing page |
| The creative handles its own click; nothing to wrap | A self-contained iframe creative | The tag’s structure | Fire $$CLICK_URL$$ as a pixel from the click handler |
| The vendor’s impression count is lower than Epom’s | Its pixel or src is cached by the browser or a CDN | Does the URL carry a fresh value per impression? | $$RANDOM$$ in the vendor’s cache-buster slot |
| A stale creative keeps reappearing | Same: a cached iframe src | As above | $$RANDOM$$ on the src |
$$RANDOM$$ set, vendor still under-counts | The page keeps the iframe in the DOM and never re-requests it | The page, not the macro | A page-side fix |
| Zero clicks although the redirect is right | The banner is not serving at all | My ad is not serving | As found there |
| Preview shows it, the live page does not (or the reverse) | A tag or page problem | Tags and preview problems | As found there |
Who this is for
Ad-ops users and advertisers trafficking third-party creatives through the HTML Code banner type. Requires knowing your tag’s own structure — which part is the click-through and which is the impression pixel.
Two macros do two different jobs — don’t mix them up
| Macro | What it produces | Use it to… |
|---|---|---|
$$CLICK_REDIRECT_URL$$ | An Epom redirect URL that ends open, waiting for a destination | Prepend to the landing URL so the click is counted, then forwarded |
$$CLICK_URL$$ | An Epom click-tracking pixel URL (counts a click, redirects nowhere) | Fire from custom JS when you can’t wrap the click destination |
The redirect form is what you want in almost every third-party tag. Under the hood it expands
to a URL that terminates in an empty redirect parameter (…&u=); the ad server treats
whatever follows the macro as the destination, counts the click, then 302-forwards there. That
single fact drives every rule below.
Corner case: if the banner has no click-through configured,
$$CLICK_REDIRECT_URL$$and$$CLICK_URL$$resolve to nothing and are removed from the markup. A tag that relies on them then has no click tracking at all. Make sure the banner (or the tag) actually supplies a destination.
Fix 1 — clicks not counting: prepend the redirect at the very start
Because the redirect URL ends open, the click macro must sit at the very beginning of the click destination, immediately in front of the landing URL. Anything between the macro and the URL becomes part of — or breaks — the redirect target.
Find the click-through in your tag (the href, the clickTAG/clickTag variable, or the
tracker’s click/redir/url parameter) and put the macro first:
<!-- HTML/JS creative — wrap the click-through -->
<a href="$$CLICK_REDIRECT_URL$$https://brand.example.com/landing">…</a>
<!-- clickTAG-style creative -->
var clickTag = "$$CLICK_REDIRECT_URL$$https://brand.example.com/landing";
- Do not URL-encode the landing URL yourself when it sits directly after the plain
$$CLICK_REDIRECT_URL$$— the server handles that final hop. - Do not put anything (a
?, a space, another parameter) between the macro and the destination. The macro already ends in…&u=.
Corner case: a tag that already had its own click redirector still needs Epom’s macro in front of that redirector so the click passes through Epom first, then the third party, then the landing page. Chaining order is left-to-right in the string.
Fix 2 — the landing URL is inside another tracker: pick the right _ESC variant
When the destination isn’t a bare URL but is itself a parameter of another tracker (an ad-verification or a DSP click tracker that will decode it before redirecting), the redirect value gets URL-decoded one or more times on the way. Match the encoding to the number of decode hops:
| Variant | Encoding | Use when the click passes through… |
|---|---|---|
$$CLICK_REDIRECT_URL$$ | none | …nothing — Epom is the only redirector, landing URL follows directly |
$$CLICK_REDIRECT_URL_ESC$$ | single URL-encode | …one external tracker that decodes once before redirecting |
$$CLICK_REDIRECT_URL_2_ESC$$ | double URL-encode | …a tracker that decodes twice (nested trackers, some DSP macros) |
Example — the Epom click sits inside a third-party tracker’s url= parameter, which will
decode it once. The macro encodes the Epom URL, so encode the landing URL you append to the
same depth:
<a href="https://tracker.example/click?id=42&url=$$CLICK_REDIRECT_URL_ESC$$https%3A%2F%2Fbrand.example.com%2Flanding">…</a>
If clicks land on a broken/truncated page, you have the wrong encoding level: too little encoding and the outer tracker eats part of the URL at its decode step; too much and the final URL arrives still-encoded. Step the variant up or down one level and re-test.
Corner case: the
_ESCvariants encode only the Epom redirect URL, not the landing URL you type after them. When you use_ESC/_2_ESCbecause an outer tracker will decode, encode the landing portion to the matching depth yourself, or let the outer tracker’s own macro supply it.
Fix 3 — pixel-only counting when you can’t wrap the click
Some tags expose no click-through you can prefix (a self-contained iframe creative whose click
is handled internally). Count the click with the pixel form instead — fire
$$CLICK_URL$$ from the creative’s own click handler:
<img src="$$CLICK_URL$$" width="0" height="0" style="display:none" alt="">
<!-- or, from JS on click: new Image().src = "$$CLICK_URL$$"; -->
This registers the click in Epom without redirecting; the creative still navigates the user
itself. Use $$CLICK_URL_ESC$$ if the pixel URL goes into a parameter that is decoded.
Fix 4 — impressions double-counting or not deduping: add $$RANDOM$$
A third-party impression pixel or an iframe src that a browser or CDN caches will be
re-served from cache — the third party then under- or mis-counts, and stale creatives can
reappear. Add a cache buster: $$RANDOM$$ expands to a fresh random integer
(0–2147483647) on every impression, so each request URL is unique and bypasses the cache.
Put it on the query string of any URL the third party wants fetched fresh — its impression
pixel, its tag src, its own cb/rand/ord cache-buster slot:
<!-- third-party impression pixel -->
<img src="https://verify.example/imp?id=42&cb=$$RANDOM$$" width="1" height="1" alt="">
<!-- iframe/script tag the vendor wants uncached -->
<iframe src="https://vendor.example/tag?ord=$$RANDOM$$"></iframe>
- Replace the vendor’s own cache-buster placeholder (often
[timestamp],%n,${CACHEBUSTER},ord) with$$RANDOM$$— vendors expect you to fill it. - Use
$$RANDOM(min, max)$$if the vendor requires a bounded value: the start is inclusive and the end exclusive, so$$RANDOM(0, 100)$$gives 0 to 99.
Corner case:
$$RANDOM$$only changes per served response. It does not help against an iframe the page keeps in the DOM and never re-requests — that’s a page-side caching issue, not a macro one. The macro guarantees a fresh value each time the ad server builds the markup; it can’t force the browser to re-fetch a cached node.
When the fix doesn’t stick
- Verify in Preview first. Open the banner’s Preview button — the click and random macros
should be replaced by a real Epom redirect URL and a number. If a macro is still literal
(
$$CLICK_REDIRECT_URL$$shown verbatim), it’s mistyped or in a context the processor doesn’t reach; check spelling and the$$…$$delimiters. - Confirm the banner has a destination — see the first corner case; a missing landing URL silently strips the click macros.
- Still zero clicks with a good redirect? The problem may be upstream — the banner isn’t serving at all. Run My ad is not serving.
- Preview shows it but the live page doesn’t (or vice versa): see Tags and preview problems.
Deeper diagnostics
| Tool | What it shows | Where |
|---|---|---|
| Preview on the banner | The substituted markup: the real redirect URL the click macro produced, the number $$RANDOM$$ became | The banner page’s Preview button |
| A real click on a live impression | The redirect chain in the browser’s Network tab: Epom’s 302, then each tracker, then the landing page — the first hop that lands encoded is the wrong _ESC level | The browser’s Network tab with “preserve log” |
| Clicks Log | The IP, user agent and referer of each counted click | Account → Analytics, Type of reports |
| General report grouped by Banner | Clicks and CTR per banner — the pasted tag against banners with a native click-through | Account → Analytics |
Per-role notes
- Shared creatives: a banner shared at Can view opens with its markup Read-only and no Save button — but Preview still renders the substituted markup, so you can read the redirect URL the macro produced and hand the owner a diagnosis rather than a guess.
When you escalate
Send your network manager the banner ID, the tag’s markup as pasted (with the macros), the landing URL you expect clicks to reach, what Preview shows for the click macro, and the time window with your reporting time zone. If the click reaches Epom but the landing page breaks, add the redirect chain from the Network tab.
Related
- Macros reference — every
$$…$$token and its_ESCvariants - HTML code and Template banners
- Tags and preview problems
- My ad is not serving
- Invocation code types
- Track impressions of a partner’s ad code — wrapping a partner’s code, impression pixel URLs, render detection
- Troubleshooting overview