induwara.lk
induwara.lkMarketing · Analytics

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.

By Induwara AshinsanaUpdated Jun 9, 2026
Build your campaign URL
GA4 channel-aware

The full link you want to tag. Any existing query string and #fragment are kept.

utm_source

Where the traffic comes from — e.g. newsletter, facebook, google.

utm_medium

The marketing channel — e.g. email, cpc, social, referral.

utm_campaign

A name for the campaign — e.g. june_promo, builder_launch_lk.

utm_term · optional

Optional. Paid-search keyword.

utm_content · optional

Optional. Distinguishes ads/links pointing to the same URL.

Quick presets
Campaign URL

https://induwara.lk/build?utm_source=facebook&utm_medium=cpc&utm_campaign=builder_launch_lk&utm_content=video_a

Verified: re-parsed with the WHATWG URL parser, every value round-trips.

GA4 channel
Paid Social

Source "facebook" is a recognised social site AND medium "cpc" matches the paid pattern /^(.*cp.*|ppc|paid.*)$/. GA4 files paid social here, not under Referral.

Parameter breakdown

ParameterRaw valueWritten to URL
utm_sourcerequiredfacebookfacebook
utm_mediumrequiredcpccpc
utm_campaignrequiredbuilder_launch_lkbuilder_launch_lk
utm_contentvideo_avideo_a

Looks good — all required parameters present, no hygiene issues.

UTM definitions follow Google's Campaign URL Builder; channel prediction follows the published GA4 Default channel group rules; encoding follows RFC 3986. Everything runs in your browser — no link is ever sent to a server.

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.

  1. 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).
  2. Normalise.With "Force lowercase + trim" on, each value is trimmed and lower-cased. GA4 stores UTM values case-sensitively, so Email and email become two different channels in your reports — lowercasing is the recommended hygiene step.
  3. 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.
  4. 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.
  5. 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

Email newsletter (normalisation)

source newsletter · medium “Email ” · campaign june_taxtips

  1. Normalise: “Email ” → “email” (trimmed + lower-cased).
  2. No existing query on the base URL → use “?”.
  3. URL: …/sri-lanka-tax-calculator?utm_source=newsletter&utm_medium=email&utm_campaign=june_taxtips
  4. Rule: medium “email” is a GA4 email value → channel Email. ✓

Facebook paid ad (the surprising one)

source facebook · medium cpc · campaign builder_launch_lk · content video_a

  1. URL: …/build?utm_source=facebook&utm_medium=cpc&utm_campaign=builder_launch_lk&utm_content=video_a
  2. Rule: source “facebook” is a social site AND medium “cpc” matches ^(.*cp.*|ppc|paid.*)$.
  3. Channel: Paid Social — not Referral, which is what most people expect. ✓

Existing query + a medium GA4 won’t recognise

base …/tools?ref=card · source whatsapp · medium chat · campaign share

  1. Base URL already has a query (ref=card) → use “&”, keep ref=card.
  2. URL: …/tools?ref=card&utm_source=whatsapp&utm_medium=chat&utm_campaign=share
  3. Rule: medium “chat” matches no GA4 channel pattern → Unassigned. ⚠
  4. Fix: use medium “social” for an organic share, or “referral”. ✓

Frequently asked questions

Sources & references

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

Rate this tool
Be the first to rate

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.