Code Snippet Library / Paid Media

UTM Parameter Canonicalizer

The UTM Parameter Canonicalizer is a free code snippet that normalizes raw UTM values and, given a synonym map you supply, canonicalizes known variants to one real channel name, surfacing exactly which raw values silently fragmented the same channel across your reports.

↗ View on GitHub ⬇ Download Full Repo (.zip)
MIT
License
JSON
Language
Aug 17, 2026
Last updated
README.md View raw ↗

What this is (and isn’t)

Pure functions over the UTM data and synonym map you supply. Not a hosted service, and does not assert a universal channel-naming list as “correct” — naming conventions are genuinely different per organization, so you supply your own synonym map.

Files

FilePurpose
utm-canonicalizer.jsnormalizeUtmValue(), buildReverseSynonymMap(), canonicalizeUtmValue(), detectFragmentation() — zero dependencies
test.js15-test suite covering normalization, canonicalization, and real fragmentation detection

The two real guardrails

Normalization handles the three common separator styles (slash, hyphen, underscore, plus arbitrary whitespace) so differently-formatted equivalents resolve identically before synonym matching runs. And fragmentation requires 2+ genuinely distinct raw strings, not just repeated rows of the same value, with unmapped raw values reported separately rather than silently bucketed into an Unknown catch-all.

FAQ

Is this free to use?

Yes. Free to download and use. MV3 charges $175/hr only for implementation help wiring this into your real GA4/BigQuery export data.

Does this include a built-in list of channel names?

No. Channel naming conventions genuinely differ per organization, so you supply your own synonym map rather than trusting an asserted universal list.

What counts as real fragmentation versus just repeated data?

Only when 2 or more genuinely distinct raw value strings collapse into the same canonical channel. The same raw string appearing many times is normal traffic volume, not fragmentation.

RB
Ryan Brooks
Technical SEO, MV3 Marketing