UTM Builder — GA4 Channel-Aware Campaign URL Generator
Assemble a correctly-formatted UTM campaign URL and see which GA4 Default Channel Group it will land in — Email, Paid Social, Referral — before you spend ad money. Catches the uppercase typos and stray mediums that silently break your analytics. No signup, runs entirely in your browser.
How it works
A UTM-tagged link is just your normal URL with up to five extra query parameters appended. Google Analytics reads those parameters on arrival and attributes the visit to a campaign. This tool does two jobs: it assembles the link correctly, and it predicts the GA4 channel so you are not surprised by your own reports a week later.
- Parse the base URL. The link is split into its origin, path, existing query string, and
#fragmentusing the browser's standards-compliant URL parser. The fragment is held aside and re-attached last, because UTM parameters belong in the query, never the fragment (RFC 3986 §3). - Normalise.With "Force lowercase + trim" on, each value is trimmed and lower-cased. GA4 stores UTM values case-sensitively, so
Emailandemailbecome two different channels in your reports — lowercasing is the recommended hygiene step. - Encode. Each value is percent-encoded for the query component per RFC 3986 §2.1/§3.4, so spaces, ampersands, and non-ASCII characters (including Sinhala and Tamil) cannot break the link. Empty optional parameters are dropped entirely.
- Assemble. The UTM pairs are appended with the right separator —
?if the base URL has no query yet,&if it already does — preserving any non-UTM parameters already present. The fragment is re-attached at the end. - Cross-check.The finished string is re-parsed with the WHATWG URL parser and every value is decoded back and compared to what you typed. If they all round-trip, the link is provably well-formed — shown as the "Verified" note under the URL.
To predict the channel, the tool evaluates Google's published GA4 Default Channel Group rules in order against the lower-cased source and medium, first match wins. The key deterministic rules it implements: Paid Search (a recognised search engine plus a medium matching ^(.*cp.*|ppc|paid.*)$), Organic Search (medium = organic), Paid Social (a recognised social site plus the same paid pattern), Organic Social, Email, Affiliates, Referral, and Display. Anything that matches none of these is reported as Unassigned and flagged as a warning. The exact rule that fired is shown next to the prediction, so it is explainable rather than magic.
Worked examples
Frequently asked questions
Sources & references
- Google Analytics Help — Collect campaign data with custom URLs (the five UTM parameters)
- Google Analytics Help — [GA4] Default channel group (source/medium → channel rules)
- IETF RFC 3986 — URI Generic Syntax (query component + percent-encoding)
The UTM definitions, GA4 channel rules, and encoding behaviour on this page were last cross-checked against the sources above on 2026-06-09. Google revises its Default Channel Group rules occasionally; this page is reviewed when they do.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] — most fixes ship within 24 hours.