📢 UTM Parameter Builder
Build tracked UTM links for campaign analytics.
📐 计算公式 / 说明
UTM 构建:在网址后拼接 ?utm_source=&utm_medium=&utm_campaign=&utm_term=&utm_content=(后两项可选),生成标准化追踪链接;批量模式按行拆分网址,逐行套用同一组参数。
已有同名 utm_* 参数会先被删除再写入,参数插在 # 锚点之前;中文、空格与特殊字符由 URLSearchParams 自动编码。URL 与来源 utm_source 必填;medium/campaign 建议填写,缺失时结果区会提示归因可能不完整;term 与 content 为空则不出现在链接中。
📚 深度解析:UTM 参数构建器
💡 常见使用场景
- 为不同渠道/活动生成带 UTM 的追踪链接。
- 规范 utm_source/medium/campaign 命名便于归因。
- 批量生成多活动链接导入投放后台。
单条链接
来源 wechat、媒介 cpc、活动 spring_sale → 原链接后接 ?utm_source=wechat&utm_medium=cpc&utm_campaign=spring_sale,可在 GA 按渠道拆分。
命名规范
utm_source 用平台名(wechat/toutiao)、utm_medium 用类型(cpc/organic)、utm_campaign 用活动代号(含日期),避免中文与空格。
锚点落地页
https://a.example/p#top + utm_source=wechat → https://a.example/p?utm_source=wechat#top;参数写在 # 之前才能被服务端读到,原有同名 utm_* 会被替换而不是追加。
❓ 常见问题(FAQ)
- UTM 中文会有问题吗?
- 会。中文与空格需 URL 编码,部分后台解析异常,建议全小写英文+下划线。
- 哪些参数必填?
- utm_source 必填;medium/campaign 强烈建议,缺失时结果区会提示「GA 归因可能不完整」,content/term 用于 A/B 或搜索词细分。
Formula & Standard References
| Item | Formula | Source / Standard |
|---|---|---|
| UTM structure | source, medium and campaign | Parameter names follow the Google Analytics UTM convention |
| URL assembly | Base URL plus query parameters | Serialized by URLSearchParams; existing utm_* keys are removed first |
| Naming convention | Use lower case letters and hyphens | No case conversion; values are kept as entered |
⚠️ 使用说明与注意事项
- 本工具纯前端运行,数据不会上传到服务器
- 建议在主流浏览器(Chrome/Safari/Firefox/Edge)中使用
- 链接中已有同名 utm_* 参数会被替换而不是累加;参数插在 # 锚点之前,中文与空格自动编码