Developer & Network Tools

UTM Parameters: Tracking Where Visitors Come From

Tag campaign links with UTM parameters, keep names consistent, and avoid the mistakes that distort your traffic reports.

Key takeaways

  • The three core tags are utm_source, utm_medium and utm_campaign.
  • Tag links that bring people to your site from elsewhere, and never tag links between your own pages.
  • Values are usually case-sensitive, so agree on lowercase and a fixed list of names.
  • Anyone can read or change the parameters, so never put personal data in them.
  • UTM reports show clicks that your analytics managed to record, which is always an incomplete picture.

UTM parameters are short labels added to the end of a link so your analytics tool can tell where a visit came from. You tag the link in a newsletter, an ad or a printed QR code, and when someone clicks it, the report shows that source, channel and campaign by name.

They need no special code on the link itself. The value comes from naming things consistently and tagging only links that point into your site from outside. This guide shows the parameters, a naming scheme and the common errors.

Parameters follow a question mark in the URL and are separated by ampersands:

https://example.com/spring-sale?utm_source=newsletter&utm_medium=email&utm_campaign=spring_sale&utm_content=header_button

The server normally delivers the same page it would without them. The analytics script on that page reads the address and records the values with the visit. The initials come from Urchin Tracking Module, after Urchin, an analytics product whose company Google acquired. Many analytics tools besides Google's understand the same names.

The general structure of query strings is covered in URL anatomy.

Taking apart a tagged campaign link
example.com/spring-sale 1 utm_source=newsletter 2 utm_medium=email 3 utm_campaign=spring_sale 4 utm_content=header_button 5 Landing page Where the visitor arrives 1 Source The specific place the link appeared 2 Medium The kind of channel 3 Campaign The effort this link belongs to 4 Content Which of several links was used 5 example.com/spring-sale 1 utm_source=newsletter 2 utm_medium=email 3 utm_campaign=spring_sale 4 utm_content=header_button 5 Landing page Where the visitor arrives 1 Source The specific place the link appeared 2 Medium The kind of channel 3 Campaign The effort this link belongs to 4 Content Which of several links was used 5

The parameters and what to put in them

Parameter Answers Example values
utm_source Which site, list or partner? newsletter, partner_blog, poster
utm_medium What type of channel? email, social, cpc, print
utm_campaign Which promotion or project? spring_sale, product_launch
utm_content Which version or placement? header_button, footer_link
utm_term Which paid search keyword? running+shoes

Source, medium and campaign are the ones to fill in every time. Content helps when you compare two links in the same message. Term is mainly for paid search.

Some analytics products define further tags, such as an ID or a platform field. Check your tool's documentation before relying on them.

Pay special attention to medium. Analytics tools often sort traffic into channel groups based on its value. If you invent e-mail-blast where the tool expects email, the visits may land in an "unassigned" or "other" bucket. Look up the values your tool recognizes and use them.

Build a naming convention

Most UTM trouble comes from people typing whatever comes to mind. Facebook, facebook and FB may appear as three different sources.

Write a one-page convention:

  • All lowercase.
  • One separator, either underscores or hyphens, and no spaces.
  • A fixed list of media.
  • A pattern for campaign names, for example year, season and topic: 2027_spring_sale.
  • No abbreviations that a new colleague couldn't decode.

Keep a shared spreadsheet of every tagged link with its destination, owner and date. It doubles as your record when a report shows a name nobody remembers. A UTM builder saves you from typing mistakes, and a query parameter editor helps when you need to fix an existing address.

Spaces and symbols get percent-encoded in URLs, which makes reports harder to read. URL encoding explains why.

Where to use them, and where not

Tag links in email newsletters, social posts, paid ads that aren't automatically tagged, partner placements, PDF documents and printed codes. These sources are otherwise hard to tell apart. Clicks from email apps and messaging apps frequently arrive with no referrer at all, so they appear as "direct" traffic.

Don't tag internal links. If a banner on your home page carries UTM values, clicking it can overwrite the visitor's original source or start a new session, depending on the tool. Use your analytics tool's event tracking for clicks inside your site.

You generally don't need tags for ordinary search results. Advertising platforms may add their own click identifiers, such as gclid, which their analytics integrations read. Check how the two interact before adding UTMs on top.

