Skip to content

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.

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:

  1. In Google Ads, go to Settings > Account Settings
  2. Expand the Tracking section
  3. Paste the tracking template into the Tracking template field
  4. Click Save

Each parameter serves a specific purpose in your attribution chain:

ParameterValueWhat It Tells AnyTrack
utm_sourcegoogleThe 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.

Beyond the parameters in the recommended template, Google Ads offers additional ValueTrack macros you can use:

MacroDescriptionExample Output
{campaignid}Numeric campaign ID12345678
{adgroupid}Numeric ad group ID98765432
{keyword}Keyword that triggered the adrunning shoes
{matchtype}Keyword match typeb (broad), p (phrase), e (exact)
{creative}Ad creative ID11122233
{targetid}Target keyword or audience IDkwd-12345678
{device}Device typem (mobile), c (computer), t (tablet)
{network}Network typeg (Google Search), d (Display)
{placement}Display network placementexample.com
{ifsearch:value}Outputs value only for Search clickscpc
{ifcontent:value}Outputs value only for Display clicksdisplay

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:

ParameterValue 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.

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

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?
Google does not support {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.
Do I need UTM parameters if Google auto-tagging is enabled?
Yes. Auto-tagging (gclid) handles Google-to-Google attribution, but AnyTrack reads UTM parameters to attribute conversions across all your platforms, including Facebook, TikTok, and your affiliate networks. Use both for complete coverage.
Can I use custom UTM parameters with AnyTrack?
AnyTrack reads all standard UTM parameters (source, medium, campaign, content, term) automatically. For custom parameters beyond these five, see Custom UTM Parameters.
Will changing my tracking template affect existing campaign data?
No. Tracking template changes apply to future clicks only. Historical conversion data in AnyTrack and Google Ads remains unchanged.
What is the difference between search terms and search keywords in Google Ads?
A search keyword is the term you bid on in your Google Ads campaign. A search term is the actual query a user typed into Google that triggered your ad. For example, you might bid on the keyword 'running shoes' (broad match), but the user searched 'best running shoes for flat feet'. The keyword appears in your UTM via the {keyword} macro, while search terms are available in your Google Ads Search Terms report.