Google Ads UTM Parameters
Set up UTM parameters and tracking templates for your Google Ads campaigns so AnyTrack can attribute conversions to the right campaign, ad group, and keyword. Covers the recommended tracking template, required UTM parameters, ValueTrack macros, and common configuration mistakes.
UTM parameters tell AnyTrack where each click came from. Without them, conversions show up in your dashboard but lack the campaign, ad group, and keyword context you need to optimize. Setting up your Google Ads tracking template correctly takes five minutes and unlocks full attribution on Search and Display campaigns. Demand Gen fills fewer of these parameters — see Demand Gen Campaigns.
The Recommended Tracking Template
Section titled “The Recommended Tracking Template”Add this tracking template at the account level in Google Ads so it applies to every campaign automatically. Google fills all of its parameters on Search and Display campaigns; on Demand Gen it leaves three of them empty, which Demand Gen Campaigns explains.
{lpurl}?utm_source=google&utm_medium={ifsearch:cpc}{ifcontent:display}&utm_id={campaignid}&utm_content={adgroupid}&utm_term={keyword}&creativeId={creative}&adgroupid={adgroupid}&targetid={targetid}To set it at the account level:
- In Google Ads, go to Settings > Account Settings
- Expand the Tracking section
- Paste the tracking template into the Tracking template field
- Click Save
UTM Parameter Breakdown
Section titled “UTM Parameter Breakdown”Each parameter serves a specific purpose in your attribution chain:
| Parameter | Value | What It Tells AnyTrack |
|---|---|---|
utm_source | google | The traffic source is Google Ads |
utm_medium | {ifsearch:cpc}{ifcontent:display} | Dynamically sets cpc for Search campaigns or display for Display campaigns |
utm_id | {campaignid} | The numeric campaign ID (auto-filled by Google) |
utm_content | {adgroupid} | The ad group ID (auto-filled by Google) |
utm_term | {keyword} | The keyword that triggered the ad |
creativeId | {creative} | The specific ad creative ID |
adgroupid | {adgroupid} | The ad group ID (passed as a standalone parameter for reporting) |
targetid | {targetid} | The target keyword or audience ID that triggered the ad |
Google replaces the {curly brace} values automatically when someone clicks your ad. These are called ValueTrack parameters. The {ifsearch:} and {ifcontent:} macros are conditional — they output different values depending on whether the click came from a Search or Display campaign.
Useful ValueTrack Macros
Section titled “Useful ValueTrack Macros”Beyond the parameters in the recommended template, Google Ads offers additional ValueTrack macros you can use:
| Macro | Description | Example Output |
|---|---|---|
{campaignid} | Numeric campaign ID | 12345678 |
{adgroupid} | Numeric ad group ID | 98765432 |
{keyword} | Keyword that triggered the ad | running shoes |
{matchtype} | Keyword match type | b (broad), p (phrase), e (exact) |
{creative} | Ad creative ID | 11122233 |
{targetid} | Target keyword or audience ID | kwd-12345678 |
{device} | Device type | m (mobile), c (computer), t (tablet) |
{network} | Network type | g (Google Search), d (Display) |
{placement} | Display network placement | example.com |
{ifsearch:value} | Outputs value only for Search clicks | cpc |
{ifcontent:value} | Outputs value only for Display clicks | display |
Demand Gen Campaigns
Section titled “Demand Gen Campaigns”Google Ads does not fill every ValueTrack macro on every campaign type. On Demand Gen campaigns, Google does not support these macros:
{keyword}{ifsearch:value}{ifcontent:value}{targetid}{network}{placement}{target}
The recommended template still works on a Demand Gen campaign, but three of its parameters arrive empty:
| Parameter | Value on a Demand Gen click |
|---|---|
utm_medium={ifsearch:cpc}{ifcontent:display} | empty |
utm_term={keyword} | empty |
targetid={targetid} | empty |
utm_source, utm_id={campaignid}, utm_content={adgroupid} and creativeId={creative} still fill, so AnyTrack still attributes the click to the correct campaign and ad group. Only the medium and keyword context is lost.
To set the medium yourself on a Demand Gen campaign, add a campaign-level tracking template with a fixed value:
{lpurl}?utm_source=google&utm_medium=demandgen&utm_id={campaignid}&utm_content={adgroupid}&creativeId={creative}For the current list of supported macros per campaign type, see the Google Ads ValueTrack reference.
How AnyTrack Uses These Parameters
Section titled “How AnyTrack Uses These Parameters”When a visitor arrives on your landing page from a Google Ads click, AnyTrack reads the UTM parameters from the URL and stores them alongside the Click ID (atclid). When that visitor later converts, AnyTrack associates the conversion with the full campaign context.
This data flows into:
- Your Campaign Report in the AnyTrack dashboard
- Event attributes sent to your connected ad platforms
- Google Ads conversion tracking via the AnyTrack server-side integration
Common Mistakes
Section titled “Common Mistakes”Using campaign names instead of IDs. The {campaignid} macro returns a stable numeric ID. If you hardcode campaign names, they break when you rename campaigns and create messy data.
Overriding at multiple levels. If you set tracking templates at the account, campaign, and ad group level, only the most specific one applies — and it replaces the higher-level template, it does not add to it. A campaign-level template that omits your UTM parameters leaves that campaign with no campaign attribution, even when the account-level template is correct. Stick to account-level unless you have a specific reason to override.
Missing the question mark. The tracking template must include ? before the first parameter (or & if your landing page URL already has parameters). The {lpurl} macro inserts your final URL, and everything after it becomes the query string.
Forgetting to test. Use the “Test” button in Google Ads tracking settings to verify your template produces a valid URL before going live.
Google Ads UTM FAQ
FAQ was last reviewed on 2026-09-14
Which UTM parameters work on a Demand Gen campaign?
{keyword}, {ifsearch:}, {ifcontent:}, {targetid}, {network}, {placement} or {target} on Demand Gen campaigns. The recommended template still runs, but utm_medium, utm_term and targetid arrive empty. utm_source, utm_id, utm_content and creativeId still fill, so campaign and ad group attribution works. To set a medium, add a campaign-level template with a fixed utm_medium value. See Demand Gen Campaigns.