utm-link-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

UTM Link Generator

UTM链接生成器

A disciplined UTM link generation system that enforces consistent naming conventions across all campaigns, maintains a registry to prevent duplicates and naming drift, and outputs platform-ready links. This is not a simple URL concatenator -- it is a naming governance system for marketing attribution.
这是一套规范化的UTM链接生成系统,可在所有推广活动中强制统一命名规范,维护注册表以避免重复和命名偏差,并输出适配各平台的链接。它并非简单的URL拼接工具——而是一套用于营销归因的命名治理系统。

Why This Exists

设计初衷

UTM chaos is the number one cause of broken marketing attribution. When team members use "linkedin" vs "LinkedIn" vs "linked-in" vs "li" as a source, your analytics become useless. This skill enforces a single source of truth: the UTM registry.
UTM命名混乱是导致营销归因失效的首要原因。当团队成员分别使用"linkedin"、"LinkedIn"、"linked-in"或"li"作为来源标识时,你的分析数据将变得毫无用处。本工具通过UTM注册表确保单一事实来源。

Capabilities

核心功能

  1. Generate UTM-tagged URLs with validated, consistent parameters
  2. Maintain a utm-registry.json file that tracks all generated links and enforces naming conventions
  3. Prevent duplicates -- warns when a similar link already exists in the registry
  4. Platform-specific formatting -- outputs links optimized for LinkedIn, email, social, and ad platforms
  5. Bulk generation -- create multiple variants for A/B testing or multi-channel campaigns
  6. Validation -- rejects malformed URLs, empty parameters, and convention violations
  7. Reporting -- generates campaign tracking summaries from the registry
  1. 生成带UTM标签的URL:使用经过验证的统一参数
  2. 维护utm-registry.json文件:追踪所有生成的链接并强制命名规范
  3. 避免重复:当注册表中已存在相似链接时发出警告
  4. 平台专属格式:生成适配LinkedIn、邮件、社交平台及广告平台的优化链接
  5. 批量生成:为A/B测试或多渠道推广活动创建多种变体链接
  6. 参数验证:拒绝格式错误的URL、空参数及违反规范的内容
  7. 报告生成:基于注册表生成推广活动追踪汇总

UTM Parameter Reference

UTM参数参考

ParameterRequiredPurposeExample
utm_source
YesWhere the traffic comes from
linkedin
,
google
,
newsletter
utm_medium
YesMarketing medium
cpc
,
email
,
social
,
organic
utm_campaign
YesCampaign identifier
q1-2026-product-launch
utm_term
NoPaid keyword (search ads)
project-management-software
utm_content
NoDifferentiates similar links
hero-cta
,
sidebar-banner
,
variant-a
utm_id
NoCampaign ID for GA4
camp-2026-q1-001
参数是否必填用途示例
utm_source
流量来源
linkedin
,
google
,
newsletter
utm_medium
营销渠道类型
cpc
,
email
,
social
,
organic
utm_campaign
推广活动标识
q1-2026-product-launch
utm_term
付费关键词(搜索广告)
project-management-software
utm_content
区分相似链接
hero-cta
,
sidebar-banner
,
variant-a
utm_id
GA4推广活动ID
camp-2026-q1-001

Naming Conventions (Enforced)

强制命名规范

These conventions are non-negotiable. The skill will reject or auto-correct any violations.
以下规范为硬性要求,工具将拒绝或自动修正任何违规内容。

General Rules

通用规则

  1. All lowercase -- Never
    LinkedIn
    , always
    linkedin
  2. Hyphens for spaces -- Never
    product launch
    , always
    product-launch
  3. No special characters -- Only alphanumeric and hyphens
  4. No trailing/leading hyphens -- Never
    -campaign-name-
  5. No double hyphens -- Never
    my--campaign
  6. Maximum length: 50 characters per parameter value
  7. Date format in campaigns:
    q[N]-[YYYY]
    or
    [YYYY]-[MM]
    prefix
  1. 全小写:禁止使用
    LinkedIn
    ,必须用
    linkedin
  2. 用连字符代替空格:禁止使用
    product launch
    ,必须用
    product-launch
  3. 无特殊字符:仅允许字母数字和连字符
  4. 无首尾连字符:禁止使用
    -campaign-name-
  5. 无双连字符:禁止使用
    my--campaign
  6. 最大长度:每个参数值最多50个字符
  7. 推广活动中的日期格式:前缀为
    q[N]-[YYYY]
    [YYYY]-[MM]

