Community写作与编辑github.com

utm-governance

Set up and enforce a UTM naming convention. Use when someone asks to build UTM links, create a UTM or campaign naming convention or taxonomy, tag links for a campaign, or audit or clean up messy source/medium data from GA4, HubSpot or another analytics export (for example traffic landing in "(other)" or "Unassigned"). Builds links that follow the convention and audits exports for case splits, near-duplicates and values GA4 won't put in a channel.

utm-governance 是什么?

utm-governance is a Claude Code agent skill that set up and enforce a UTM naming convention. Use when someone asks to build UTM links, create a UTM or campaign naming convention or taxonomy, tag links for a campaign, or audit or clean up messy source/medium data from GA4, HubSpot or another analytics export (for example traffic landing in "(other)" or "Unassigned"). Builds links that follow the convention and audits exports for case splits, near-duplicates and values GA4 won't put in a channel.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ndnakashima/marketing-ops-skills/tree/HEAD/plugins/campaigns-automation/skills/utm-governance

Installed? Explore more 写作与编辑 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

UTM Governance

By Naomi D. Nakashima · helpmenaomi.com

Three jobs: design a convention, build links that follow it, and audit what's already in the data. Pick whichever the user needs; most people start with the audit, because that's where the pain shows.

1. Design a convention

Ask only what you need, in one message:

  • Which channels they run (email, paid search, paid social, organic social, partners, events, SMS, QR/print).
  • Which analytics tools read the UTMs (GA4, HubSpot, Salesforce campaigns, Marketo programs).
  • Whether campaigns have IDs or names in a planning tool already.

Then write the convention from references/convention-template.md. Fill in their real values; don't leave the template's examples in. Key rules:

  • utm_medium comes from a short, fixed list that matches GA4's default channel rules (references/ga4-channels.md). That's the field that decides the channel, so it's the one that most needs locking down.
  • utm_source is the platform or publication, lowercase, from an allowed list.
  • utm_campaign follows a pattern such as yyyy-mm_program_name, lowercase with hyphens or underscores (pick one and stick with it).
  • utm_content tells apart creatives or links within a campaign; utm_term is for paid keywords or audiences.
  • No spaces, no capitals, no personal data (never put email addresses or names in a UTM).

Offer the result as a doc they can share with their team.

2. Build links

For one or a few links, build them by hand following the convention. For a batch, put the rows in a CSV with columns url,source,medium,campaign,content,term and run:

python3 scripts/utm.py build links.csv --out tagged.csv [--allowed-mediums email,cpc,paid-social,social,referral,affiliate,display]

The script lowercases values, swaps spaces for hyphens, keeps any query strings and #anchors already on the URL, warns when a medium isn't on the allowed list or won't map to a GA4 channel, and writes tagged.csv with the finished URLs.

3. Audit existing data

Ask for an export with source and medium columns (and sessions, if they have it). In GA4 that's Reports › Acquisition › Traffic acquisition with "Session source / medium" as the dimension, or an Explore. Then run:

python3 scripts/utm.py audit export.csv --source "Session source" --medium "Session medium" [--sessions Sessions] [--campaign "Session campaign"]

It also takes one combined "source / medium" column: --source-medium "Session source / medium".

The audit reports:

  • Case and spacing splits (Email vs email vs e-mail ), with the sessions each split takes up.
  • Mediums GA4 can't map to a default channel (they land in Unassigned), with the closest standard medium to use instead.
  • Near-duplicate sources (linkedin, linkedin.com, lnkd.in, LinkedIn_Ads).
  • Personal data in values (anything that looks like an email address).
  • A share of sessions affected, so the user can see whether this is worth fixing.

Write up the findings as: what's broken, what it costs in reporting, a mapping table (old value → standard value) the team can use going forward, and how to fix history. GA4 doesn't rewrite past data, so the options are custom channel groups for reporting, or cleanup in the warehouse or BI layer.

Notes

  • GA4's default channel definitions change from time to time. references/ga4-channels.md summarizes them; check the current Google Analytics help page ("Default channel group") before telling anyone a rule is final.
  • Link shorteners and redirects can drop UTMs. Test one link end to end before a big send.

相关技能