By · Updated

UTM Builder

Campaign URLs With utm_source, Medium and Campaign, Encoded and Consistently Cased

No ratings yet
Result

—

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the UTM Campaign URL Builder works

This UTM builder writes tracked campaign links. Fill in the landing page and the campaign fields and the tracked link is built for you, with each value URL-encoded and, by default, lowercased and hyphenated so Spring Sale and spring-sale do not end up as two campaigns in your reports. The table beneath shows exactly which parameters will be sent. Nothing is stored or transmitted.

UTM builder: the five parameters

UTM parameters are five query-string keys that Google Analytics, and nearly every other analytics tool, reads to attribute a visit to a campaign. They were named after Urchin Tracking Module, the product Google bought in 2005, and they have survived unchanged because they are simple: the link carries its own provenance, and no cookie, pixel or referrer header is required.

The three you must set. utm_source names where the click came from: newsletter, google, linkedin, partner-site. utm_medium names the kind of channel: email, cpc for paid search, social, display, referral, affiliate. utm_campaign names the specific push: spring-sale, product-launch, webinar-june. Google Analytics 4 requires source and medium for the visit to be attributed as a campaign at all; without them the click falls back to whatever the referrer suggests, which for email is usually nothing and gets logged as direct traffic.

The two you might set. utm_term was built for paid search keywords and is still mostly used that way. utm_content distinguishes links within the same campaign — header-button versus footer-text, or variant-a versus variant-b — which is how you learn that nobody clicks the footer. Leave them blank when you have nothing to say; empty parameters clutter the link and confuse reports.

Why case and spacing matter more than you would think. Analytics tools treat parameter values as opaque strings. Email, email and e-mail are three separate mediums; Spring Sale and spring-sale are two campaigns; a stray trailing space makes a fourth. Every one of those splits your numbers, and it is far easier to be consistent when the link is generated than to merge rows in a report later. The default here lowercases every value and replaces spaces with hyphens. Switch it off only if your team already has a convention that depends on capitals.

Encoding. Anything outside the plain URL character set — spaces, ampersands, accented letters, plus signs — has to be percent-encoded or the link breaks or, worse, silently truncates at the first &. The builder uses the browser's own URL parser to do this, so what you see is exactly what a browser will send. If the landing page already has a query string, the UTM parameters are added to it rather than replacing it, and an existing UTM parameter is overwritten rather than duplicated.

Where UTMs belong, and where they do not. Use them on links you control that point to your own site from somewhere your analytics cannot otherwise see: emails, social posts, paid ads, QR codes, print, partner placements. Do not use them on internal links between pages of your own site; that restarts the session with a new source and destroys the original attribution. And do not use them on links to other people's sites, which achieves nothing for you and litters their reports.

Keep a record. The link carries the parameters but not the meaning. A shared spreadsheet of every tagged URL, with who created it, for what, and when, is the boring habit that makes the reports interpretable a year later when nobody remembers what campaign-7b was.

UTM link worked examples

The formula: tagged URL = page URL + ? + utm_source=… & utm_medium=… & utm_campaign=…, then the optional utm_term and utm_content, each value URL-encoded.

First example. The page https://example.com/shoes with source newsletter, medium email and campaign spring-sale gives https://example.com/shoes?utm_source=newsletter&utm_medium=email&utm_campaign=spring-sale.

Second example. The same link with content Header Banner and the lowercase option off gives …&utm_content=Header+Banner, because a space is encoded as +. With the option on it becomes utm_content=header-banner.

How many parameters are there? Five: utm_source, utm_medium and utm_campaign are required, and utm_term and utm_content are optional.

Common source and medium pairs and the GA4 default channel they land in

Placement utm_source utm_medium GA4 channel
Google Ads search ad google cpc Paid Search
Microsoft Ads search ad bing cpc Paid Search
Facebook ad facebook paid_social Paid Social
Instagram ad instagram cpc Paid Social
LinkedIn sponsored post linkedin cpc Paid Social
Facebook page post facebook social Organic Social
LinkedIn company post linkedin social Organic Social
X post twitter social Organic Social
Instagram bio link instagram social Organic Social
Pinterest pin pinterest social Organic Social
YouTube video description youtube video Organic Video
YouTube ad youtube cpv Paid Video
Newsletter newsletter email Email
Order confirmation email receipt email Email
SMS campaign sms sms SMS
App push notification app push Mobile Push Notifications
Banner ad on a network ad-network display Display
Affiliate link partner-name affiliate Affiliates
Podcast sponsorship podcast-name audio Audio
Guest post link blog-name referral Referral
QR code on a flyer flyer qr Unassigned

FAQ

Which UTM parameters are required?

utm_source, utm_medium and utm_campaign. Google Analytics 4 needs at least source and medium to attribute the visit; the builder refuses to output a link until all three are filled in.

Should UTM values be lowercase?

Yes, unless your organisation already has a different convention. Analytics treats Email and email as different values and splits your data between them. Lowercasing at creation time removes the problem entirely.

Can I use UTMs on links within my own website?

No. An internal link with UTM parameters starts a new session attributed to that fake source and overwrites the real one that brought the visitor. Reserve UTMs for links that arrive from outside.

Does the landing page need to be on my site?

It needs to be a site whose analytics you can see. Tagging links to someone else's site records nothing for you, because the parameters are only read by the analytics running on the destination page.

See also: all SEO tools, Dev Utilities, Formatters & Validators, Data & Encoding, Security & Identifiers, Accessibility, AI.

Related tools