On this page
A Google Ads tracking template is a URL field that controls how each ad click is processed before reaching the landing page. Set at account level, it appends UTM parameters and ValueTrack macros to every campaign automatically. For agencies managing multiple client accounts, it is the single control point for consistent attribution data across an entire client portfolio.
Quick Answer
- A tracking template starts with `{lpurl}` (the landing page URL placeholder) followed by your UTM parameters and ValueTrack macros, set at account level and it applies to every campaign in that account automatically.
- The hierarchy is most-specific-wins: a campaign-level template silently overrides the account template for every click through that campaign, with no alert from Google Ads.
- Agencies pushing tracking templates across 20+ client accounts programmatically, rather than manually account by account, eliminate the class of silent encoding errors that create multi-week attribution gaps.
A Google Ads account manager opens GA4 on a Tuesday and finds three weeks of (direct) / (none) for a client running a large paid search budget. She navigates to the account settings, finds the account-level tracking template intact, then digs into campaign URL options, where a template set by the previous agency six weeks ago starts with utm_source=google instead of {lpurl}?utm_source=google. Google accepted the broken template without any error. The campaign ran. The attribution stopped.
This guide covers how the tracking template hierarchy works, which ValueTrack parameters survive across all campaign types, the four encoding errors that cause silent failures, and how agencies apply consistent templates across client portfolios without manual account-by-account setup.
What a Google Ads Tracking Template Actually Does
A tracking template is not the same as your landing page URL. It is a separate field that defines the path each click travels before Google delivers the user to the final URL.
When someone clicks an ad, Google reads the tracking template first. It resolves the {lpurl} placeholder (which stands for the landing page URL), appends whatever parameters you defined, and either passes the click through under parallel tracking or routes it through a redirect chain. The distinction between "pass-through" and "redirect" matters more than most setup guides acknowledge.
The {lpurl} placeholder and parallel tracking
Every tracking template must start with {lpurl} unless you are routing clicks through an external redirect server that generates its own URL. That placeholder is where Google inserts the destination URL at click time. A template without it, or with it encoded or positioned incorrectly, produces a malformed URL that either returns a 404 or strips all parameters before delivery.
Under parallel tracking, which Google has required for Search campaigns since 2019 and enforces across all campaign types in 2026, the browser sends the user directly to the final URL while tracking fires in a separate background request. Your tracking template still runs, but as a parallel call, not a redirect in the user's browser. The practical consequence: any intermediate redirects in your tracking chain must be server-side. A client-side redirect inside the tracking template breaks under parallel tracking because the browser is already delivering the user to the final URL.
Why tracking templates and final URL suffixes do different jobs
The final URL suffix is a simpler mechanism. It appends parameters directly to your final URL with no redirect logic. Set utm_source=google&utm_medium=cpc&utm_campaign={campaignid} in the suffix field and Google attaches it to the end of every destination URL automatically.
A tracking template is the right tool when you need to route clicks through a third-party tracking system: a call tracking provider, a click fraud detection service, or an attribution platform that requires a redirect before handing off to the landing page. For conversion tracking software that sits between Google's click and your landing page, the tracking template is where the redirect URL goes.
If you only need UTMs in GA4, the final URL suffix is the cleaner option and eliminates an entire category of template-related failures. If you need a redirect, the tracking template is the right field, set up with care.
The 5-Level Hierarchy That Agencies Underestimate
Google Ads applies tracking templates using a most-specific-wins rule. Precedence order from most to least specific: keyword, ad, ad group, campaign, and account.
Set a tracking template at account level and it applies everywhere by default. Override it at campaign level and that campaign ignores the account template for every single click. Override at ad group level within that campaign and the ad group ignores the campaign template entirely. Google does not merge or stack templates; the most specific template found wins, and everything above it is ignored for that click.
Account level covers everything by default
Setting one tracking template at account level is the correct baseline for any agency managing multiple campaigns within a client account. Define the standard UTM structure once, validate it, and every new campaign inherits it automatically. No manual setup per campaign. No risk that a high-spend campaign launches without tracking because someone forgot a step.
The account-level template is where your core UTM structure lives:
{lpurl}?utm_source=google&utm_medium=cpc&utm_campaign={campaignid}&utm_content={adgroupid}&utm_term={keyword}
The campaign ID parameter ({campaignid}) is a safer choice than campaign name for utm_campaign because it never changes, never contains special characters, and joins cleanly to Google Ads data exports. For attribution analysis downstream, campaign IDs survive campaign renames, which is one of the more common sources of broken dashboards when team members update naming conventions mid-flight. For agencies running conversion tracking software in the redirect chain, the account-level template is also where that redirect URL lives.
The silent override that kills three weeks of attribution data
The failure mode agencies hit most often is a campaign-level or ad group-level template left behind by a previous team member, an imported campaign, or a third-party tool. That override sits there silently, taking precedence over the account template for every click through that campaign, generating no alerts and no disapprovals.
The symptoms are specific: source/medium shows correctly for most of the client's paid search traffic, but one campaign (often a high-spend campaign added during a platform migration) shows (direct) / (none) or a mangled parameter string in GA4. Because most traffic looks correct, the issue persists for weeks before someone spots it in a campaign-level segment. Managing broken conversion tracking and broken tracking templates together requires auditing both URL options and conversion action configurations at the same time.
In practice, the first step when inheriting a client account is to audit every campaign and ad group's URL options for leftover tracking templates. The Google Ads UI shows them in the "Campaign URL options" drawer under each campaign's Settings tab. Any template at campaign or ad group level that is not an intentional override needs to be cleared so the account template takes over.
Which ValueTrack Parameters Survive in Every Campaign Type
ValueTrack parameters are macros that Google resolves at click time, replacing the placeholder with the actual value for that specific click. {campaignid} becomes the campaign's numerical ID. {keyword} becomes the search term that triggered the ad. {device} becomes m, c, or t for mobile, computer, or tablet.
The problem for agencies managing diverse account portfolios is that not all ValueTrack parameters work in all campaign types. A template built for Search campaigns may silently return empty strings for several parameters when applied to Performance Max or Display, with no error, no disapproval, and no indication from the Google Ads UI that the parameter failed.
Parameters that work across Search, Display, and Performance Max
These parameters resolve correctly across all Google Ads campaign types and are safe to include in your account-level template:
{campaignid}: returns the campaign's numerical ID. Always resolves regardless of campaign type.
{adgroupid}: returns the ad group ID. Resolves in Search, Display, and Performance Max asset groups.
{device}: returns the device code. Resolves in every campaign type.
{creative}: returns the ad ID. Resolves in Search, Display, and Performance Max.
{network}: returns g (Google search), s (search partners), or d (display network) in Search and Display. In Performance Max, it returns the placement type for the asset group that served.
Parameters that return empty strings in Performance Max and AI Max
As of 2026, both Performance Max and the newer AI Max campaign type share this limitation. {keyword}: the parameter most agencies include in utm_term returns an empty value in Performance Max because PMax does not use keyword-level targeting. If your account-level template includes {keyword} and you run PMax campaigns, those clicks show utm_term= with an empty value in GA4, creating null rows across your keyword dimension.
{matchtype}: same issue. No keyword matching in Performance Max means no match type to report.
The cleanest solution is to use a deliberately different campaign-level template for PMax campaigns that excludes {keyword} and {matchtype} from the string. This is an intentional override, the opposite of the accidental overrides that cause attribution gaps. For how measurement gaps vary by campaign type, see the Google Ads conversion lift and Performance Max measurement guide.
How to Set the Account-Level Tracking Template in Four Steps
The account-level tracking template lives in Google Ads under Settings > Account Settings > Tracking. The section expands to reveal the Tracking template field and the Final URL suffix field as separate inputs.
Build the template string correctly
Start with {lpurl} followed by a question mark and your first parameter. The question mark is mandatory unless your landing page URL already has a query string; in which case, use & for your first parameter to avoid a double question mark that most web servers reject.
A standard agency template:
{lpurl}?utm_source=google&utm_medium=cpc&utm_campaign={campaignid}&utm_content={adgroupid}&utm_term={keyword}
If you want human-readable campaign names alongside stable IDs, add a custom parameter. Custom parameters use the format {_paramname} in the template and are defined at the campaign level under Campaign URL options. They let you add readable values without hard-coding strings that break when campaigns are renamed. Use them alongside {campaignid} rather than instead of it, because the ID stays stable even when the name changes.
Do not URL-encode {lpurl} or wrap it in additional placeholder syntax. Some third-party tools generate templates with encoded versions of {lpurl} for redirect chains. Unless your specific redirect server requires encoded input, use the plain {lpurl} macro directly.
Test before you save
Google Ads provides a Test field directly below the tracking template input. It accepts a destination URL and shows the fully resolved tracking URL that Google would generate at click time. Use it before saving. Enter a representative landing page URL, click Test, and verify the output contains all expected parameters with correct values.
The test validates template syntax, not that the landing page returns 200. A template can pass the syntax test and still 404 if your landing page changes or if your server rejects long query strings. For a complete automated Google Ads setup workflow that includes post-deployment validation, template testing is one step in a broader account health checklist.
Author's Comment
"When I look at agency Google Ads setups, the tracking template is usually the last thing anyone audits. We built a check into Hellyeah's CLI that scans all connected client accounts for campaign-level template overrides on first connection, because the account-level template being there does not mean every campaign is actually using it. Three weeks of blank attribution data is fixable. Three months of corrupted historical data in your reporting model is not."
Bharath, Engineer, Hellyeah AI
How to Detect a Broken Template Before Attribution Goes Dark
A broken tracking template does not trigger a Google Ads alert. Campaign status stays Active. Impression share, clicks, and spend all report normally. The failure only appears in your analytics platform, where traffic that should show as google / cpc arrives as (direct) / (none).
Detection speed matters. A tracking template failure caught in 24 hours costs one day of attribution data. The same failure caught three weeks later costs a month of decision-quality data and forces you to backfill performance comparisons from partial signals.
The GA4 signal that appears within 24 hours of failure
Open GA4, go to Acquisition > Traffic Acquisition, and segment by Default Channel Grouping. Add a secondary dimension of Source / Medium. If Paid Search shows a spike in (direct) / (none) sub-sessions, or if the google / cpc row drops while your Google Ads spend stays constant, investigate the tracking template before anything else.
The mismatch between spend (visible in the Google Ads linked view) and sessions attributed to google / cpc is the clearest signal. Google Ads continues counting impressions and clicks in its own reporting whether or not the tracking template works. GA4 only counts sessions where UTM parameters survived the click. A gap of 10% or larger between Google Ads reported clicks and GA4 google / cpc sessions for the same date range warrants immediate investigation.
A weekly check every agency account manager needs
Add a standing task to your weekly account review: pull total clicks from Google Ads for the past 7 days, pull google / cpc sessions from GA4 for the same period, and flag any gap above 15%. The 15% threshold accounts for ad blockers, JavaScript-disabled browsers, and legitimate counting differences between click-level and session-level measurement. A gap above 15% is a tracking investigation, not a reporting discrepancy.
For accounts with Google Ads conversion data issues at the baseline level, fix conversion action configuration before diagnosing tracking templates first; a broken conversion action produces symptoms that overlap with broken UTMs and makes root cause analysis harder. Build tracking template verification as an explicit step in your Google Ads account audit checklist, alongside quality score review and negative keyword audits.
Tracking template failures compound because historical attribution data cannot be retroactively reconstructed. When a Google Ads tracking template is broken, every click during that period arrives at the landing page without UTM parameters. Google Ads records the click and the spend normally. GA4 records the session but attributes it to (direct) / (none) rather than google / cpc. The mismatch is permanent for those dates. If your account ran 40,000 paid search sessions in three weeks with a broken template, none of those sessions will ever show as google / cpc in GA4 for those dates. The only recovery path is to document the outage period with a GA4 annotation, exclude those weeks from source/medium performance comparisons, and use spend and click data from the Google Ads API as a proxy for the missing attribution signal when reporting to the client on campaign performance.
The 4 Encoding Errors That Kill Attribution Silently
The Google Ads interface accepts tracking templates containing encoding errors without any warning. The template saves, the campaign serves, and a malformed URL is appended to every click for as long as the error goes undetected. These four patterns account for the majority of attribution failures caused by template mistakes.
Missing {lpurl} at the start
A template that starts with utm_source=google instead of {lpurl}?utm_source=google has no destination URL. Without the {lpurl} placeholder, Google has no final URL to send the user to. The outcome varies: the click either 404s, Google falls back to the final URL without parameters, or the ad disapproves after a crawl cycle. This behavior differs by campaign type and is not predictable.
This error occurs most often when templates are updated through bulk imports or API calls without a validation step. The Google Ads test field catches it if you use it explicitly, but a programmatic update that skips the test step can push this error to hundreds of campaigns before anyone notices.
Double-encoding the question mark
If your landing page URL already contains a query string (for example, https://example.com/landing?ref=paid), the tracking template needs & before your first UTM parameter, not ?. Using ? when the destination URL already has one creates a double question mark in the resolved URL. Most web servers interpret only the first question mark as the query string delimiter and reject or ignore everything after the second. Your ad click reaches the landing page, but all UTM parameters are dropped.
In parallel tracking, the user sees the landing page load correctly, which is why this error is so difficult to notice without checking the GA4 source/medium attribution for that campaign specifically.
Special characters in campaign names
If you use {_campaign} as a custom parameter to include your human-readable campaign name in utm_campaign, and that campaign name contains special characters (&, +, commas, parentheses, or spaces), those characters need URL encoding in the custom parameter value definition. An ampersand in a campaign name (Brand & Offers) stored as a raw custom parameter breaks the query string at the & character, truncating your UTMs mid-string.
In practice, the parameter definition should encode the value: replace & with %26, spaces with + or %20. The Google Ads UI does not enforce this encoding automatically. For multi-touch attribution systems that read these parameters downstream, encoding must be consistent across all accounts and all team members who set custom parameter values.
Campaign-level override without coordination
An account-level template that your team maintains, plus a campaign-level template left by a previous vendor, means the campaign template wins on every click through that campaign, regardless of how correct the account template is. The override is invisible in the account-level settings view. You see it only by opening each campaign's URL options individually.
At agency scale, this happens when client accounts arrive with templates from prior vendors, or when campaigns are duplicated from accounts with different template structures. A structured account intake process that includes a tracking template audit, scanning every campaign and ad group for URL option overrides, is the prevention. See how Google Ads channel management connects to paid media strategy for a broader intake framework.
How Agencies Push Tracking Templates Across Client Accounts Without Manual Setup
For an agency managing 5 client Google Ads accounts, the manual process (open each account, navigate to Settings, paste the template, click Test, save) is workable. For an agency managing 25 accounts, the same process takes a full day and introduces inconsistency at each manual step. A template copied from a Notion doc and pasted into 25 account fields will have at least one copy-paste error. It always does.
Google Ads Manager Accounts (MCC) provide consolidated access but not shared template configuration. Tracking templates are set at the individual account level. The MCC is a management layer, not a configuration layer for URL tracking, so agencies need a different approach.
At agency scale, a single encoding error in a tracking template replicates across every campaign in an account with no notification from Google Ads. The platform accepts the template, continues serving ads, and reports clicks and impressions normally. The only failure signal appears in GA4, where sessions from paid search start showing as (direct) / (none). For agencies managing 20 or more client accounts, manual tracking template setup means carrying this risk into every new account onboarded. Hellyeah's CLI addresses this by validating the resolved URL against each account's actual landing page destinations before applying any template change; a template that passes the Google Ads test field but produces a 404 on a specific client's landing page configuration fails the validation step and is flagged before it reaches production. Final Round AI, running paid acquisition through the Hellyeah platform's AIMA engine, achieved a 4.2x return on ad spend. That outcome requires attribution data arriving correctly on every click.
What MCC-level tracking gives you (and what it doesn't)
The MCC gives you cross-account conversion tracking (define a conversion action once, apply it across linked accounts) and consolidated billing. For tracking templates, it gives you visibility and access; you can navigate into each sub-account and check or update the template from the MCC dashboard, but there is no shared template field that pushes to all accounts simultaneously.
Google Ads Scripts and the Google Ads API allow JavaScript-based and programmatic automation across all linked accounts. A script can loop through every sub-account, read the current account-level tracking template, compare it to a reference template, and update it when they differ. For agencies already using scripts for bid rules or performance alerts, this is an extension of an existing workflow.
The risk with custom scripts: a malformed template pushed to 25 accounts simultaneously creates 25 broken setups in minutes. Scripts lack built-in URL validation; they push what you give them. Error handling requires additional development, and deployment review adds overhead.
Using Hellyeah's CLI to push template changes programmatically across accounts
Hellyeah's CLI provides a command-line interface for managing Google Ads smart bidding strategies and account configurations across connected client accounts, including tracking template deployment. Rather than looping through accounts with a custom script, you define the template once, specify which accounts or account groups it should apply to, and the CLI handles deployment with built-in validation before any write operation.
In practice, the CLI checks the resolved URL against each account's active landing page destinations, not just the template syntax. Before writing any change, it flags accounts where the template would produce a malformed or non-resolving URL. The deployment report shows which accounts were updated successfully and which were skipped with the specific reason.
Agencies running client accounts through the Hellyeah platform also get attribution signal quality monitoring through Hellyeah's X-Ray, which tracks the gap between Google Ads click volume and GA4 attributed sessions as a separate health metric, so a tracking template failure appears as a measurement health alert before it shows up as a campaign performance anomaly.
For agencies managing paid media portfolios where tracking template consistency is one piece of a larger operational setup, Hellyeah's Managed Growth includes account configuration audits as part of the onboarding process. Request a demo to see how the intake handles tracking template validation across a client portfolio.
When a Client's UTMs Have Been Blank for Weeks
The discovery is the same every time: someone pulls a channel analysis in GA4, notices the paid search numbers look wrong, filters by source/medium, and finds weeks of paid search traffic sitting in (direct) / (none). The tracking template has been broken the whole time.
The actionable response is methodical, not reactive.
Reconstructing what you can from other signals
You cannot recover UTM-level attribution from the Google Ads API for historical clicks; the API does not store the tracking URLs from past sessions. What you can reconstruct is campaign-level performance context using the Google Ads data that did persist.
Pull clicks, impressions, cost, and conversion data from Google Ads for the outage period using date-range filtering. Cross-reference with GA4 landing page sessions using the Pages and Screens report, segmented by Landing Page and date. Paid search traffic that arrived during the outage still hit your landing pages, just attributed incorrectly. The landing page session volume from GA4, combined with Google Ads click data for the same period, gives you a campaign-level picture even without source/medium attribution. Layer in attribution software if your stack includes tools that maintain click-log data independently of GA4.
Document the outage dates with GA4 Property Annotations (Admin > Property > Annotations, or via the Measurement Protocol). Every analyst who touches the account later needs to know that source/medium data for those weeks is unreliable before building a report or running a channel comparison. Multi-touch attribution models that include the outage period will produce distorted channel weights unless the annotation is visible in the analysis workflow.
Setting up automated alerts so it never happens again
GA4 custom alerts can fire when a threshold condition is met. Set an alert for sessions where Source contains "google" and Medium contains "cpc" dropping below your typical floor for any 24-hour window. The exact threshold depends on your client's normal traffic volume. A 40% single-day drop in google / cpc sessions with no corresponding drop in Google Ads spend is the alert condition.
For higher-spend paid search accounts, a 24-hour alert delay is the maximum acceptable lag before escalation. A tracking template error that runs undetected for 48 hours in a high-spend account costs more in attribution data quality than the 30 minutes it takes to set the alert up properly.
The weekly click reconciliation check described above, comparing Google Ads click volume against GA4 google / cpc sessions, remains the most reliable preventive measure because it requires no tool configuration beyond a spreadsheet and an Analytics property with Google Ads linked. Build it into your weekly account review as a standing agenda item, and the three-week attribution gaps stop happening.
Related blog posts
Frequently asked questions
What is a Google Ads tracking template?
A Google Ads tracking template is a URL field in account, campaign, or ad group settings that controls how each ad click is processed before reaching the landing page. It starts with the {lpurl} placeholder and appends UTM parameters and ValueTrack macros automatically to every click.
What is the difference between a tracking template and a final URL suffix?
A final URL suffix appends UTM parameters directly to your destination URL with no redirect. A tracking template is required when you need to route clicks through a third-party tracking system that uses a redirect before handing off to the landing page.
Which ValueTrack parameters work in Performance Max campaigns?
The parameters {campaignid}, {adgroupid}, {device}, {creative}, and {network} resolve correctly in Performance Max. The {keyword} and {matchtype} parameters return empty strings in Performance Max because PMax does not use keyword-level targeting.
How do I detect a broken tracking template in Google Ads?
Open GA4 and compare sessions attributed to google / cpc against total clicks reported in Google Ads for the same date range. A gap above 15% between those two numbers, with no corresponding drop in spend, indicates a tracking template failure.
Can I apply one tracking template across all my Google Ads client accounts?
Google Ads Manager Accounts (MCC) do not provide a shared tracking template field that pushes to all linked accounts. Agencies use the Google Ads API, Google Ads Scripts, or tools like Hellyeah's CLI to push a validated template programmatically across multiple client accounts simultaneously.

Engineering
Engineer at Hellyeah. Builds the runtime the marketing systems live in: pipelines, integrations, and the guardrails that keep them safe to ship.