Should this link carry UTM tags?
Does it point from your site to your site? YES No tags; track the click as an event 1 NO Does the ad platform tag it automatically? YES Follow the platform's guidance first 2 NO Is it in email, social, print or a partner page? YES Tag source, medium and campaign 3 NO Are you comparing two links in one place? YES Add utm_content to tell them apart 4 NO Leave it clean Referrer data may already tell you enough Does it point from your site to your site? 1 IF YES No tags; track the click as an event NO Does the ad platform tag it automatically? 2 IF YES Follow the platform's guidance first NO Is it in email, social, print or a partner page? 3 IF YES Tag source, medium and campaign NO Are you comparing two links in one place? 4 IF YES Add utm_content to tell them apart NO Leave it clean Referrer data may already tell you enough

A worked example

Say a neighborhood bakery is announcing a weekend class. It plans to mention it in its monthly email (once at the top and once at the bottom), in a social post, on a community calendar run by a partner, and on a poster in the window.

All five links share the campaign 2027_bread_class. The differences go in the other tags:

Placement utm_source utm_medium utm_content
Email, top button monthly_news email top_button
Email, closing line monthly_news email footer_text
Social post instagram social class_photo
Partner calendar town_calendar referral listing
Window poster shop_window print qr_poster

Afterward, filtering by campaign shows everything the class attracted. Grouping by source shows which placement worked, and grouping the email rows by content shows whether anyone scrolls to the bottom.

For the poster, a long tagged address would make a dense code and look ugly as text. A short path on the bakery's own site, such as /class, can redirect to the tagged version. The bakery can later point that path somewhere else without reprinting anything.

Before publishing, someone clicks all five links, confirms the page loads, and checks that the visit shows up in the analytics tool's real-time view with the expected names.

Side effects for your website

Extra parameters can disturb a few things.

Search indexing. The same page now has many addresses. A canonical link element pointing at the clean URL tells search engines which one to treat as primary.

Caching. A cache or CDN may treat each query string as a separate page, lowering the hit rate. Many can be configured to ignore UTM parameters when building the cache key while still passing the address to the browser.

Redirects. If the landing page redirects, make sure the query string survives the hop. A redirect that drops it erases your attribution. Test the final address in the browser after clicking.

Applications. Strict routing code occasionally rejects unknown parameters. Click every tagged link once before sending it.

Order matters in one respect: parameters go before any # fragment. A tag placed after the fragment isn't part of the query and is usually missed.

Privacy and limits

Visitors see these labels, and they copy and share them. Don't encode names, email addresses or account numbers, and avoid internal notes such as a discount strategy or an unflattering segment name. Many analytics terms of service also forbid sending personal data.

When someone forwards your tagged link to a friend, the friend's visit is credited to your newsletter. Some browsers and privacy tools strip tracking parameters, block analytics scripts or both. Consent rules in some places mean analytics doesn't run until a visitor agrees. Treat totals as indicators and compare like with like.

Clicks and visits will rarely match. Email security scanners may open links automatically, and some people leave before the script loads. Privacy-friendly analytics discusses lighter ways to measure.

Turn reports into decisions

Decide what you want to learn before the campaign goes out. "Which newsletter section earns more sign-ups?" calls for distinct utm_content values and a conversion event such as a completed form.

Compare outcomes rather than visits alone. A source that sends fewer people who actually buy or subscribe may deserve more effort than a noisy one. Small numbers swing widely by chance, so be cautious about declaring a winner from a handful of conversions.

Attribution models also differ. One tool may credit the first touch, another the last, another may share credit. Read how yours assigns it before drawing conclusions.

When the numbers look wrong

A few symptoms point to specific causes.

Nothing appears for a campaign. Open the link and watch the address bar. If the tags vanish on arrival, a redirect is dropping them. If they stay, check that the analytics script loads on the landing page and that you accepted its consent prompt while testing.

The same source appears several times. Capitalization or spelling differs between links. Fix the links going forward; historical rows usually stay as recorded, though some tools can merge them in reports.

Email traffic shows as direct. One link in the message was left untagged, or an older template still carries plain addresses.

Your own team inflates a campaign. Internal testing counts too. Use your tool's internal traffic filter where it has one.

A sudden spike never converts. Automated link checkers and bots may be requesting the tagged address. Look at time on page, location patterns and your server logs before crediting the source with real interest.

Common questions

Do UTM parameters hurt search rankings?

They're meant for campaign links, and with a correct canonical tag they shouldn't cause problems. Keeping them off internal links avoids creating many duplicate paths for crawlers.

You can use a short link or a redirect on your own domain such as example.com/spring, which forwards to the tagged address. It looks cleaner on print and you control it.

Written for 4Internet with AI writing tools and not reviewed line by line by a person. Check anything you rely on with the maker, provider or standard concerned. Report an error.

Keep reading

All 45 articles in Developer & Network Tools →

Latest news on this topic