What you need
A landing page URL, a campaign name and the place each link will appear (newsletter, post, ad). Everything runs in your browser; the URLs you enter are never sent anywhere.
The five UTM parameters
| Parameter | Answers | Example |
|---|---|---|
utm_source |
Where did the visitor come from? | newsletter |
utm_medium |
What kind of channel was it? | email |
utm_campaign |
Which campaign? | spring_sale |
utm_term |
Which paid keyword? (optional) | running_shoes |
utm_content |
Which link or ad variant? (optional) | header_button |
A worked example
Starting from https://example.com/spring-sale?ref=home, a link placed on a button in the newsletter header becomes:
https://example.com/spring-sale?ref=home&utm_source=newsletter&utm_medium=email&utm_campaign=spring_sale&utm_content=header_button
The original ref=home parameter is kept, and the tags are separated by &. In a URL the query string always comes before any #fragment, so the tags must go before the #.
Common pitfalls
- Inconsistent spelling.
Email,emailande-mailshow up as three different mediums. Use one convention. - Tagging internal links. It overwrites the real traffic source. Tag only external links.
- Putting personal data in a tag. UTM values appear in analytics reports and sometimes in referrer logs. Never put names or email addresses in them.
- Forgetting that tags are visible. Anyone can see the parameters in the address bar, so do not put anything confidential there.
- Breaking the URL with raw characters. Spaces,
&and#inside a value must be percent-encoded.
Going further
How query strings are structured and encoded is covered in How URLs and Query Strings Work.