Google Ads Tracking Template: How It Works, Which Level Wins and How to Test It

Google Ads Tracking Template: How It Works, Which Level Wins and How to Test It

Google AdsNovember 5, 2026
By Antonio Fernandez

TL;DR

  • The final URL is the landing page, the final URL suffix carries parameters the page reads, and the tracking template builds the click-measurement URL around {lpurl}.
  • Templates can be set at account, campaign, ad group, ad and keyword level; Google Ads uses the most specific one and does not merge levels.
  • Parallel tracking is mandatory for Search, Shopping, Display, Video and Performance Max, so UTM tags belong in the final URL suffix, not the template.
  • Custom parameters allow up to 8 per level, names up to 16 characters and values up to 250 characters, and cannot be set at account level.

A Google Ads tracking template is a URL pattern that tells Google Ads how to build the measurement URL for a click, usually a third-party tracker address with the landing page inserted through the {lpurl} parameter. It is separate from the final URL, which is the page the visitor actually lands on, and from the final URL suffix, which holds the parameters that page needs to read.

That three-way split confuses a lot of advertisers, because all three live under the same "Tracking" or "URL options" panel and all three can carry ValueTrack parameters. This guide explains what each field does, how the {lpurl} family and the other ValueTrack parameters behave, which level wins when templates conflict, what parallel tracking changed, how to test before anything goes live, and when plain UTM tags are enough.

What a tracking template is, and how it differs from the final URL and final URL suffix

Google Ads has three URL fields that work together. The final URL is the address of your landing page, the one a visitor sees in the browser bar after clicking. The tracking template is a second URL that wraps the final URL with click-measurement information. The final URL suffix is a string of parameters, such as utm_source=google&utm_medium=cpc, that Google Ads appends to the end of the final URL.

Google's API documentation describes the template's job this way: when a tracking template is set, Google Ads uses it, rather than the final URL alone, to assemble the actual click URL. A simple example looks like this in plain text:

  • Final URL: https://www.example.co.th/condo-sukhumvit/
  • Tracking template: https://tracker.example.com/click?campaign={campaignid}&dest={lpurl}
  • Final URL suffix: utm_source=google&utm_medium=cpc&utm_campaign={campaignid}

The tracker in the template receives the click, logs the campaign ID, and knows where the visitor was going because {lpurl} carries the landing page address. The suffix makes sure the landing page itself receives the UTM values that an analytics tag reads.

The rule of thumb that follows from this: anything the landing page needs to read goes in the final URL suffix (or the final URL). Anything only a measurement system needs to log goes in the tracking template. That split matters even more once parallel tracking enters the picture, covered below.

How ValueTrack parameters like {lpurl}, {campaignid} and {keyword} work

ValueTrack parameters are placeholders in curly braces. At click time, Google Ads replaces each one with a real value from that click. You can use most of them in the tracking template, the final URL suffix, the final URL or custom parameters. The commonly used ones are:

  • {campaignid} and {adgroupid}: the numeric IDs of the campaign and ad group that served the ad.
  • {creative}: the unique ID of the ad.
  • {keyword}: the keyword in your account that matched the search. It is blank for keywordless matches.
  • {matchtype}: the match type of that keyword, returned as e (exact), p (phrase), b (broad), or a for AI Max keywordless matching.
  • {targetid}: the ID of the keyword, audience, dynamic ad target or other target that triggered the ad.
  • {network}: where the click came from, such as g for Google Search, s for Search partners, d for Display, ytv for YouTube and x for Performance Max.
  • {device}: m for mobile, t for tablet, c for computer.
  • {loc_physical_ms} and {loc_interest_ms}: location IDs for where the click physically happened and the location of interest that helped trigger the ad.
  • {placement}: the site or placement where a Display or video ad was clicked.
  • {gclid}: the Google click identifier.
  • {ifmobile:value} and {ifnotmobile:value}: insert your own value only for mobile, or only for computer and tablet clicks.

Not every parameter works everywhere. Google's ValueTrack reference lists {keyword}, {placement}, {target}, {network}, {targetid}, {ifsearch:} and {ifcontent:} as unsupported for Demand Gen ads, so a template built for Search can return empty values on Demand Gen traffic.

The {lpurl} family and escaping

