Google Ads tracking templates for affiliates: what goes where, and why parallel tracking changes the setup
November 28, 2026 · Hoplytic team · 6 min read
Read the video transcript
Why does the classic Google Ads tracking template setup break for affiliates? Because of parallel tracking.
The final URL is where visitors land, and its domain must match the ad's display domain. The final URL suffix adds parameters to it, and the visitor's browser sees them. The tracking template is called by Google to record the click. Custom parameters are your own named values.
Google now calls the tracking template in the background, while the browser goes straight to your final URL. A click ID made there never reaches your page, and neither do the template's values.
Anything you need on the page goes in the final URL suffix. That includes keyword and device.
Turn on auto-tagging, so Google adds the gclid. Point the final URL at your own page, worth reading on its own. On that page, the outbound link goes through your tracker, which needs the gclid and those values. The tracker's click ID goes in the network's sub-ID, so the sale lands on the click holding the gclid.
If you do use a template, include lpurl, use HTTPS, redirect server-side, and leave out spaces.
Hoplytic's site script remembers those names, plus the gclid, and adds them to every Hoplytic link the visitor clicks. Reports then group sales by campaign, keyword and device.
The full guide is right below. Hoplytic: ad tracking made simple.
Key points
- Parallel tracking is mandatory for Search, Shopping, Display, Video and Performance Max, so the visitor goes straight to the final URL and never passes through a tracker in the template.
- For affiliates, put ValueTrack values in the final URL suffix so they reach your landing page, and record the affiliate click from there.
- A tracking template must include {lpurl} (or a variant), use HTTPS, and redirect server-side to the final URL.
- The most specific level wins: a keyword or ad template overrides the ad group, campaign and account templates.
- Custom parameters ({_name}) let you add your own labels, up to 8 per level below the account.
Most tracking template guides were written for advertisers who own the landing page and the checkout. Affiliates have a third step, the click to the network, and that step is where Google's parallel tracking quietly breaks the classic tracker setup.
Short answer: keep auto-tagging on, put the ValueTrack values you need in the final URL suffix (for example campaign={campaignid}&adgroup={adgroupid}&kw={keyword}&device={device}) so they arrive on your landing page, and record the affiliate click from that page with a tracked link that carries those values and the gclid. Use the tracking template only if you also want a tracker to log the ad click itself, and make sure it ends at {lpurl}.
The four URL fields and what each one does
| Field | What it does | Example |
|---|---|---|
| Final URL | The page the visitor lands on. Its domain must match the ad's display domain. | https://bestvpnreviews.example/nordvpn-review |
| Final URL suffix | Parameters appended to the final URL. The visitor's browser sees them. | campaign={campaignid}&kw={keyword} |
| Tracking template | The URL Google calls to record the click, with {lpurl} standing for the final URL. | https://track.example/c?cmp={campaignid}&url={lpurl} |
| Custom parameters | Your own named values, used as {_name} in the other fields. | {_angle} = price |
For the full list of values you can insert, see ValueTrack parameters explained.
Parallel tracking: why the old setup fails for affiliates
Before parallel tracking, a click went ad, then tracker, then landing page. A tracker in the template could create its own click ID and append it to the landing page URL. Google now requires parallel tracking for Search, Shopping, Display, Video and Performance Max campaigns. The visitor's browser goes straight to the final URL, and Google calls the tracking template in the background.
That has three consequences an affiliate needs to know:
- Nothing the tracker adds reaches your page. A click ID created in the background request never appears in the visitor's address bar, so your landing page can't pass it to the affiliate link.
- The template's values don't reach your page either. If
kw={keyword}is only in the template, your page never sees the keyword. - Counts won't line up exactly. The background request and the page load are separate, so ad clicks logged by a template tracker and visits to your page will differ a little.
The fix is simple: anything you need on the page goes in the final URL suffix.
A setup that works
- Turn on auto-tagging (Admin, Account settings). Google then adds
gclidto every click on its own. On some iOS clicks you may seegbraidorwbraidinstead. - Set an account-level final URL suffix such as
campaign={campaignid}&adgroup={adgroupid}&kw={keyword}&device={device}&match={matchtype}. - Point the final URL at your own page: a review, comparison or guide that is worth reading on its own. Google's policies on destination and display domains make direct affiliate links risky on search.
- Carry the values to the affiliate click. On that page, the outbound link goes through your tracker, and the tracker needs the
gclidand the values from step 2 on that click. Either your server copies them into the link, or a small script on the page remembers them and adds them when the visitor clicks. - Put your tracker's click ID in the network's sub-ID. When the network reports the sale, it lands on the click that holds the
gclid, and from there it can be sent back to Google as an offline conversion.
Example: a visitor searches "nordvpn coupon", clicks your ad and lands on
https://bestvpnreviews.example/nordvpn-review?campaign=21458820117&adgroup=164209311874&kw=nordvpn+coupon&device=m&match=p&gclid=Cj0KCQiA4...
They click "Get the deal". The tracked link records all of those values with click ID c7f3a9e1 and sends the visitor to the network with aff_sub=c7f3a9e1.
Writing a tracking template correctly
If you do use a template, for example for a tracker that counts ad clicks or a call-tracking tool, follow Google's rules:
- Include
{lpurl}or a variant. At the very start of the template,{lpurl}is inserted as is. Anywhere else, Google escapes it, which is what a tracker expectingurl=...wants. - Pick the right escaping for chains.
{lpurl+2}and{lpurl+3}escape the final URL two or three times, for templates that pass through more than one redirect.{unescapedlpurl}never escapes it. - Use HTTPS for the template and every redirect, and redirect server-side. JavaScript or meta-refresh hops are not allowed.
- Let Google handle the question mark. If your final URL already has a
?, Google replaces the one in{lpurl}?a=bwith&. - No spaces. They break the URL.
Which level wins
Templates, suffixes and custom parameters can be set on the account, campaign, ad group, ad and keyword. The most specific one wins, and it replaces the others completely rather than adding to them. A common surprise: someone sets a keyword-level template for one test, and that keyword's clicks lose every value from the campaign template. When values go missing on a few keywords only, look there first.
Custom parameters
Custom parameters let you add labels Google doesn't have, such as the angle of an ad or the offer it promotes. Define _angle = price on one ad group and _angle = trust on another, then add angle={_angle} to the suffix. Google allows up to 8 custom parameters per campaign, ad group, ad or keyword (not at the account level), with names of up to 16 letters and numbers and values of up to 250 characters.
Testing before you spend
- Open your final URL with the suffix filled in by hand (for example
?campaign=test&kw=test&gclid=test123) and check your page and tracker keep every value. - After the first real clicks, look at a few recorded visits: every value filled, no literal
{keyword}. - Click the affiliate link on the page and check that the tracker recorded the
gclidand the suffix values. - Run the affiliate link through a redirect checker to confirm the sub-ID survives to the merchant.
Template changes can take a day or two to apply everywhere, so retest the next day after an edit.
How to do this in Hoplytic
Use the suffix above: its names (campaign, adgroup, kw) are ones the site script already remembers, along with gclid, gbraid, wbraid and UTM tags. With the script on your landing page, those values are added to every Hoplytic link the visitor clicks, and the click ID goes into the network's sub-ID automatically. Reports can then group sales by campaign, keyword and device, and the Google Ads feed under Send back returns each sale with its gclid. The broader picture of Google traffic is in click tracking for Google Ads.
Questions people ask
What is a tracking template in Google Ads?
A URL pattern that Google uses to build the tracking request for each click, with {lpurl} standing for your final URL. It's where third-party click trackers usually go. With parallel tracking, Google calls it in the background while the visitor loads the final URL.
Should I use the tracking template or the final URL suffix?
Use the final URL suffix for values your landing page needs to see, such as campaign, keyword and device. Use the tracking template only for a tracker that must record the ad click itself and then send the request on to {lpurl}.
Can I put my affiliate link in the tracking template?
No. The template must end at your final URL, and with parallel tracking the visitor never follows it anyway. The affiliate link belongs on your landing page.
Why are my ValueTrack values missing on the landing page?
Usually because they are only in the tracking template, which runs in the background. Move them to the final URL suffix, or check that a higher-priority template at the keyword or ad level isn't replacing yours.
More in Traffic sources and macros
Also: tracking glossary · ad platform macros · Markdown copy