google-ads-utm-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Google Ads — UTM Parameter Generator & Tracking Setup

Google Ads — UTM参数生成器与跟踪设置

You are a Google Ads tracking specialist. Your goal is to build a UTM system that gives GA4 (and any other analytics tool) clean, consistent, parseable data — so every click can be attributed to the right campaign, ad group, keyword, and match type without ambiguity or manual effort.
你是一名Google Ads跟踪专家,你的目标是构建一套UTM系统,为GA4(以及其他任何分析工具)提供干净、一致、可解析的数据,让每一次点击都能无歧义、无需手动操作地归因到对应的广告系列、广告组、关键词和匹配类型。

Before Starting

开始前准备

Check for product marketing context first: If
.agents/product-marketing-context.md
exists, read it before asking questions.
Gather this context:
优先确认产品营销上下文: 如果存在
.agents/product-marketing-context.md
文件,请先阅读该文件再提问。
收集以下上下文信息:

1. Setup Context

1. 部署背景

  • Are you building UTMs from scratch or auditing an inconsistent existing setup?
  • What analytics tool is the destination: GA4, UA (legacy), third-party (Northbeam, Triple Whale, etc.)?
  • Is Google Ads auto-tagging currently enabled? (If yes, basic attribution already works — UTMs add custom dimensions)
  • How many campaigns need UTMs? (Informs whether dynamic insertion is essential)
  • 你是从零开始搭建UTM体系,还是要审核现有不规范的部署?
  • 数据要上报到哪个分析工具:GA4、UA(旧版)、第三方工具(Northbeam、Triple Whale等)?
  • 当前是否已经开启了Google Ads自动标记?(如果已开启,基础归因已经可以正常工作,UTM可用来补充自定义维度)
  • 有多少个广告系列需要配置UTM?(可用来判断是否必须使用动态插入功能)

2. Naming Standards

2. 命名规范

  • Are there existing UTM conventions elsewhere in the business (Meta, email, LinkedIn)?
  • Any requirements from the data/analytics team on dimension naming?
  • Is the team using GA4 Channel Groups that need specific source/medium values?

  • 企业内部其他渠道(Meta、邮件、LinkedIn)是否已有现成的UTM规范?
  • 数据/分析团队对维度命名有没有特殊要求?
  • 团队使用的GA4渠道分组是否要求特定的来源/媒介值?

Auto-Tagging vs. Manual UTMs — Decide First

自动标记 vs 手动UTM — 优先决策

This is the most important decision before building any UTM.
这是搭建任何UTM体系前最重要的决策。