Source Values (Canonical List)

来源值标准列表

Only these source values are allowed. Any new source must be explicitly added to the registry.
Canonical SourceAliases (auto-corrected)Platform
google
goog
,
google-ads
,
adwords
Google Ads / Organic
linkedin
li
,
linked-in
,
linkedin-ads
LinkedIn
facebook
fb
,
meta
,
facebook-ads
Facebook / Meta
instagram
ig
,
insta
Instagram
twitter
x
,
x-com
,
tw
X (Twitter)
youtube
yt
,
you-tube
YouTube
tiktok
tt
,
tik-tok
TikTok
reddit
rd
Reddit
email
mail
,
e-mail
,
em
Email campaigns
newsletter
nl
,
news-letter
Newsletter specifically
bing
microsoft-ads
,
msn
Bing / Microsoft
direct
none
,
(direct)
Direct traffic
referral
ref
,
partner
Referral traffic
podcast
pod
,
spotify
Podcast channels
slack
sl
Slack communities
producthunt
ph
,
product-hunt
Product Hunt
hackernews
hn
,
hacker-news
Hacker News
仅允许使用以下来源值,新增来源需明确添加到注册表中。
标准来源别名(自动修正)平台
google
goog
,
google-ads
,
adwords
Google Ads / 自然搜索
linkedin
li
,
linked-in
,
linkedin-ads
LinkedIn
facebook
fb
,
meta
,
facebook-ads
Facebook / Meta
instagram
ig
,
insta
Instagram
twitter
x
,
x-com
,
tw
X (Twitter)
youtube
yt
,
you-tube
YouTube
tiktok
tt
,
tik-tok
TikTok
reddit
rd
Reddit
email
mail
,
e-mail
,
em
邮件推广活动
newsletter
nl
,
news-letter
专项通讯
bing
microsoft-ads
,
msn
Bing / Microsoft
direct
none
,
(direct)
直接流量
referral
ref
,
partner
引荐流量
podcast
pod
,
spotify
播客渠道
slack
sl
Slack社区
producthunt
ph
,
product-hunt
Product Hunt
hackernews
hn
,
hacker-news
Hacker News

Medium Values (Canonical List)

渠道类型标准列表

Canonical MediumAliases (auto-corrected)Use Case
cpc
ppc
,
paid-click
,
cost-per-click
Paid search / paid social clicks
cpm
display
,
paid-impression
Display / impression campaigns
email
e-mail
,
mail
Email campaigns
social
social-media
,
organic-social
Organic social posts
organic
seo
,
organic-search
Organic search traffic
referral
ref
,
partner
,
affiliate
Referral / partner links
video
vid
,
youtube
,
pre-roll
Video ad placements
retargeting
remarketing
,
retarget
Retargeting campaigns
content
blog
,
article
,
content-syndication
Content marketing
webinar
web
,
event
,
virtual-event
Webinar / event registrations
podcast
pod
,
audio
Podcast mentions / ads
sms
text
,
mms
SMS / text campaigns
qr
qr-code
,
print
QR code / print materials
push
push-notification
,
notification
Push notifications
标准渠道类型别名(自动修正)使用场景
cpc
ppc
,
paid-click
,
cost-per-click
付费搜索 / 付费社交点击
cpm
display
,
paid-impression
展示广告 / 曝光类推广活动
email
e-mail
,
mail
邮件推广活动
social
social-media
,
organic-social
自然社交帖子
organic
seo
,
organic-search
自然搜索流量
referral
ref
,
partner
,
affiliate
引荐 / 合作伙伴链接
video
vid
,
youtube
,
pre-roll
视频广告位
retargeting
remarketing
,
retarget
再营销推广活动
content
blog
,
article
,
content-syndication
内容营销
webinar
web
,
event
,
virtual-event
线上研讨会 / 活动注册
podcast
pod
,
audio
播客提及 / 广告
sms
text
,
mms
SMS / 短信推广活动
qr
qr-code
,
print
二维码 / 印刷物料
push
push-notification
,
notification
推送通知

