utm-link-generator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUTM 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
核心功能
- Generate UTM-tagged URLs with validated, consistent parameters
- Maintain a utm-registry.json file that tracks all generated links and enforces naming conventions
- Prevent duplicates -- warns when a similar link already exists in the registry
- Platform-specific formatting -- outputs links optimized for LinkedIn, email, social, and ad platforms
- Bulk generation -- create multiple variants for A/B testing or multi-channel campaigns
- Validation -- rejects malformed URLs, empty parameters, and convention violations
- Reporting -- generates campaign tracking summaries from the registry
- 生成带UTM标签的URL:使用经过验证的统一参数
- 维护utm-registry.json文件:追踪所有生成的链接并强制命名规范
- 避免重复:当注册表中已存在相似链接时发出警告
- 平台专属格式:生成适配LinkedIn、邮件、社交平台及广告平台的优化链接
- 批量生成:为A/B测试或多渠道推广活动创建多种变体链接
- 参数验证:拒绝格式错误的URL、空参数及违反规范的内容
- 报告生成:基于注册表生成推广活动追踪汇总
UTM Parameter Reference
UTM参数参考
| Parameter | Required | Purpose | Example |
|---|---|---|---|
| Yes | Where the traffic comes from | |
| Yes | Marketing medium | |
| Yes | Campaign identifier | |
| No | Paid keyword (search ads) | |
| No | Differentiates similar links | |
| No | Campaign ID for GA4 | |
| 参数 | 是否必填 | 用途 | 示例 |
|---|---|---|---|
| 是 | 流量来源 | |
| 是 | 营销渠道类型 | |
| 是 | 推广活动标识 | |
| 否 | 付费关键词(搜索广告) | |
| 否 | 区分相似链接 | |
| 否 | GA4推广活动ID | |
Naming Conventions (Enforced)
强制命名规范
These conventions are non-negotiable. The skill will reject or auto-correct any violations.
以下规范为硬性要求,工具将拒绝或自动修正任何违规内容。
General Rules
通用规则
- All lowercase -- Never , always
LinkedInlinkedin - Hyphens for spaces -- Never , always
product launchproduct-launch - No special characters -- Only alphanumeric and hyphens
- No trailing/leading hyphens -- Never
-campaign-name- - No double hyphens -- Never
my--campaign - Maximum length: 50 characters per parameter value
- Date format in campaigns: or
q[N]-[YYYY]prefix[YYYY]-[MM]
- 全小写:禁止使用,必须用
LinkedInlinkedin - 用连字符代替空格:禁止使用,必须用
product launchproduct-launch - 无特殊字符:仅允许字母数字和连字符
- 无首尾连字符:禁止使用
-campaign-name- - 无双连字符:禁止使用
my--campaign - 最大长度:每个参数值最多50个字符
- 推广活动中的日期格式:前缀为或
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 Source | Aliases (auto-corrected) | Platform |
|---|---|---|
| | Google Ads / Organic |
| | |
| | Facebook / Meta |
| | |
| | X (Twitter) |
| | YouTube |
| | TikTok |
| | |
| | Email campaigns |
| | Newsletter specifically |
| | Bing / Microsoft |
| | Direct traffic |
| | Referral traffic |
| | Podcast channels |
| | Slack communities |
| | Product Hunt |
| | Hacker News |
仅允许使用以下来源值,新增来源需明确添加到注册表中。
| 标准来源 | 别名(自动修正) | 平台 |
|---|---|---|
| | Google Ads / 自然搜索 |
| | |
| | Facebook / Meta |
| | |
| | X (Twitter) |
| | YouTube |
| | TikTok |
| | |
| | 邮件推广活动 |
| | 专项通讯 |
| | Bing / Microsoft |
| | 直接流量 |
| | 引荐流量 |
| | 播客渠道 |
| | Slack社区 |
| | Product Hunt |
| | Hacker News |
Medium Values (Canonical List)
渠道类型标准列表
| Canonical Medium | Aliases (auto-corrected) | Use Case |
|---|---|---|
| | Paid search / paid social clicks |
| | Display / impression campaigns |
| | Email campaigns |
| | Organic social posts |
| | Organic search traffic |
| | Referral / partner links |
| | Video ad placements |
| | Retargeting campaigns |
| | Content marketing |
| | Webinar / event registrations |
| | Podcast mentions / ads |
| | SMS / text campaigns |
| | QR code / print materials |
| | Push notifications |
| 标准渠道类型 | 别名(自动修正) | 使用场景 |
|---|---|---|
| | 付费搜索 / 付费社交点击 |
| | 展示广告 / 曝光类推广活动 |
| | 邮件推广活动 |
| | 自然社交帖子 |
| | 自然搜索流量 |
| | 引荐 / 合作伙伴链接 |
| | 视频广告位 |
| | 再营销推广活动 |
| | 内容营销 |
| | 线上研讨会 / 活动注册 |
| | 播客提及 / 广告 |
| | SMS / 短信推广活动 |
| | 二维码 / 印刷物料 |
| | 推送通知 |
Campaign Naming Pattern
推广活动命名格式
Campaigns follow this structure:
[quarter-or-month]-[year]-[campaign-name]-[optional-variant]Examples:
q1-2026-product-launch2026-03-spring-webinarq2-2026-brand-awareness-linkedin- (for always-on campaigns, skip the date prefix)
evergreen-demo-request
推广活动需遵循以下结构:
[季度或月份]-[年份]-[推广活动名称]-[可选变体]示例:
q1-2026-product-launch2026-03-spring-webinarq2-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:
- Convert to lowercase -- becomes
LinkedInlinkedin - Replace spaces with hyphens -- becomes
product launchproduct-launch - Strip special characters -- Remove anything not
[a-z0-9-] - Check against canonical lists -- Auto-correct known aliases (e.g., to
fb)facebook - 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
- Validate URL -- Ensure the destination URL is well-formed (has protocol, valid domain)
- Check length -- Ensure no parameter exceeds 50 characters
Report any corrections made:
undefined对每个参数执行以下操作:
- 转换为小写:转为
LinkedInlinkedin - 用连字符替换空格:转为
product launchproduct-launch - 移除特殊字符:删除所有非的字符
[a-z0-9-] - 对照标准列表:自动修正已知别名(例如转为
fb)facebook - 拒绝未知值:如果来源或渠道类型不在标准列表中且并非合理新增项,需向用户发出警告并推荐最接近的匹配项
- 验证URL:确保目标URL格式正确(包含协议、有效域名)
- 检查长度:确保所有参数不超过50个字符
报告所有修正内容:
undefinedParameter 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 -- 有效
undefinedStep 3: Check Registry for Duplicates
步骤3:检查注册表重复项
Read the utm-registry.json file (or create it if it does not exist). Check for:
- Exact duplicates -- Same URL + same parameters. Warn and return the existing link.
- Near duplicates -- Same URL + same campaign + different content/medium. Warn but allow (this is often intentional for multi-channel tracking).
- Naming conflicts -- Same campaign name but different capitalization or hyphenation. Block and show the existing convention.
读取utm-registry.json文件(若不存在则创建),检查以下内容:
- 完全重复:相同URL + 相同参数。发出警告并返回已存在的链接。
- 近似重复:相同URL + 相同推广活动 + 不同内容/渠道类型。发出警告但允许生成(这通常是多渠道追踪的有意操作)。
- 命名冲突:相同推广活动名称但大小写或连字符使用不同。阻止生成并展示现有规范。
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:
为每个请求的平台生成优化链接:
undefinedundefinedPost Link (organic social):
https://example.com/pricing?utm_source=linkedin&utm_medium=social&utm_campaign=q1-2026-product-launch&utm_content=organic-post
Ad Link (paid):
https://example.com/pricing?utm_source=linkedin&utm_medium=cpc&utm_campaign=q1-2026-product-launch&utm_content=sponsored-post
Message Link (InMail/DM):
https://example.com/pricing?utm_source=linkedin&utm_medium=social&utm_campaign=q1-2026-product-launch&utm_content=inmail
Profile Link (bio/featured):
https://example.com/pricing?utm_source=linkedin&utm_medium=social&utm_campaign=q1-2026-product-launch&utm_content=profile-link
undefined邮件
undefinedundefined邮件
Secondary CTA:
https://example.com/pricing?utm_source=email&utm_medium=email&utm_campaign=q1-2026-product-launch&utm_content=secondary-cta
undefinedundefinedSocial (General)
社交平台(通用)
undefinedundefinedSocial
社交平台
Twitter/X:
https://example.com/pricing?utm_source=twitter&utm_medium=social&utm_campaign=q1-2026-product-launch
Instagram (bio link):
https://example.com/pricing?utm_source=instagram&utm_medium=social&utm_campaign=q1-2026-product-launch&utm_content=bio-link
Reddit:
https://example.com/pricing?utm_source=reddit&utm_medium=social&utm_campaign=q1-2026-product-launch
undefinedTwitter/X:
https://example.com/pricing?utm_source=twitter&utm_medium=social&utm_campaign=q1-2026-product-launch
Instagram(简介链接):
https://example.com/pricing?utm_source=instagram&utm_medium=social&utm_campaign=q1-2026-product-launch&utm_content=bio-link
Reddit:
https://example.com/pricing?utm_source=reddit&utm_medium=social&utm_campaign=q1-2026-product-launch
undefinedAds (Paid)
广告(付费)
undefinedundefinedPaid Ads
付费广告
LinkedIn Ads:
https://example.com/pricing?utm_source=linkedin&utm_medium=cpc&utm_campaign=q1-2026-product-launch
Facebook/Meta Ads:
https://example.com/pricing?utm_source=facebook&utm_medium=cpc&utm_campaign=q1-2026-product-launch
Note: For Google Ads, use {keyword} as a dynamic placeholder that Google will auto-replace.
undefinedLinkedIn Ads:
https://example.com/pricing?utm_source=linkedin&utm_medium=cpc&utm_campaign=q1-2026-product-launch
Facebook/Meta Ads:
https://example.com/pricing?utm_source=facebook&utm_medium=cpc&utm_campaign=q1-2026-product-launch
注意:Google Ads中,{keyword}为动态占位符,将由Google自动替换。
undefinedStep 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以清晰、可直接复制的格式呈现最终结果:
undefinedUTM 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
可直接复制的链接
| Platform | Variant | Link |
|---|---|---|
| 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] |
| default | [full URL] | |
| default | [full URL] |
| 平台 | 变体 | 链接 |
|---|---|---|
| LinkedIn(自然) | organic-post | [完整URL] |
| LinkedIn(付费) | sponsored-post | [完整URL] |
| 邮件(主要CTA) | primary-cta | [完整URL] |
| 邮件(次要CTA) | secondary-cta | [完整URL] |
| 默认 | [完整URL] | |
| 默认 | [完整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- 所有参数已标准化为规范格式
- 未发现重复链接
- 未检测到命名冲突
undefinedBulk 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-proofProcessing
处理流程
- Parse each line into (URL, platforms, campaign)
- Validate and normalize all parameters
- Generate all variant links for each URL/platform combination
- Deduplicate across the batch
- Update registry with all new links
- Output a master table
- 将每一行解析为(URL, 平台, 推广活动)
- 验证并标准化所有参数
- 为每个URL/平台组合生成所有变体链接
- 在批量中去重
- 将所有新链接更新到注册表
- 输出汇总表格
Output Format (Bulk)
批量输出格式
undefinedundefinedBulk UTM Generation -- 3 campaigns, 8 platform variants, 24 total links
批量UTM生成结果 -- 3个推广活动,8个平台变体,共24条链接
| Campaign | URL | Platform | Variant | Full Link |
|---|---|---|---|---|
| q1-2026-product-launch | /pricing | linkedin-organic | organic-post | [URL] |
| q1-2026-product-launch | /pricing | linkedin-paid | sponsored-post | [URL] |
| q1-2026-product-launch | /pricing | primary-cta | [URL] | |
| ... | ... | ... | ... | ... |
Registry updated: 24 new links added.
undefined| 推广活动 | URL | 平台 | 变体 | 完整链接 |
|---|---|---|---|---|
| q1-2026-product-launch | /pricing | linkedin-organic | organic-post | [URL] |
| q1-2026-product-launch | /pricing | linkedin-paid | sponsored-post | [URL] |
| q1-2026-product-launch | /pricing | primary-cta | [URL] | |
| ... | ... | ... | ... | ... |
注册表已更新:新增24条链接。
undefinedRegistry 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
错误处理
| Error | Response |
|---|---|
| Invalid URL (no protocol) | Auto-prepend |
| Unknown source | Suggest closest canonical match, ask for confirmation |
| Unknown medium | Suggest closest canonical match, ask for confirmation |
| Campaign name too long | Suggest abbreviated version |
| Duplicate link exists | Show existing link, ask if user wants to create anyway |
| Registry file missing | Create new registry with default conventions |
| Registry file corrupted | Attempt to parse what exists, back up, create fresh |
| Base URL has existing UTMs | Strip existing UTM params, warn user, apply new ones |
| 错误 | 响应 |
|---|---|
| 无效URL(无协议) | 自动添加 |
| 未知来源 | 推荐最接近的标准匹配项,请求用户确认 |
| 未知渠道类型 | 推荐最接近的标准匹配项,请求用户确认 |
| 推广活动名称过长 | 推荐缩写版本 |
| 已存在重复链接 | 展示现有链接,询问用户是否仍要生成 |
| 注册表文件缺失 | 使用默认规范创建新注册表 |
| 注册表文件损坏 | 尝试解析可读取内容,备份后创建新注册表 |
| 基础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
本工具内置的最佳实践
- One registry, one truth -- All UTM links flow through the registry. No ad-hoc link creation.
- Convention over configuration -- Canonical lists prevent naming drift before it starts.
- Auto-correction over rejection -- When possible, fix the input rather than blocking the user.
- Platform awareness -- Different platforms need different utm_content values to distinguish placements.
- Date-prefixed campaigns -- Makes it trivial to filter analytics by time period.
- Audit trail -- Every link is timestamped and attributed in the registry.
- 单一注册表,单一事实来源:所有UTM链接均通过注册表生成,禁止临时创建链接。
- 规范优先于配置:标准列表从源头阻止命名偏差。
- 自动修正优先于拒绝:尽可能修正输入而非阻止用户操作。
- 平台感知:不同平台需要不同的utm_content值以区分投放位置。
- 带日期前缀的推广活动:便于按时间段筛选分析数据。
- 审计追踪:每条链接均在注册表中记录时间戳和归属信息。