UTM Builder
Build trackable UTM URLs from campaign source, medium and name.
UTM parameters are the standard tags you append to a URL so that Google Analytics (GA4) can tell which channel a visitor came from — paid ads, newsletters, social posts and more. This UTM builder takes a base URL plus utm_source, utm_medium, utm_campaign and friends and generates a clean campaign tracking URL in real time.
Every value is URL-encoded automatically, and any existing query string or hash (#) on the base URL is merged correctly instead of being broken. That removes the typos, duplicate question marks and missing encoding you get when stitching URLs together by hand.
The five UTM parameters
These are the standard UTM parameters GA4 understands. The first three should almost always be filled in.
- utm_source: where the traffic came from. e.g.
google,newsletter - utm_medium: the marketing medium. e.g.
cpc,email,social,banner - utm_campaign: the campaign name. e.g.
summer_sale,2026_launch - utm_term: paid keyword (optional). e.g.
running+shoes - utm_content: A/B test or creative variant (optional). e.g.
top_banner,text_link
Consistent naming is everything
UTM values are case-sensitive. Google and google are counted as two different sources in GA4, which splits your data. Your reports stay clean when the whole team follows the same rules.
- Always use lowercase.
- Replace spaces with underscores (
_) or hyphens (-) consistently. - Maintain a shared, documented list of approved source/medium/campaign values.
Building the final URL
The tool safely encodes each value with encodeURIComponent, then appends only the UTM parameters while preserving any existing query string and hash on the base URL. Copy the finished link with one click and paste it into your ad platform or post. To go the other way and break an existing tracking link back into its parameters, use the UTM parser.
Recommended utm_medium values and GA4 channel mapping
GA4 reads your utm_medium value and automatically sorts the visit into a Default Channel Group. If you use a value it does not recognize, legitimate ad traffic ends up in Unassigned and your campaign reports look empty. Here are the medium values GA4 maps out of the box.
| utm_medium value | GA4 channel | Where you use it |
|---|---|---|
cpc, ppc, paidsearch | Paid Search | Google/Bing search ads |
display, banner, cpm, expandable | Display | GDN, banner ads |
social, social-paid, sm | Organic/Paid Social | Instagram, Facebook, X posts/ads |
email, e-mail, newsletter | Newsletter / mail blasts | |
affiliate | Affiliates | Affiliate/partner links |
referral | Referral | Links from other sites |
(none) or empty | Direct | Typed-in / bookmark |
The point is that GA4 only auto-classifies exact keywords like email or cpc; a small variation such as mail or ppc-google breaks the mapping.
A worked example
Say you tag a summer-sale email with the values below, and the base URL already carries a query (?ref=top) and a hash (#offer):
- Base URL:
https://shop.example.com/sale?ref=top#offer - source
newsletter/ mediumemail/ campaignsummer sale 2026
The tool encodes the spaces and preserves the existing query and hash, inserting only the UTM parameters (the hash always stays at the very end):
https://shop.example.com/sale?ref=top&utm_source=newsletter&utm_medium=email&utm_campaign=summer%20sale%202026#offer
Notice the space encoded as %20. GA4 decodes the campaign back to summer sale 2026 in reports, but for readability and click-safety it is better to start with a space-free value likesummer_sale_2026.
Common pitfall
- Putting UTM after the hash (#). Appending UTM behind a SPA hash route, e.g.
example.com/#/page?utm_source=x, makes GA4 ignore it. UTM must live in the?query section (before the hash), which is exactly where this tool places it. - UTM stripped by redirects. If a short URL or an
http→httpsredirect drops the query string, your tracking disappears entirely. Open the final landing URL yourself and confirm the parameters survived. - Tagging internal links. Adding UTM to links within your own site restarts the GA4 session and miscredits direct traffic to a campaign. Only tag inbound entry links from external sources.
Frequently asked questions
Which of source, medium and campaign are required?
Can I use spaces or non-Latin characters in values?
What if my base URL already has a ? or #?
Is my URL sent to any server?
Does capitalization matter?
Related guides
- Using UTM Parameters Properly: Naming Rules and PitfallsHow to use utm_source, medium and campaign correctly — naming conventions, GA4 channel mapping and mistakes.