Back to Blog

UTM Tracking: What Are UTM Codes and How Do I 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?

There is an old Peter Drucker quote – "what gets measured gets managed" – that is more applicable than ever to modern agencies. 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.

In this post, I'm going to help you understand UTM codes and show you how to use them to track your marketing performance.

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.

UTM stands for "Urchin Traffic Monitor". This name comes from Urchin Tracker, a web analytics software that served as the base for Google Analytics.

A UTM code looks something like this:

http://yourwebsite.com/your-post-title/?utm_source=google

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: utm_source, utm_campaign, utm_content, 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.

UTM codes can be long and complex. Take, for instance, this Inbound.org URL (from a Facebook post click):

utm-code-2

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.

Example: &utm_source=twitter

2. Medium

The medium parameter tracks what type of traffic the visitor originated from – cpc, email, social, referral, display, etc. The parameter is utm_medium_

Example: &utm_medium=cpc

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.

Example: &utm_campaign=example-campaign

4. Content

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.

Example: &utm_content=navlink

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.

Example: **&utm_term=growth+hacking+tactics

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.

yoursite.com/your-page/?utm_campaign=spring-sale2018

By adding the utm_campaign parameter, we can track the performance of our "Spring Sale 2018" 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:

yoursite.com/your-page/?utm_source=facebook&utm_medium=cpc &utm_campaign=spring_sale&utm_content=shoe_ad

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.

utm-code-in-ga

How to create UTM codes ?

There are multiple ways to create UTM codes. Below, I'll cover the most popular ones:

1. Manual Method

There is nothing technically complicated about UTM codes. Your first option is to manually add the parameters.

This is as simple as typing in individual parameters at the end of your URL. The tricky part here is not making any errors! UTM codes can get pretty lengthy and you're bound to make mistakes, so I generally don't recommend the manual method.

However, if you simply want to add the name of a campaign or source to the end of a url, typing it out is a simple option.

For example, suppose I'm submitting a guest post and want to track the number of clicks my author bio link receives.

Thus, I might add a URL like this to my bio:

http://mysite.com/page/?utm_source=blogsite.com&utm_content=author_bio

2. Google URL builder

Google's URL builder gives you a quick way to create UTM codes. You can find this tool here.

To use it, simply enter your website address. You are required to enter the campaign source (so that you can keep track in All Traffic -> Source/Medium); the rest of the parameters are optional.

agency-analytics-ga

After entering your desired parameters, scroll down to see your URL.

ga-utm-code

Copy and paste this link with the UTM code into your campaign or content.

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.

referral 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 categorized as "direct".

For example, if you write an ebook that includes links to your website, add UTM codes to those links like the following:

  • *mywebsite.com?utm_source=ebooks&utm_campaign=agency_playbook

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:

  • utm_source=mailchimp&utm_campaign=newsletter1&utm_content=shoes
  • utm_source=mailchimp&utmp_campaign=newsletter1&utm_content=jackets

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 recognize as "social" in GA, such as imgur.com?

imgur-referral

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 utm_medium=cpc or utm_medium=cpm to your Facebook Ads url, you can group all paid traffic into one report.

facebook url parameters

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:

  • utm_campaign=20off&utm_source=facebook
  • utm_campaign=20off&utm_source=googleplus&utm_content=first-link

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:

  • utm_campaign=persona1
  • utm_campaign=persona2

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

https://inbound.org/article/is-linkedin-killing-slideshare?utm_medium=paid&utm_campaign=facebook-worldwide-loggedinusers30days-np-allseg&utm_source=facebook.com&utm_term=linkedin

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:

https://www.goibibo.com/offers/?utm_source=Mailers&utm_medium=_ ret_harvest_130117&utm_term=ret_harvest_130117 &utm_campaign=_ret_harvest_130117

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 Goo.gl or 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.

bitly

Over to you

Just be sure to use the right naming conventions and hide lengthy links using link shorteners. We've put together a naming conventions template for you to establish your naming rules and share it with your team.

What are you going to start tracking? How do you use UTM links? Let us know in the comments!

Learn How to Build & Scale Your Agency

Receive weekly updates with actionable advice on growing your agency