Campaign Naming Pattern

推广活动命名格式

Campaigns follow this structure:
[quarter-or-month]-[year]-[campaign-name]-[optional-variant]
Examples:
  • q1-2026-product-launch
  • 2026-03-spring-webinar
  • q2-2026-brand-awareness-linkedin
  • evergreen-demo-request
    (for always-on campaigns, skip the date prefix)
推广活动需遵循以下结构:
[季度或月份]-[年份]-[推广活动名称]-[可选变体]
示例:
  • q1-2026-product-launch
  • 2026-03-spring-webinar
  • q2-2026-brand-awareness-linkedin
  • evergreen-demo-request
    (长期推广活动可省略日期前缀)

Execution Protocol

执行流程

Step 1: Accept Input

步骤1:接收输入

The user provides some or all of these:
  • Destination URL (required) -- The page they want to link to
  • Source (required) -- Where the traffic comes from
  • Medium (required) -- The marketing channel type
  • Campaign (required) -- Campaign name
  • Term (optional) -- Keyword for paid search
  • Content (optional) -- Link differentiator
  • Platforms (optional) -- Which platforms to generate links for (default: all relevant)
If the user provides a brief like "I need links for our Q1 product launch campaign on LinkedIn and email pointing to our pricing page," extract the parameters from natural language.
用户需提供以下部分或全部信息:
  • 目标URL(必填):链接指向的页面
  • 来源(必填):流量来源
  • 渠道类型(必填):营销渠道类型
  • 推广活动(必填):推广活动名称
  • 关键词(可选):付费搜索关键词
  • 内容标识(可选):区分相似链接
  • 平台(可选):需要生成链接的平台(默认:所有相关平台)
如果用户提供自然语言描述,例如“我需要为Q1产品发布活动生成指向定价页的LinkedIn和邮件链接”,需从中提取对应参数。

Step 2: Validate and Normalize

步骤2:验证与标准化

For each parameter:
  1. Convert to lowercase --
    LinkedIn
    becomes
    linkedin
  2. Replace spaces with hyphens --
    product launch
    becomes
    product-launch
  3. Strip special characters -- Remove anything not
    [a-z0-9-]
  4. Check against canonical lists -- Auto-correct known aliases (e.g.,
    fb
    to
    facebook
    )
  5. Reject unknown values -- If a source or medium is not in the canonical list and is not a reasonable addition, warn the user and suggest the closest match
  6. Validate URL -- Ensure the destination URL is well-formed (has protocol, valid domain)
  7. Check length -- Ensure no parameter exceeds 50 characters