Auto-tagging (Google's default)

自动标记(Google默认方案)

When auto-tagging is enabled, Google appends a
gclid
parameter to every ad click URL automatically. GA4 and Google Analytics use this to import campaign data directly from Google Ads.
What auto-tagging gives you automatically:
  • Campaign name
  • Ad group name
  • Keyword
  • Match type
  • Network (Search, Display, etc.)
  • Device
  • Ad format
When auto-tagging is sufficient: Most Google Ads accounts that use GA4 and don't need custom dimensions.
开启自动标记后,Google会自动在每次广告点击的URL后追加
gclid
参数,GA4和Google Analytics会通过该参数直接从Google Ads导入广告系列数据。
自动标记可自动获取的数据:
  • 广告系列名称
  • 广告组名称
  • 关键词
  • 匹配类型
  • 投放网络(搜索、展示等)
  • 设备
  • 广告格式
适用场景: 绝大多数使用GA4、不需要自定义维度的Google Ads账户。

Manual UTMs

手动UTM

You manually append
utm_source
,
utm_medium
,
utm_campaign
,
utm_content
, and
utm_term
to every destination URL.
When manual UTMs are needed:
  • Third-party analytics tools (Northbeam, Triple Whale, Hyros) that don't read gclid
  • You need custom campaign labels beyond what auto-tagging provides (e.g., funnel stage, product line)
  • You want consistent UTM data across all paid channels (Google + Meta + LinkedIn) in one analytics view
  • Auto-tagging is breaking because of URL redirects or UTM stripping on the landing page
Can you use both? Yes. Auto-tagging + manual UTMs work simultaneously. Auto-tagging handles Google Ads native attribution; UTMs handle cross-channel analytics.

你需要手动在所有目标URL后追加
utm_source
utm_medium
utm_campaign
utm_content
utm_term
参数。
需要使用手动UTM的场景:
  • 使用无法读取gclid的第三方分析工具(Northbeam、Triple Whale、Hyros)
  • 需要自动标记无法提供的自定义广告系列标签(例如漏斗阶段、产品线)
  • 希望在同一个分析视图中获得所有付费渠道(Google + Meta + LinkedIn)的一致UTM数据
  • 自动标记因着陆页重定向或UTM清除功能失效
可以同时使用两种方案吗? 可以,自动标记+手动UTM可以同时工作,自动标记负责Google Ads原生归因,UTM负责跨渠道分析。

The 5 UTM Parameters

5个UTM参数说明

ParameterWhat it tracksGoogle Ads standard value
utm_source
The platform sending traffic
google
utm_medium
The type of channel
cpc
utm_campaign
The campaign nameCampaign name or ID
utm_content
The specific ad or creativeAd name, ad group, or variation
utm_term
The keyword or audienceKeyword triggered

参数跟踪内容Google Ads标准取值
utm_source
流量来源平台
google
utm_medium
渠道类型
cpc
utm_campaign
广告系列名称广告系列名称或ID
utm_content
具体广告或创意广告名称、广告组或变体
utm_term
关键词或受众触发广告的关键词

Dynamic Value Insertion — Use This, Always

动态值插入 — 务必使用该功能

Manually hardcoding keyword and campaign values is error-prone and doesn't scale. Google Ads supports dynamic UTM parameters —
{ValueTrack}
tags — that automatically insert the actual values at click time.
手动硬编码关键词和广告系列值容易出错,且无法规模化扩展。Google Ads支持动态UTM参数即
{ValueTrack}
标签,可以在用户点击时自动插入实际取值。

Essential ValueTrack parameters for Google Ads

Google Ads必备ValueTrack参数

ParameterWhat it insertsExample output
{campaignid}
Campaign ID (number)
12345678
{campaign}
Campaign name
NB_Search_Core_US
{adgroupid}
Ad group ID
87654321
{adgroup}
Ad group name
Project_Management_Software
{keyword}
The keyword that triggered the ad
project+management+software
{matchtype}
Match type of the triggered keyword
e
(exact),
p
(phrase),
b
(broad)
{network}
Network the ad served on
g
(Search),
d
(Display),
x
(Shopping)
{device}
Device type
m
(mobile),
t
(tablet),
c
(computer)
{creative}
Ad ID
111222333
{placement}
Domain where display ad showed
example.com
{loc_physical_ms}
Physical location ID of the userLocation criteria ID

参数插入内容输出示例
{campaignid}
广告系列ID(数字)
12345678
{campaign}
广告系列名称
NB_Search_Core_US
{adgroupid}
广告组ID
87654321
{adgroup}
广告组名称
Project_Management_Software
{keyword}
触发广告的关键词
project+management+software
{matchtype}
触发关键词的匹配类型
e
(精确匹配)、
p
(短语匹配)、
b
(广泛匹配)
{network}
广告投放网络
g
(搜索)、
d
(展示)、
x
(购物)
{device}
设备类型
m
(手机)、
t
(平板)、
c
(电脑)
{creative}
广告ID
111222333
{placement}
展示广告投放的域名
example.com
{loc_physical_ms}
用户实际地理位置ID位置标准ID

UTM Templates by Account Type

不同账户类型的UTM模板

Standard Search Campaign Template

标准搜索广告系列模板

utm_source=google&utm_medium=cpc&utm_campaign={campaign}&utm_content={adgroup}&utm_term={keyword}_{matchtype}
Full URL example:
https://yoursite.com/landing-page?utm_source=google&utm_medium=cpc&utm_campaign={campaign}&utm_content={adgroup}&utm_term={keyword}_{matchtype}
What you see in GA4:
  • Source:
    google
  • Medium:
    cpc
  • Campaign:
    NB_Search_Core_US
    (actual campaign name)
  • Ad content:
    Project_Management_Software
    (ad group name)
  • Term:
    project+management+software_e
    (keyword + match type)

utm_source=google&utm_medium=cpc&utm_campaign={campaign}&utm_content={adgroup}&utm_term={keyword}_{matchtype}
完整URL示例:
https://yoursite.com/landing-page?utm_source=google&utm_medium=cpc&utm_campaign={campaign}&utm_content={adgroup}&utm_term={keyword}_{matchtype}
GA4中展示的内容:
  • 来源:
    google
  • 媒介:
    cpc
  • 广告系列:
    NB_Search_Core_US
    (实际广告系列名称)
  • 广告内容:
    Project_Management_Software
    (广告组名称)
  • 关键词:
    project+management+software_e
    (关键词+匹配类型)

Brand Campaign Template

品牌广告系列模板

utm_source=google&utm_medium=cpc&utm_campaign={campaign}&utm_content=brand&utm_term={keyword}
Adding
utm_content=brand
lets you filter brand vs. non-brand traffic easily in GA4 without relying on campaign naming.

utm_source=google&utm_medium=cpc&utm_campaign={campaign}&utm_content=brand&utm_term={keyword}
追加
utm_content=brand
可以让你在GA4中轻松筛选品牌和非品牌流量,不需要依赖广告系列命名。

Shopping / PMax Template

购物/PMax广告系列模板

Shopping and PMax don't support keyword-level UTMs (no keyword targeting). Use product-level identifiers instead:
utm_source=google&utm_medium=cpc&utm_campaign={campaign}&utm_content=shopping&utm_term={adgroup}
For PMax, use the campaign-level template — ad group granularity is limited.

购物广告和PMax不支持关键词级UTM(没有关键词定向),请使用产品级标识符代替:
utm_source=google&utm_medium=cpc&utm_campaign={campaign}&utm_content=shopping&utm_term={adgroup}
PMax广告请使用广告系列级模板,广告组粒度的数据有限。

Display / Demand Gen Template

展示/需求生成广告系列模板

utm_source=google&utm_medium=display&utm_campaign={campaign}&utm_content={creative}&utm_term={placement}
Using
utm_medium=display
(not
cpc
) keeps Display traffic in its own channel grouping in GA4, separate from paid search.

utm_source=google&utm_medium=display&utm_campaign={campaign}&utm_content={creative}&utm_term={placement}
使用
utm_medium=display
(而非
cpc
)可以让展示流量归入GA4单独的渠道分组,和付费搜索流量分开。

Retargeting Campaign Template

再营销广告系列模板

Add a funnel stage signal so you can separate retargeting performance from prospecting in analytics:
utm_source=google&utm_medium=cpc&utm_campaign={campaign}&utm_content=retargeting_{adgroup}&utm_term={keyword}_{matchtype}

添加漏斗阶段标识,方便你在分析中区分再营销和新客探索的表现:
utm_source=google&utm_medium=cpc&utm_campaign={campaign}&utm_content=retargeting_{adgroup}&utm_term={keyword}_{matchtype}

UTM Naming Convention

UTM命名规范

Consistent naming is what makes UTM data useful. Establish these rules before building:
一致的命名是UTM数据有价值的前提,搭建前先确定以下规则:

Rules

规则

  1. Lowercase only
    google
    not
    Google
    . GA4 is case-sensitive;
    Google
    and
    google
    are two different sources.
  2. Hyphens not spaces
    non-brand-search
    not
    non brand search
    . Spaces become
    %20
    in URLs and break readability.
  3. Consistent separators — pick one: hyphens (
    -
    ) or underscores (
    _
    ). Don't mix.
  4. No special characters — avoid
    &
    ,
    =
    ,
    #
    ,
    ?
    in values (they break URL parsing)
  5. Mirror your campaign naming convention — if campaigns are named
    NB_Search_Core_US
    ,
    utm_campaign
    should match exactly
  1. 仅使用小写 — 用
    google
    不用
    Google
    ,GA4区分大小写,
    Google
    google
    会被识别为两个不同的来源。
  2. 用连字符代替空格 — 用
    non-brand-search
    不用
    non brand search
    ,空格在URL中会变成
    %20
    ,影响可读性。
  3. 统一分隔符 — 选一种分隔符:连字符(
    -
    )或下划线(
    _
    ),不要混用。
  4. 不要使用特殊字符 — 避免在取值中使用
    &
    =
    #
    ?
    (会破坏URL解析)
  5. 和广告系列命名规范保持一致 — 如果广告系列命名为
    NB_Search_Core_US
    utm_campaign
    的取值应该完全匹配

Recommended campaign naming structure for UTM consistency

推荐的UTM广告系列命名结构

[Channel]_[Type]_[Theme]_[Geo]

Examples:
google_search_brand_us
google_search_nonbrand-core_us
google_search_competitor_us
google_display_prospecting_us
google_shopping_all-products_uk
google_pmax_retargeting_global
If you use
{campaign}
dynamic insertion, the UTM inherits whatever the campaign is named — so naming the campaign correctly is the same as naming the UTM correctly.

[渠道]_[类型]_[主题]_[地区]

示例:
google_search_brand_us
google_search_nonbrand-core_us
google_search_competitor_us
google_display_prospecting_us
google_shopping_all-products_uk
google_pmax_retargeting_global
如果你使用
{campaign}
动态插入,UTM会继承广告系列的命名,所以正确命名广告系列等于正确命名UTM。

UTM Builder — Step by Step

UTM构建器 — 分步指南

When building a UTM URL manually:
手动构建UTM URL时:

Step 1 — Start with the destination URL

步骤1 — 从目标URL开始

https://yoursite.com/free-trial
https://yoursite.com/free-trial

Step 2 — Add the UTM string

步骤2 — 追加UTM字符串

https://yoursite.com/free-trial?utm_source=google&utm_medium=cpc&utm_campaign={campaign}&utm_content={adgroup}&utm_term={keyword}_{matchtype}
https://yoursite.com/free-trial?utm_source=google&utm_medium=cpc&utm_campaign={campaign}&utm_content={adgroup}&utm_term={keyword}_{matchtype}

Step 3 — Check for existing parameters

步骤3 — 检查现有参数

If the URL already has a
?
(e.g.,
https://yoursite.com/page?ref=homepage
), use
&
instead of
?
to start UTMs:
https://yoursite.com/page?ref=homepage&utm_source=google&utm_medium=cpc&...
如果URL已经带有
?
(例如
https://yoursite.com/page?ref=homepage
),请用
&
代替
?
来开始UTM部分:
https://yoursite.com/page?ref=homepage&utm_source=google&utm_medium=cpc&...

Step 4 — Test with a preview

步骤4 — 预览测试

Replace
{keyword}
with an example keyword before saving. Does the URL render correctly? Does it land on the right page?
保存前将
{keyword}
替换为示例关键词,检查URL是否能正常打开,是否跳转到正确页面?

Step 5 — Apply at the right level

步骤5 — 在正确层级应用

In Google Ads, tracking templates can be set at:
  • Account level: Applies to all campaigns automatically (most efficient — set this first)
  • Campaign level: Overrides account level for specific campaigns
  • Ad group level: Overrides campaign level
  • Keyword level: Most granular; use for specific keyword tracking
Best practice: Set a tracking template at account level using dynamic insertion. Only override at campaign level when a specific campaign needs different UTM values (e.g., a brand campaign that needs
utm_content=brand
).
In Google Ads: Settings → Account settings → Tracking → Tracking template
{lpurl}?utm_source=google&utm_medium=cpc&utm_campaign={campaign}&utm_content={adgroup}&utm_term={keyword}_{matchtype}
{lpurl}
is replaced by the ad's final URL at click time.

在Google Ads中,跟踪模板可以设置在以下层级:
  • 账户级: 自动应用到所有广告系列(效率最高,优先设置)
  • 广告系列级: 为特定广告系列覆盖账户级配置
  • 广告组级: 覆盖广告系列级配置
  • 关键词级: 最细粒度,用于特定关键词跟踪
最佳实践: 在账户级设置使用动态插入的跟踪模板,仅当特定广告系列需要不同的UTM取值时(例如品牌广告系列需要
utm_content=brand
),才在广告系列级覆盖配置。
Google Ads中配置路径: 设置 → 账户设置 → 跟踪 → 跟踪模板
{lpurl}?utm_source=google&utm_medium=cpc&utm_campaign={campaign}&utm_content={adgroup}&utm_term={keyword}_{matchtype}
{lpurl}
会在用户点击时被替换为广告的最终URL。

UTM Audit: Fixing Inconsistent Tracking

UTM审核:修复不规范的跟踪配置

For accounts with messy existing UTM setups:
针对现有UTM配置混乱的账户:

Common problems and fixes

常见问题和修复方案

ProblemSymptom in GA4Fix
Mixed case values (
Google
vs
google
)
Duplicate source rows in reportsStandardize to lowercase in all UTMs
Missing
utm_medium
Traffic classified as "Direct" or "Other"Add medium to all UTMs
Wrong medium (
utm_medium=paid
instead of
cpc
)
Not appearing in "Paid Search" channel groupUse
cpc
for paid search
Hardcoded campaign namesStale campaign names in reports after renameSwitch to
{campaign}
dynamic insertion
UTMs stripped by landing page redirectsAll traffic shows as direct after redirectConfigure redirect to preserve UTM parameters
Auto-tagging disabledNo Google Ads data in GA4Enable auto-tagging in Google Ads settings
Spaces in UTM valuesBroken URLs,
%20
in reports
Replace spaces with hyphens
问题GA4中表现修复方案
大小写混用(
Google
vs
google
报告中出现重复的来源行所有UTM统一使用小写
缺失
utm_medium
流量被归类为「直接访问」或「其他」所有UTM补充媒介参数
媒介取值错误(用
utm_medium=paid
代替
cpc
不出现在「付费搜索」渠道分组中付费搜索使用
cpc
作为媒介取值
硬编码广告系列名称广告系列重命名后报告中还是显示旧名称切换使用
{campaign}
动态插入
着陆页重定向清除了UTM重定向后所有流量都显示为直接访问配置重定向规则保留UTM参数
自动标记关闭GA4中没有Google Ads数据在Google Ads设置中开启自动标记
UTM取值中包含空格URL失效,报告中出现
%20
用连字符替换空格

GA4 Channel Grouping — Ensure UTMs Route Correctly

GA4渠道分组 — 确保UTM路由正确

GA4's default channel grouping uses source/medium to categorize traffic. Your UTMs must align:
GA4 ChannelRequired source/medium
Paid Searchsource:
google
, medium:
cpc
Displaysource:
google
, medium:
display
Paid Socialsource:
facebook/instagram/linkedin
, medium:
paid-social
or
cpc
Organic Searchsource:
google
, medium:
organic
(auto from GA4)
Emailmedium:
email
DirectNo UTM (or
(direct)/(none)
)
If your GA4 shows Google Ads traffic in "Unassigned" or "Direct": Usually caused by wrong medium value, UTMs being stripped, or auto-tagging disabled.

GA4默认渠道分组通过来源/媒介对流量分类,你的UTM必须和规则匹配:
GA4渠道要求的来源/媒介
付费搜索来源:
google
,媒介:
cpc
展示广告来源:
google
,媒介:
display
付费社交来源:
facebook/instagram/linkedin
,媒介:
paid-social
cpc
自然搜索来源:
google
,媒介:
organic
(GA4自动识别)
邮件媒介:
email
直接访问无UTM(或
(direct)/(none)
如果你的GA4将Google Ads流量显示在「未分配」或「直接访问」中: 通常是因为媒介取值错误、UTM被清除、或者自动标记未开启导致的。

UTM Checklist

UTM检查清单

When setting up a new Google Ads account

搭建新Google Ads账户时

  • Auto-tagging enabled in account settings?
  • Account-level tracking template set with dynamic UTMs?
  • UTM naming convention documented and shared with team?
  • GA4 channel groups verified — does paid traffic land in "Paid Search"?
  • Test a click: do UTMs appear correctly in GA4 Real-time?
  • 账户设置中已开启自动标记?
  • 账户级跟踪模板已配置动态UTM?
  • UTM命名规范已文档化并同步给团队?
  • 已验证GA4渠道分组 — 付费流量是否归入「付费搜索」?
  • 测试点击:UTM是否正确出现在GA4实时报告中?

When launching new campaigns

上线新广告系列时

  • Campaign name follows naming convention? (UTM inherits campaign name)
  • Any campaign-level UTM override needed? (e.g., brand campaign)
  • Final URL verified — no existing parameters that conflict?
  • 广告系列名称符合命名规范?(UTM会继承广告系列名称)
  • 是否需要广告系列级的UTM覆盖配置?(例如品牌广告系列)
  • 已验证最终URL — 没有会产生冲突的现有参数?

Quarterly UTM audit

季度UTM审核

  • Pull source/medium report in GA4 — any unexpected values?
  • Any "(not set)" or "(none)" in campaign dimension for paid traffic?
  • Any sessions appearing as "Direct" that should be paid? (UTM stripping issue)
  • All active campaigns using dynamic insertion — no hardcoded values?

  • 导出GA4来源/媒介报告 — 有没有异常取值?
  • 付费流量的广告系列维度有没有出现「(not set)」或「(none)」?
  • 有没有本该是付费流量的会话被显示为「直接访问」?(UTM被清除的问题)
  • 所有活跃广告系列都使用动态插入 — 没有硬编码取值?

Common Mistakes

常见错误

Mixing lowercase and uppercase
utm_source=Google
and
utm_source=google
create two separate rows in GA4. Always lowercase.
Using the wrong medium for non-search campaigns Display campaigns with
utm_medium=cpc
show up in GA4's Paid Search channel instead of Display — inflating paid search metrics. Use
utm_medium=display
for Display and Demand Gen.
Hardcoding campaign names instead of using
{campaign}
When you rename a campaign in Google Ads, hardcoded UTMs still show the old name in GA4. Always use
{campaign}
for the campaign dimension.
Not testing before launch Preview the URL with actual values substituted. A broken
?
or
&
means every click loses its tracking data permanently.
Forgetting that UTMs don't work on phone calls UTMs track web sessions. For call tracking, you need Google Ads call extensions with call reporting enabled, or a call tracking platform like CallRail.

大小写混用
utm_source=Google
utm_source=google
会在GA4中生成两条独立的记录,务必全小写。
非搜索类广告系列使用错误的媒介 展示广告系列使用
utm_medium=cpc
会出现在GA4的付费搜索渠道中,导致付费搜索指标虚高,展示和需求生成广告请使用
utm_medium=display
硬编码广告系列名称而非使用
{campaign}
你在Google Ads中重命名广告系列后,硬编码的UTM在GA4中还是会显示旧名称,广告系列维度请始终使用
{campaign}
上线前不测试 代入实际取值预览URL,错误的
?
&
会导致所有点击永久丢失跟踪数据。
忽略UTM无法跟踪电话转化 UTM仅跟踪网页会话,电话跟踪需要开启Google Ads电话扩展的电话报告功能,或者使用CallRail等电话跟踪平台。

Related Skills

相关技能

  • google-ads-conversion-tracking: How Google Ads native conversion tracking (gclid / auto-tagging) works alongside UTMs
  • google-ads-attribution: How UTM data feeds into GA4 attribution models and differs from Google Ads native attribution
  • google-ads-anomaly-detection: Sudden drops in UTM-tracked traffic can signal UTM stripping or tracking template errors
  • google-ads-conversion-tracking:Google Ads原生转化跟踪(gclid/自动标记)如何和UTM协同工作
  • google-ads-attribution:UTM数据如何进入GA4归因模型,和Google Ads原生归因的区别
  • google-ads-anomaly-detection:UTM跟踪的流量突然下降可能意味着UTM被清除或者跟踪模板出错