UTM codes and how to use them. As a marketer, you know that your marketing is driving traffic to your client’s websites, but do you have the hard data to prove it? On a client call, can you show which exact tweets or guest posts generated leads, and which ones failed? Unless you can measure the impact of your marketing, you can neither improve it nor use it as proof of your work.
This is where UTM tracking comes into play. These special codes can be added to the end of any URL to track clicks and performance of marketing activities.
What are UTM codes?
A UTM code is a snippet of simple code that you can add to the end of a URL to track the performance of campaigns and content. There are 5 variants of URL parameters you can track – source, medium, campaign, term and content. Dimensions you track via UTM codes show up in your analytics reports to give you a clearer insight into marketing performance.
A UTM code looks something like this:
The part in red starting after ‘?’ is the UTM code. As you might have guessed, this particular code tracks who sent the traffic to the page (i.e. the source).
The UTM code itself has two components:
UTM Parameter – that starts with utm. There are 5 separate parameters you can track: utmsource, utmcampaign, utmcontent, utm_term (more on these below).
Tracking variable – a unique variable to identify the dimension being tracked (such as the name of the traffic source). This variable is preceded by the “=” sign. You can have only numbers, letters, hyphens, ‘+’ sign and periods in the variable.
This code tracks multiple variables, such as traffic source, traffic campaign, etc.
Adding the UTM code doesn’t impact the actual page. You can very well delete the UTM code from the URL and the page would continue to load normally.
The code only serves one purpose: to help your analytics tool track the source of your visitor.
For agency marketers, this means that you can use these codes to calculate the impact of your campaigns. If you’ve ever struggled with marketing attribution, UTM codes will come extremely handy.
What can you track with UTM codes?
There are five different UTM parameters. The first 3 are by far the most used parameters (Source, Medium, Campaign), but for additional insights you may also choose to track all 5. Here’s exactly what you can track with each:
1. Traffic Source
The source parameter allows you to track where the traffic originated from. The parameter added to your url is utm_source. Sources you may track could be facebook, google, bing, inbound.org, or the name of an email list.
The medium parameter tracks what type of traffic the visitor originated from – cpc, email, social, referral, display, etc. The parameter is utmmedium
3. Campaign Name
The campaign name parameter allows you to track the performance of a specific campaign. For example, you can use the campaign parameter to differentiate traffic between different Facebook Ad campaigns or email campaigns. (See more on naming conventions below on The parameter is utm_campaign.
In case you have multiple links pointing to the same URL (such as an email with two CTA buttons), this code will help you track which link was clicked. The parameter is utm_content.
5. Keyword Term
The keyword parameter allows you to track which keyword term a website visitor came from. This parameter is specifically used for paid search ads. The parameter is utm_term.
How to Use the UTM Codes
You can use these codes in any combination by separating each parameter with the ‘&’ sign.
Thus, you might have a simple URL that simply wants to track visitor actions from an email campaign.
By adding the utm_campaign parameter, we can track the performance of our “Spring Sale 2022” email campaign in Google Analytics.
Do you want to know how many sales were generated from an email campaign? UTM links are your answer.
You may also choose to have a more complex code that tracks multiple parameters. Here is an example of tracking the source, medium, campaign name, medium and content:
Once you add the UTM code to your campaign’s URL, you can track the performance in Google Analytics in a few different reports.
Create a custom report under “Customization” > “Custom Reports”. Add Medium, Campaign, or Source as a dimension and the metrics you want to view.
Go to Acquisition → Overview → All Traffic → Source/Medium to view traffic
Go to Acquisition → Campaigns → All Campaigns to view traffic based on your custom campaign names.
Ways to use UTM tracking
You now know what UTM codes are, what you can track and how to create them, the most important question still remains: how should you actually use UTM codes to track your marketing campaigns?
There are essentially three ways you’ll want to use these codes:
1. Know where your traffic is coming from
The top reason to use UTM tracking is to know exactly where your website traffic comes from. You can accomplish this by using the campaign, source, and medium parameter.
Google Analytics displays default channel groupings in their interface.
However, by using UTM parameters, you can track sources with more precision. UTM tracking is especially helpful to understand your referral and direct traffic in Google Analytics.
In Google Analytics, you can navigate to Acqusition -→ All Traffic -→ Referrals to see which sites generated traffic.
In this sample account, we see referral traffic from Quora.com.
However, what if you wrote 10 posts on Quora and you want to know exactly which post generated traffic?
By adding &utm_campaign=name-of-post to the end of your link on Quora, you can see in Google Analytics which posts generated traffic.
Direct Traffic is often another mysterious traffic source in Google Analytics. It primarily includes visitors that type your url directly into their browser or bookmarked your page.
But, direct traffic also includes visitors that clicked links in emails, ebooks and other offline marketing materials.
Add UTM links that specify the source of traffic that would otherwise be categorised as “direct”.
For example, if you write an ebook that includes links to your website, add UTM codes to those links like the following:
In Google Analytics you can filter your traffic by source to understand how your ebook performed in generating traffic and new leads.
2. Know which links people are clicking in a campaign
Suppose you run a newsletter for your client. Every week, you send out half a dozen links to interesting stories from around the web. In-between, you also include a couple of CTAs to your client’s site.
You probably already know the newsletter open and click rates. But do you know which links in your newsletter get the most clicks, and which get ignored?
This is another situation where UTM codes come in handy.
By adding the utm_content parameter to different links in the newsletter, you can track the number of clicks they receive:
Thus, a shopping newsletter might have two separate codes for shoes and jackets, like this:
Now when you log into Google and go to Acquisition → Overview → Campaigns → All Campaigns, you’ll be able to see which link in your “Newsletter1” campaign drove more traffic.
There are countless ways to use this UTM parameter. For instance, you might create separate utm_content codes for individual banners in a banner ad campaign. Or you might add a custom code to your email signature link to track its total clicks.
3. Group traffic by medium
Suppose you’re running a social media marketing campaign for a client.
As part of your marketing activities, you share your content on popular social networks – Facebook, Twitter, etc. These show up under the “Social” channel in Google Analytics
However, what if you promoted the content on social networks that Google doesn’t recognise as “social” in GA, such as imgur.com?
In such a case, you’d have no way to show your social marketing results.
This is where you can use utm_medium. By adding utm_medium=social to all links you share on any social channel, you can track your performance across all social networks.
You’ll find that the utm_medium parameter is particularly useful for doing a macro-level analysis of traffic patterns. You can group all links into a few broad mediums – social, cpc, search, email, referral, etc. – to measure their traffic over time.
The utm_medium parameter is especially helpful for differentiating paid traffic.
For example, all of your traffic from Facebook will appear as “social” by default in Google Analytics. If you are running paid campaigns in Facebook Ads, you don’t want that traffic grouped with your organic social traffic!
By adding utmmedium=cpc or utmmedium=cpm to your Facebook Ads url, you can group all paid traffic into one report.
4. Track traffic for different campaigns
If you had a new product launch, can you tell with certainty that the traffic came from the launch campaign? How many of your holiday marketing campaigns led to successful conversions?
Tracking these metrics is one of the hardest things for marketers. Basic GA data makes it next to impossible to figure out which marketing campaigns are driving your current results.
The utm_campaign parameter solves this problem.
For instance, if you were running a new 20% off discount campaign, you could organize all your links like this:
Here’s another example: suppose you wanted to track the marketing performance for different customer personas.
You could organize all personas into different campaigns, like this:
These are just some ways to use utm_campaign. As an agency marketer, you’ll find this parameter indispensable.
Best Practices for UTM Tracking
Before you start adding UTM codes to your campaign links, there are a few things you should keep in mind:
1. Establish a UTM naming convention from the start
It’s important to establish naming conventions that your entire team will use. If half the people on your team are using “facebook.com”, the other half using “facebook” under “utm_source”, you’ll just get muddy data.
Before you start a campaign, agree on naming conventions for common parameters. This should include the names for different mediums (“social” vs. “social media”, “search” vs. “paid search”, etc.) and traffic sources (“facebook” vs “facebook.com” or “reddit” vs “reddit.com”).
Even capitalizations or spaces will make your analytics a mess by splitting the same campaigns into two if you follow different conventions. Set up rules from the beginning.
Will you use underscores or dashes in a campaign name?
Will all links use only lowercase?
Generally, its best practice to use all lowercase in your UTM links.
2. Use easy to understand names
Your campaign, content and source links should be easy to understand. Anyone looking at the code should be able to figure out at one glance what the code means.
For instance, here is a UTM tracking code used by Inbound.org
Based on the campaign name alone, you can see that it targets worldwide Facebook users who have been logged in during the past 30 days.
Anyone can understand this UTM code even if they have no idea what’s going on behind the scenes.
In contrast, consider this UTM code:
Not only does this code use the same name for multiple parameters (term, medium, and campaign), the name itself is nonsensical. Without context, it is impossible to understand what this code is actually tracking. Sure, you can create a naming convention that associates a campaign with a numerical code. But you’re making analysis a lot more difficult by not creating an easy to understand name.
3. Use link shorteners for user-friendly URLs
The complexity of a UTM code is directly related to its length. As you start running more sophisticated campaigns, your URLs will become longer and longer.
This isn’t the best thing from a UX perspective.
The solution: link shorteners. By using a tool like Bit.ly you can turn lengthy links into more shareable URLs. The shortened link will still keep the UTM parameters in tact.
This is especially helpful for your social media posts.