UTM tags
| What UTM tags are | |
| The parameters | |
| Examples | |
| Where they show up | |
| Rules |
What UTM tags are
UTM tags (Urchin Tracking Module) are parameters added to a link to tell where a visitor came from: which site, which kind of advertising, which campaign. The name comes from Urchin, a web analytics company that Google bought in 2005 and turned into Google Analytics.
Technically they are ordinary query parameters after the ? of a URL. The page itself ignores them; the analytics script on the page reads them.
The parameters
Five classic parameters, in any order:
| Parameter | Tells | Example |
|---|---|---|
| utm_source | The site or service the visitor came from | utm_source=newsletter |
| utm_medium | The kind of channel: paid click, email, social | utm_medium=cpc |
| utm_campaign | The campaign | utm_campaign=spring_sale |
| utm_term | The paid search keyword | utm_term=running+shoes |
| utm_content | Which link or banner was clicked, to tell apart links in the same ad or email | utm_content=logolink |
Google Analytics 4 also reads utm_id, utm_source_platform, utm_creative_format and utm_marketing_tactic.
Examples
Two tags, for a link in a newsletter:
https://www.example.com/spain/?utm_source=newsletter&utm_campaign=web_utm
All five, for a link posted in a social network by a scheduling tool:
https://www.example.com/bikes/?utm_source=example.org&utm_medium=social&utm_campaign=buffer&utm_content=buffercf3b2&utm_term=city+bike
Spaces and other special characters in a value must be encoded, as + or %20; see URL encoding.
Where they show up
Google Analytics, Yandex Metrica and most other analytics tools read the tags and build reports by source, medium and campaign; with goals they show which campaign brings the visitors that buy, see Yandex Metrica: goals.
The tags also stay in the request line of the web server log, so they can be counted without any analytics. On a typical Linux server with Nginx:
grep -o 'utm_source=[^& ]*' /var/log/nginx/access.log | sort | uniq -c | sort -rn
Rules
- Tag links that lead to your site from outside: ads, emails, posts. Never tag links inside your own site; a visitor who clicks one starts a new visit with a false source.
- Agree on the spelling: Email and email are two sources in the reports. Lowercase everything.
- Pages with tags are copies of the same page for a search engine; a canonical URL keeps them out of the results, see Canonical page.
Article authors: Andrei Olegovich, Klavdiya Kondakova