Google Ads UTM Setup
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 for every click.
Before you begin
- You have an active Google Ads account
- Your AnyTrack property is connected to Google Ads
- The AnyTrack Tracking Tag is installed on your landing pages
The Recommended Tracking Template
Add this tracking template at the account level in Google Ads so it applies to all campaigns automatically:
{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
NoteAccount-level tracking templates apply to all campaigns unless overridden at the campaign or ad group level. If you already have campaign-level templates, the campaign-level template takes priority.
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
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 |
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
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. 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.
WarningDo not add
gclidas a UTM parameter. Google Ads appendsgclidautomatically through auto-tagging. Adding it manually creates conflicts and can break conversion tracking.
Google Ads UTM FAQ
FAQ was last reviewed on 2026-03-15
Updated about 2 hours ago