{lpurl} is the parameter that makes a tracking template work. It inserts the final URL. Google's help documentation says tracking templates at the account, campaign and ad group level must include a URL insertion parameter such as {lpurl}, or the landing page URL breaks. For Dynamic Search Ads and auto-targets, the insertion parameter is required at every level.

Escaping is where most templates go wrong. When {lpurl} sits at the very start of the template, the landing page URL is inserted as is. Anywhere else, Google Ads escapes characters such as ?, =, ", #, tab, apostrophes and spaces, so the landing page can travel safely as a value inside the tracker's own URL. Related variants exist for redirect chains:

  • {lpurl+2} and {lpurl+3} escape the URL two or three times, for templates that pass through two or three redirects.
  • {unescapedlpurl} inserts the URL with no escaping.
  • {escapedlpurl} escapes :, /, ?, = and % as well.

The character that follows the parameter has to match. After {lpurl} at the start you use a plain ?, while after {lpurl} in the middle of a template Google's reference shows the escaped form %3F. If the final URL already contains a question mark, Google Ads replaces the template's question mark with an ampersand or its escaped equivalent so the URL stays valid.

Custom parameters

Custom parameters are your own placeholders, written with a leading underscore such as {_promo}. Google's help page sets the limits: up to 8 custom parameters per level, names up to 16 alphanumeric characters, values up to 250 characters. They can be set at campaign, ad group, ad, keyword and sitelink level, but not at account level. A typical use is one shared template like {lpurl}?promo={_promo}, with {_promo} set differently on each campaign.

Which level wins: account, campaign, ad group, ad or keyword

You can set a tracking template at the account, campaign, ad group, ad and keyword levels, and also on sitelinks, Performance Max asset groups and dynamic ad targets. When templates exist at several levels, Google Ads uses the most specific one. The order, from most to least specific, is keyword, ad, ad group, campaign, account.

The same principle applies to the other URL options. Google's API documentation states that a final URL suffix on a lower-level entity overrides one on a higher-level entity, and custom parameter values at a lower level override values set higher up.

Two practical consequences follow. First, a single forgotten keyword-level template will silently override a carefully built account template for that keyword. Second, overriding is replacement, not merging. A keyword-level template does not inherit anything from the campaign template; it has to contain the full pattern, including {lpurl}.

How parallel tracking changes what a tracking template can do

Before parallel tracking, a click went through the tracking template first: the visitor's browser hit the Google Ads click tracker, then the third-party tracker, then any further redirects, and only then the landing page. Each redirect added waiting time.

With parallel tracking, Google Ads sends the visitor straight to the final URL while the click tracker and the tracking URL load in the background. Google's help page states that parallel tracking is mandatory for Search, Shopping, Display, Video and Performance Max campaigns, and optional for hotel campaigns.

This changes three things about how you write a template:

  • The landing page never sees the template. Parameters you put only in the tracking template reach the tracker, not the page. If the page or its analytics tag needs a value, put it in the final URL suffix. Google's API documentation says parameters the landing page needs must be placed in the final URL suffix.
  • The tracker has to accept background requests. Google advises checking with your click measurement provider that its system is compatible with parallel tracking.
  • HTTPS is required. Google states that the tracking template URL and all redirect URLs need to be HTTPS, and redirects must be server-side.

How to test a tracking template before it goes live

Google Ads has a built-in Test button next to the URL options at campaign, ad group, ad, asset group and sitelink level. Selecting Test makes Google Ads combine the final URL with your tracking settings and check that the click leads to a working landing page. Run it before you select Save.

A practical pre-launch checklist:

  1. Write the full template on paper first, with the final URL you expect, and decide whether {lpurl} sits at the start or inside a tracker URL.
  2. Paste it at the narrowest level you need, ideally one campaign, rather than the account.
  3. Select Test and confirm the result resolves to the right landing page.
  4. Copy the assembled URL into a browser yourself. Check that the landing page loads and that the UTM values from the suffix appear in the address bar.
  5. Open the real-time view in your analytics tool and confirm a session arrives with the expected source, medium and campaign.
  6. Check the tracker's own log for the test hit and confirm values such as {campaignid} were replaced rather than passed through as literal text.
  7. Only then copy the template up to other campaigns or the account level.