Report any corrections made:
undefined
对每个参数执行以下操作:
  1. 转换为小写
    LinkedIn
    转为
    linkedin
  2. 用连字符替换空格
    product launch
    转为
    product-launch
  3. 移除特殊字符:删除所有非
    [a-z0-9-]
    的字符
  4. 对照标准列表:自动修正已知别名(例如
    fb
    转为
    facebook
  5. 拒绝未知值:如果来源或渠道类型不在标准列表中且并非合理新增项,需向用户发出警告并推荐最接近的匹配项
  6. 验证URL:确保目标URL格式正确(包含协议、有效域名)
  7. 检查长度:确保所有参数不超过50个字符
报告所有修正内容:
undefined

Parameter Validation

参数验证结果

  • Source: "LinkedIn" -> "linkedin" (normalized to lowercase)
  • Medium: "paid" -> "cpc" (corrected to canonical value)
  • Campaign: "Q1 Product Launch!" -> "q1-product-launch" (normalized)
  • URL: https://example.com/pricing -- Valid
undefined
  • 来源:"LinkedIn" -> "linkedin"(标准化为小写)
  • 渠道类型:"paid" -> "cpc"(修正为标准值)
  • 推广活动:"Q1 Product Launch!" -> "q1-product-launch"(标准化)
  • URL:https://example.com/pricing -- 有效
undefined

Step 3: Check Registry for Duplicates

步骤3:检查注册表重复项

Read the utm-registry.json file (or create it if it does not exist). Check for:
  1. Exact duplicates -- Same URL + same parameters. Warn and return the existing link.
  2. Near duplicates -- Same URL + same campaign + different content/medium. Warn but allow (this is often intentional for multi-channel tracking).
  3. Naming conflicts -- Same campaign name but different capitalization or hyphenation. Block and show the existing convention.
读取utm-registry.json文件(若不存在则创建),检查以下内容:
  1. 完全重复:相同URL + 相同参数。发出警告并返回已存在的链接。
  2. 近似重复:相同URL + 相同推广活动 + 不同内容/渠道类型。发出警告但允许生成(这通常是多渠道追踪的有意操作)。
  3. 命名冲突:相同推广活动名称但大小写或连字符使用不同。阻止生成并展示现有规范。

Step 4: Generate Links

步骤4:生成链接

Build the UTM-tagged URL:
{base_url}?utm_source={source}&utm_medium={medium}&utm_campaign={campaign}[&utm_term={term}][&utm_content={content}][&utm_id={id}]
Rules:
  • If the base URL already has query parameters, append with
    &
    not
    ?
  • URL-encode any parameter values that contain special characters
  • Preserve the base URL's existing query parameters and fragment
构建带UTM标签的URL:
{base_url}?utm_source={source}&utm_medium={medium}&utm_campaign={campaign}[&utm_term={term}][&utm_content={content}][&utm_id={id}]
规则:
  • 如果基础URL已包含查询参数,使用
    &
    而非
    ?
    进行追加
  • 对包含特殊字符的参数值进行URL编码
  • 保留基础URL原有的查询参数和片段

Step 5: Generate Platform-Specific Variants

步骤5:生成平台专属变体

For each platform requested, generate an optimized link:
为每个请求的平台生成优化链接:

LinkedIn

LinkedIn

undefined
undefined

LinkedIn

LinkedIn

Email

邮件

undefined
undefined

Email

邮件

Social (General)

社交平台(通用)

undefined
undefined

Social

社交平台

Ads (Paid)

广告(付费)

undefined
undefined

Paid Ads

付费广告

Step 6: Update Registry

步骤6:更新注册表

Append all generated links to utm-registry.json:
json
{
  "version": "1.0",
  "lastUpdated": "2026-04-10T12:00:00Z",
  "namingConventions": {
    "sources": ["google", "linkedin", "facebook", "instagram", "twitter", "email", "newsletter"],
    "mediums": ["cpc", "cpm", "email", "social", "organic", "referral", "video", "retargeting"]
  },
  "campaigns": [
    {
      "name": "q1-2026-product-launch",
      "createdAt": "2026-04-10T12:00:00Z",
      "description": "Q1 2026 product launch campaign",
      "links": [
        {
          "id": "utm-001",
          "url": "https://example.com/pricing?utm_source=linkedin&utm_medium=social&utm_campaign=q1-2026-product-launch&utm_content=organic-post",
          "source": "linkedin",
          "medium": "social",
          "campaign": "q1-2026-product-launch",
          "content": "organic-post",
          "platform": "linkedin",
          "variant": "organic-post",
          "createdAt": "2026-04-10T12:00:00Z",
          "status": "active"
        }
      ]
    }
  ],
  "stats": {
    "totalLinks": 1,
    "totalCampaigns": 1,
    "sourcesUsed": ["linkedin"],
    "mediumsUsed": ["social"]
  }
}
将所有生成的链接追加到utm-registry.json中:
json
{
  "version": "1.0",
  "lastUpdated": "2026-04-10T12:00:00Z",
  "namingConventions": {
    "sources": ["google", "linkedin", "facebook", "instagram", "twitter", "email", "newsletter"],
    "mediums": ["cpc", "cpm", "email", "social", "organic", "referral", "video", "retargeting"]
  },
  "campaigns": [
    {
      "name": "q1-2026-product-launch",
      "createdAt": "2026-04-10T12:00:00Z",
      "description": "Q1 2026 product launch campaign",
      "links": [
        {
          "id": "utm-001",
          "url": "https://example.com/pricing?utm_source=linkedin&utm_medium=social&utm_campaign=q1-2026-product-launch&utm_content=organic-post",
          "source": "linkedin",
          "medium": "social",
          "campaign": "q1-2026-product-launch",
          "content": "organic-post",
          "platform": "linkedin",
          "variant": "organic-post",
          "createdAt": "2026-04-10T12:00:00Z",
          "status": "active"
        }
      ]
    }
  ],
  "stats": {
    "totalLinks": 1,
    "totalCampaigns": 1,
    "sourcesUsed": ["linkedin"],
    "mediumsUsed": ["social"]
  }
}

Step 7: Output Summary

步骤7:输出汇总

Present the final output in a clean, copy-paste-ready format:
undefined
以清晰、可直接复制的格式呈现最终结果:
undefined

UTM Links Generated

生成的UTM链接

Campaign: q1-2026-product-launch Destination: https://example.com/pricing Generated: 2026-04-10
推广活动:q1-2026-product-launch 目标页面https://example.com/pricing 生成时间:2026-04-10

Ready-to-Copy Links

可直接复制的链接

PlatformVariantLink
LinkedIn (organic)organic-post[full URL]
LinkedIn (paid)sponsored-post[full URL]
Email (primary CTA)primary-cta[full URL]
Email (secondary CTA)secondary-cta[full URL]
Twitterdefault[full URL]
Facebookdefault[full URL]
平台变体链接
LinkedIn(自然)organic-post[完整URL]
LinkedIn(付费)sponsored-post[完整URL]
邮件(主要CTA)primary-cta[完整URL]
邮件(次要CTA)secondary-cta[完整URL]
Twitter默认[完整URL]
Facebook默认[完整URL]

Registry Updated

注册表已更新

  • New links added: 6
  • Total links in registry: 6
  • Registry file: ./utm-registry.json
  • 新增链接:6条
  • 注册表总链接数:6条
  • 注册表文件:./utm-registry.json

Validation Report

验证报告

  • All parameters normalized to convention
  • No duplicate links found
  • No naming conflicts detected
undefined
  • 所有参数已标准化为规范格式
  • 未发现重复链接
  • 未检测到命名冲突
undefined

Bulk Generation Mode

批量生成模式

For generating links across many campaigns or many URLs at once.
用于一次性为多个推广活动或多个URL生成链接。

Input Format (Bulk)

批量输入格式

The user can provide a table or list:
Generate UTM links for these pages:
- /pricing -- linkedin, email, twitter -- q1-2026-product-launch
- /demo -- linkedin, google-ads -- q1-2026-demo-push
- /case-studies -- email, linkedin -- q1-2026-social-proof
用户可提供表格或列表:
为以下页面生成UTM链接:
- /pricing -- linkedin, email, twitter -- q1-2026-product-launch
- /demo -- linkedin, google-ads -- q1-2026-demo-push
- /case-studies -- email, linkedin -- q1-2026-social-proof

Processing

处理流程

  1. Parse each line into (URL, platforms, campaign)
  2. Validate and normalize all parameters
  3. Generate all variant links for each URL/platform combination
  4. Deduplicate across the batch
  5. Update registry with all new links
  6. Output a master table
  1. 将每一行解析为(URL, 平台, 推广活动)
  2. 验证并标准化所有参数
  3. 为每个URL/平台组合生成所有变体链接
  4. 在批量中去重
  5. 将所有新链接更新到注册表
  6. 输出汇总表格

Output Format (Bulk)

批量输出格式

undefined
undefined

Bulk UTM Generation -- 3 campaigns, 8 platform variants, 24 total links

批量UTM生成结果 -- 3个推广活动,8个平台变体,共24条链接

CampaignURLPlatformVariantFull Link
q1-2026-product-launch/pricinglinkedin-organicorganic-post[URL]
q1-2026-product-launch/pricinglinkedin-paidsponsored-post[URL]
q1-2026-product-launch/pricingemailprimary-cta[URL]
...............
Registry updated: 24 new links added.
undefined
推广活动URL平台变体完整链接
q1-2026-product-launch/pricinglinkedin-organicorganic-post[URL]
q1-2026-product-launch/pricinglinkedin-paidsponsored-post[URL]
q1-2026-product-launch/pricingemailprimary-cta[URL]
...............
注册表已更新:新增24条链接。
undefined

Registry Management Commands

注册表管理命令

The user can also invoke this skill for registry operations:
用户也可调用本工具执行注册表操作:

Audit Registry

审计注册表

"Audit my UTM registry"
Reads utm-registry.json and reports:
  • Total campaigns and links
  • Naming convention violations (if any crept in manually)
  • Stale campaigns (older than 6 months with no new links)
  • Unused sources or mediums
  • Duplicate or near-duplicate links
"审计我的UTM注册表"
读取utm-registry.json并生成报告:
  • 推广活动和链接总数
  • 命名规范违规情况(若有手动修改导致的违规)
  • 过期推广活动(6个月以上无新增链接)
  • 未使用的来源或渠道类型
  • 重复或近似重复链接

Add Custom Source/Medium

添加自定义来源/渠道类型

"Add 'partnerstack' as a UTM source"
Adds the new value to the canonical list in the registry and documents it.
"添加'partnerstack'作为UTM来源"
将新值添加到注册表的标准列表中并记录。

Campaign Report

推广活动报告

"Show me all links for the q1-2026-product-launch campaign"
Filters the registry and displays all links for that campaign, grouped by platform.
"展示q1-2026-product-launch推广活动的所有链接"
筛选注册表并按平台分组展示该推广活动的所有链接。

Export for Google Sheets

导出到Google Sheets

"Export my UTM registry as CSV"
Generates a CSV file with columns: Campaign, URL, Source, Medium, Content, Term, Full Link, Created Date, Status.
"将我的UTM注册表导出为CSV"
生成CSV文件,包含列:推广活动、URL、来源、渠道类型、内容标识、关键词、完整链接、创建日期、状态。

Error Handling

错误处理

ErrorResponse
Invalid URL (no protocol)Auto-prepend
https://
and warn
Unknown sourceSuggest closest canonical match, ask for confirmation
Unknown mediumSuggest closest canonical match, ask for confirmation
Campaign name too longSuggest abbreviated version
Duplicate link existsShow existing link, ask if user wants to create anyway
Registry file missingCreate new registry with default conventions
Registry file corruptedAttempt to parse what exists, back up, create fresh
Base URL has existing UTMsStrip existing UTM params, warn user, apply new ones
错误响应
无效URL(无协议)自动添加
https://
并发出警告
未知来源推荐最接近的标准匹配项,请求用户确认
未知渠道类型推荐最接近的标准匹配项,请求用户确认
推广活动名称过长推荐缩写版本
已存在重复链接展示现有链接,询问用户是否仍要生成
注册表文件缺失使用默认规范创建新注册表
注册表文件损坏尝试解析可读取内容,备份后创建新注册表
基础URL已包含UTM参数移除现有UTM参数,向用户发出警告,应用新参数

Integration Notes

集成说明

  • Google Analytics 4: All parameters map directly to GA4 dimensions. utm_id maps to campaign_id.
  • HubSpot: Source and medium map to HubSpot's Original Source properties.
  • Salesforce: Campaign name can map to Salesforce Campaign records via integration.
  • Mixpanel / Amplitude: UTM params auto-captured on page load via standard SDKs.
  • Google Analytics 4:所有参数直接映射到GA4维度,utm_id映射到campaign_id。
  • HubSpot:来源和渠道类型映射到HubSpot的原始来源属性。
  • Salesforce:推广活动名称可通过集成映射到Salesforce推广活动记录。
  • Mixpanel / Amplitude:UTM参数通过标准SDK在页面加载时自动捕获。

Best Practices Embedded in This Skill

本工具内置的最佳实践

  1. One registry, one truth -- All UTM links flow through the registry. No ad-hoc link creation.
  2. Convention over configuration -- Canonical lists prevent naming drift before it starts.
  3. Auto-correction over rejection -- When possible, fix the input rather than blocking the user.
  4. Platform awareness -- Different platforms need different utm_content values to distinguish placements.
  5. Date-prefixed campaigns -- Makes it trivial to filter analytics by time period.
  6. Audit trail -- Every link is timestamped and attributed in the registry.
  1. 单一注册表,单一事实来源:所有UTM链接均通过注册表生成,禁止临时创建链接。
  2. 规范优先于配置:标准列表从源头阻止命名偏差。
  3. 自动修正优先于拒绝:尽可能修正输入而非阻止用户操作。
  4. 平台感知:不同平台需要不同的utm_content值以区分投放位置。
  5. 带日期前缀的推广活动:便于按时间段筛选分析数据。
  6. 审计追踪:每条链接均在注册表中记录时间戳和归属信息。