UTM Parameters: A Complete Guide to Campaign Tracking
What UTM parameters are
UTM parameters are tags appended to a URL's query string that tell your analytics where a visitor came from:
https://example.com/pricing?utm_source=newsletter&utm_medium=email&utm_campaign=july_launch
They exist because referrer headers are unreliable — stripped by HTTPS-to-HTTP transitions, absent from apps and email clients, and useless for distinguishing two campaigns from the same source. UTMs put the attribution in the link itself.
The five parameters
| Parameter | Answers | Example |
|---|---|---|
utm_source | Which specific site or sender? | newsletter, twitter, google |
utm_medium | What kind of channel? | email, cpc, social, referral |
utm_campaign | Which initiative? | july_launch, black_friday_2026 |
utm_content | Which variant or placement? | header_cta, variant_b |
utm_term | Which keyword? (paid search) | self+hosted+analytics |
The first three are effectively required. utm_content earns its place for A/B testing link placement; utm_term is mostly a paid-search artifact.
The distinction people get wrong is source vs medium. Medium is the category, source is the instance. Email is a medium; your Tuesday newsletter is a source. Getting this backwards makes channel-level reporting impossible, because you can no longer group all email traffic together.
Naming conventions that hold up
UTM values are case-sensitive and exact-match. Email, email, and e-mail are three different mediums in your reports, and there is no way to merge them retroactively without rewriting history.
Adopt these rules and enforce them:
- Lowercase everything, always.
- Underscores or hyphens — pick one. Never mix.
- No spaces. They encode as
%20and look broken in reports. - A fixed medium vocabulary. Publish the list; do not let it grow ad hoc:
email, cpc, social, organic_social, referral, affiliate, display, video, podcast, qr, print
- Date-stamp campaigns.
black_friday_2026, notblack_friday. Next year you will want to compare them. - Keep a shared spreadsheet or a link builder. Every UTM'd link in one place, with an owner. This is the single highest-leverage habit; freehand tagging is where taxonomies die.
Mistakes that corrupt your data
Tagging internal links. This is the big one. Putting UTMs on a link from your own homepage to your own pricing page starts a new session attributed to that campaign, destroying the real acquisition source. Never UTM-tag internal navigation. Use event tracking for internal clicks.
Tagging in a way that breaks canonicals. UTM'd URLs are distinct URLs to a crawler. Make sure your canonical tag points to the clean URL, or you will fragment your SEO signals across dozens of query-string variants.
Inconsistent medium for the same channel. social in one campaign, social_media in the next, Social in a third. Three rows in every report that should be one.
Leaving UTMs on shared links. Someone copies a UTM'd URL from their address bar and posts it. Now organic word-of-mouth is attributed to your July email campaign. Some sites strip UTMs from the URL client-side after recording them, which is a reasonable mitigation.
Putting PII in `utm_content`. Personalized links with an email address or user ID in a parameter put personal data in your analytics store and in every referrer log downstream.
What happens on the receiving end
A tracking script reads the query string on pageview, records the parameters, and — critically — associates them with the session, not just that pageview. If a visitor lands with UTMs, browses five pages, and converts on the sixth, the conversion should still be attributed to the campaign.
SELECT utm_source, utm_medium, utm_campaign,
count(DISTINCT session_id) AS sessions,
count(*) FILTER (WHERE event_name = 'signup_completed') AS signups,
round(100.0 * count(*) FILTER (WHERE event_name = 'signup_completed')
/ nullif(count(DISTINCT session_id), 0), 2) AS conv_pct
FROM events
WHERE timestamp >= current_date - 30 AND utm_source IS NOT NULL
GROUP BY 1, 2, 3
ORDER BY sessions DESC;UTMs and attribution models
UTMs record the touch; the attribution model decides which touch gets credit when there are several.
- Last-touch — credit the final campaign before conversion. Simple, and the usual default. Overcredits bottom-of-funnel channels like branded search.
- First-touch — credit the campaign that first brought them. Better for measuring awareness. Overcredits top-of-funnel.
- Linear / position-based — split credit across touches. More honest, harder to explain, and requires stitching sessions across days.
Most self-hosted, privacy-first tools do last-touch by session, because multi-touch attribution across weeks requires persistent cross-session identity — exactly the thing cookieless analytics deliberately avoids. That is a real limitation, and worth being explicit about rather than pretending the numbers mean more than they do.
Frequently asked questions
Which UTM parameters are actually required?
utm_source alone is enough to attribute traffic; utm_medium and utm_campaign make reports readable. Term and content are optional and mostly matter for paid search and A/B-tested creative.
Are UTM parameters case sensitive?
Yes, and this is the most common way UTM data gets corrupted — Facebook and facebook become two rows in every report. Standardize on lowercase and enforce it in a shared builder.
Should I put UTMs on internal links?
No. Internal UTM links overwrite the original acquisition source, so a visitor who arrived from search is reattributed to your own newsletter. Use them only on links pointing into your site from outside it.
Do UTM parameters affect SEO?
They create distinct URLs, which is why a canonical tag matters — it consolidates the variants to one indexable URL. Without one you risk duplicate-content dilution across campaign links.
How do UTMs relate to attribution models?
UTMs record the touchpoint; the attribution model decides which touchpoint gets credit. Last-click is the common default, and no tagging scheme fixes a model that ignores earlier touches.
A tagging checklist
- [ ] Source, medium, campaign on every external campaign link
- [ ] Lowercase, one separator style, no spaces
- [ ] Medium drawn from a fixed published list
- [ ] Campaign names include the year
- [ ] Zero UTMs on internal links
- [ ] Canonical tags point to clean URLs
- [ ] All links logged in a shared builder with an owner
- [ ] No personal data in any parameter
Related: funnel analysis by channel and retention by acquisition source.
Try InsightsTrack free
Open-source, self-hosted, privacy-first analytics — explore the live demo, no install required.
Open live dashboard