Keyword and dynamic ad target levels do not show the Test step in Google's instructions, so test the same pattern at campaign or ad group level first.

Tracking template vs UTM tags: when you need each

Many advertisers do not need a tracking template at all. If the only goal is to see Google Ads traffic correctly in Google Analytics 4, auto-tagging with the gclid already handles attribution for a linked GA4 property, and UTM tags placed in the final URL suffix cover any other analytics tool that reads utm_source, utm_medium and utm_campaign.

A tracking template earns its place when a separate system has to record the click: a third-party ad server, a call-tracking platform, an affiliate network, or an in-house click logger. It also helps when you want click-level IDs like {creative} or {targetid} delivered to that system without exposing them in the landing page URL.

Tracking template vs UTM tags: when you need each
FieldWho reads itTypical content
Final URLThe visitor's browserThe landing page address
Final URL suffixThe landing page and its analytics tagsUTM tags and ValueTrack values the page should record
Tracking templateA click tracker, in the background under parallel trackingTracker URL with {lpurl} and click IDs
Custom parameterWhatever field references itUp to 8 per level, such as {_promo}

Common mistakes and what each one costs

  • Putting UTM tags only in the tracking template. Under parallel tracking the landing page never receives them, so analytics shows the traffic without the campaign values you expected.
  • Leaving out {lpurl} at account, campaign or ad group level. Google warns that the landing page URL breaks without a URL insertion parameter, which can cost clicks until it is fixed.
  • Using the wrong separator after {lpurl}. Google's reference shows the escaped %3F, not a plain ?, after {lpurl} placed mid-template.
  • An HTTP tracker. Non-HTTPS templates or redirects do not work under Google's requirements.
  • Forgotten keyword-level templates. They override everything above them, so an account-wide change appears to "not apply" to some traffic.
  • Assuming every ValueTrack parameter fills on every campaign type. Demand Gen, for example, does not support {keyword} or {network}.

What this means for advertisers in Thailand

Thai campaigns often mix Thai and English keywords in one account, and that shows up in tracking. A Thai keyword passed through {keyword} travels in a URL, so under standard URL encoding it arrives percent-encoded, as a long string of %E0%B8 style sequences. Reports built from raw tracker logs need a decoding step before anyone can read them, or the Thai keyword list turns into unreadable codes.

Thai landing pages also tend to have Thai slugs. The same encoding applies to the final URL inside {lpurl}, which makes the escaping rules above more than a technicality: a doubly escaped Thai URL is long and easy to break by hand-editing. Build the template once, test it with a Thai-slug landing page specifically, and copy it rather than retyping it.

If a call-tracking or LINE attribution vendor needs click data, the tracking template is usually how it gets it, and the vendor should confirm parallel tracking compatibility in writing before launch.

FAQ

Do I need a Google Ads tracking template if I only use Google Analytics 4?

Usually not, because auto-tagging covers attribution in a linked GA4 property and UTM tags can go in the final URL suffix. A template becomes necessary when a separate click-measurement system has to record each click.

Why are my UTM parameters missing from the landing page?

The most likely cause is that they sit in the tracking template, which the landing page never sees under parallel tracking. Move them to the final URL suffix, where Google says landing-page parameters belong.

Which tracking template applies if I set one at campaign level and one at keyword level?

The keyword-level template applies, because Google Ads uses the most specific template in the order keyword, ad, ad group, campaign, account. The keyword template replaces the campaign one completely rather than adding to it.

How many custom parameters can I use?

Up to 8 per level, with names of up to 16 alphanumeric characters and values of up to 250 characters, according to Google's help page. They cannot be set at account level.

Getting tracking right before you scale spend

If you want your URL options, GA4 link and conversion setup reviewed together, the Google Ads management team can audit them as part of an account setup, and Relevant Search for Google Ads covers ongoing search campaign work. For measurement on the analytics side, see the GA4 migration service.

Antonio Fernandez

Antonio Fernandez

Founder and CEO of Relevant Audience. With over 15 years of experience in digital marketing strategy, he leads teams across southeast Asia in delivering exceptional results for clients through performance-focused digital solutions.

Share to:
Copy link:

Read us often? Add Relevant Audience as a preferred source so our articles surface more in your Google results.