How to Create UTM Tracking URLs on Google Analytics
How do you know if Facebook is a worthy investment, or if you’re getting enough traffic from your recent promotional campaign? The answer: UTM tracking links.
UTM codes help you track where traffic is coming from, allowing you to properly measure each campaign’s, platform’s, or medium’s ROI.
In this blog post, you’ll learn what UTM codes are, how to use them, and how to build them in both Google Analytics and HubSpot.
A UTM (Urchin Tracking Module) code is a snippet of text added to the end of a URL to track the metrics and performance of a specific digital marketing campaign. UTM codes can contain up to five parameters: Campaign, source, medium, content, and term.
UTM codes are also known as UTM parameters — or tracking tags — because they help you “track” website traffic from its origin. Marketers customize this text to match the webpage the tagged URL is linked on, in order to attribute the success of that campaign to specific pieces of content.
Now, you might be thinking, “Ginny, I have HubSpot, so I already know if my website traffic is coming from Google, email, social media, and similar marketing channels. What does a UTM code tell me that I don’t already know?”
HubSpot Marketing Hub provides you with these high-level sources of traffic, but UTM also helps you drill down into specific pages and posts within these traffic sources. If you’re promoting a campaign on social media, for example, you’ll know how much traffic came from social media. Building a UTM code, however, can tell you how much of that traffic came from Facebook or even a particular post on Facebook.
UTM Code Example
UTM codes can be overwhelming at first, so let’s take a look at an example. Here’s a URL with its own UTM code:
Let’s break this link down.
- http://blog.hubspot.com/9-reasons-you-cant-resist-list: This is the base URL of the page.
- ?: This signals to your analytics software that a string of UTM parameters will follow.
- utm_campaign=blog_post: This is the first UTM parameter, specifically for the campaign the visitor engaged with (in this case, a blog post campaign).
- &: This denotes that another UTM parameter will follow.
- utm_medium=social: This is the second parameter, specifically for the channel the visitor came from (in this case, social).
- &: This denotes that another UTM parameter will follow.
- utm_source=facebook: This is the last parameter, specifically for the specific website the visitor came from (in this case, Facebook).
In the example above, you’re saying that once traffic comes in from people who click this link, the traffic should be attributed to Facebook. The “medium” is social media, while the “source” is Facebook.
Adding these snippets of code after the question mark above doesn’t affect anything on the page — it just lets your analytics program know that someone arrived through a certain source inside an overall marketing channel, as part of a specific campaign.
UTM Code Benefits
As we’ve already covered, UTM codes are small snippets of code that you can add to the end of a URL to track where website traffic is coming from. They may seem small, but they bring big benefits to marketers. Here are just a few:
- Better tracking: UTM codes allow you to track exactly where your website traffic is coming from, so you can see which marketing tactics are actually driving results. With UTM codes, you can see which sources, mediums, and campaigns are bringing in the most traffic, leads, and sales.
- More accurate attribution: UTM codes also allow you to give credit where credit is due. For example, if a visitor first finds your website through a Google search, then comes back later through a Facebook ad, you can see the entire customer journey and attribute the sale or conversion to both channels.
In summary, UTM codes are a simple but powerful way to get more insight into your website traffic and marketing campaigns. They allow you to track sources and mediums more accurately, and give you a clear picture of which channels are driving the most value for your business. By using UTM codes consistently, you’ll be able to make smarter marketing decisions and optimize your campaigns for better results.
With that, let’s dive more deeply into the ways UTM code links help marketers accurately attribute lead sources.
How do UTM links help marketers?
Crucial aspects of being a great marketer are being able to measure your success and measure your impact. No matter which metrics you use, you want to prove to your boss (and the company) that you’re worth your salt.
You deserve your budget — and maybe need more of it — and you deserve to dedicate time to the marketing activities that work. Building UTM codes that track your campaigns’ success is the best way to prove it.
Relying on your analytics tool’s source and medium breakdown isn’t enough to prove whether a certain strategy is working. UTM links provide more granular data that allow you to drill down to the specific source of the traffic. You can use the following UTM parameters, which we’ll cover in more detail later:
With that in mind, UTM tracking codes can help you determine:
1. Where the traffic is coming from (Source).
First up, you’ll be able to tell the specific website the traffic is coming from. Examples include:
- Social websites (Instagram, Facebook, Pinterest, YouTube, LinkedIn, etc)
- Search engines (Google, Bing, Yahoo, etc)
- Paid posts and sponsored listings (paid ads, sponsored posts, etc)
- Other websites (your own site, competitor’s sites, publisher’s sites)
2. Which general channel the traffic came from (Medium).
It’s also important to know the general categorization of the source. That way, you can determine whether social media in general is a worthwhile investment, as an example. Organic search, social, CPC, and email are a few mediums you can use.
3. What type of content people clicked on (Content).
What gets the most clicks? An image, a sidebar link, or a menu link? You can tell this information with the content UTM parameter. This is essential for determining whether you need to add more images, for instance, or improve your sidebar link structure if no clicks are coming through that content.
4. Which term they used to access the page (Term).
UTM links can also help you see which terms are driving traffic to a specific page. By using the term parameter, you can determine which keywords are driving the most traffic to you, and which need more love.
Putting it all together, here’s what a UTM-tracked URL can look like:
Now, let’s take a closer look at the definition of UTM tracking and the UTM parameters you can use.
UTM tracking entails adding a UTM code, a snippet of code, to the end of a URL in order to track the performance of your marketing campaigns and content as well as your website’s traffic sources.
UTM Parameter Examples
UTM codes can track a medium and a source within that medium. Where it gets more flexible is in the language you use to describe that source. Maybe you want to attribute website traffic to a social network, a type of content, or even the exact name of an advertisement on the web.
Here are the five things you can track with UTM codes and why you might track them:
Campaign-based tracking tags group all of the content from one campaign in your analytics. The example UTM code below would help you attribute website traffic to links that were placed as a part of a 20% discount promotion you’re hosting.
A source-based URL parameter can tell you which website is sending you traffic. You could add the example code below to every link you post to your Facebook page, helping you to track all traffic that comes from Facebook.
This type of tracking tag informs you of the medium that your tracked link is featured in. You can use the example UTM code below to track all traffic that comes from social media (as opposed to other mediums, like email).
4. Piece of Content
This type of UTM code is used to track the specific types of content that point to the same destination from a common source and medium.
It’s often used in pay-per-click (PPC) campaigns or with two identical links on the same page, as shown in the sample UTM code below.
Example: utm_content=sidebar_link or utm_content=header_link
A term- or keyword-based tracking code identifies the keywords you’ve paid for in a PPC ad. If you pay for a Google Ads campaign to rank under the keyword, “marketing software,” you might add the following UTM code to the end of the link you submit to Google to run this ad.
The best part about UTM parameters is that you can make any combination you like of these codes — use the bare minimum (campaign, source, and medium) to track all of your links, or use all of them to get super specific about your tracking.
Okay, so you’re on board with UTM codes … but how the heck do you set them up? It’s easy.
Below are instructions for setting up and measuring UTM parameters in Google Analytics and HubSpot.
How to Build UTM Codes in Google Analytics
Here are the steps involved in building UTM codes in Google Analytics.
1. Open Google’s Campaign URL Builder.
There are three different types of tracking tags you can create in Google, two of which help you track traffic to new apps on app marketplaces. You’ll be using the Google Analytics Campaign URL Builder — the third option on this list.
2. Fill in each link attribute in the following form.
Visit the page linked above and click the link to see this URL builder. Then, you’ll see the UTM builder shown below. Add the URL, Campaign, Source, and Medium information into their respective boxes.
3. Use the link in your marketing campaign.
If you’d like to shorten it, you’ll need a tool like bit.ly … or just use HubSpot’s URL Builder if you’re a HubSpot customer.
4. Measure your success.
If you already have Google Analytics set up for your site, Google will automatically track incoming campaigns. Like in HubSpot, you can access them under “Audience,” then “Sources,” then “Campaigns.” Click on each campaign to view the source and medium.
And that’s it — you’ll have custom tracking codes set up and running in no time! In a few weeks, you’ll be able to make a case for what you need because you’ll have the right metrics available.
How to Build UTM Codes in HubSpot
Here’s how you’d go about building UTM codes in HubSpot.
1. Navigate to your Analytics Tools.
In your Marketing Hub dashboard, select “Reports” on the top navigation bar. Then select “Analytics Tools” in the dropdown, as shown below.
2. Open the Tracking URL Builder.
In the menu of analytics tools that appears, look to the very bottom-righthand corner. You’ll see the option, “Tracking URL Builder.” Click this option at the bottom of the page, as shown in the red box below.
3. Open the Tracking URL form to create a new UTM code.
Whenever you create a web campaign that includes at least one UTM code, you’ll see this campaign listed on the page shown below.
This page outlines a tracking tag’s source, medium, term, content, and creation date, which you can see along the bottom of the screenshot below. Click “Create Tracking URL” in the top-righthand corner.
4. Fill in each attribute of your UTM code and click “Create.”
In the form that appears, fill in the URL, Campaign, Source, and Medium fields. If you’d like to add Content and Term, you can do so in the bottom two fields of this form. When you’re done, you’ll see an orange “Create” button become available at the bottom.
Click it, and HubSpot will log your UTM code as a new campaign, and this link will be ready to include on any webpage from which you want to track the traffic.
5. Use the shortened link in your marketing campaign.
6. Measure your success.
You can track your UTM parameters in your Traffic Analytics dashboard under “Other Campaigns,” as shown below. Click on the individual campaign to break down the source and medium.
As you can see in the second image, below, the name of the campaign appears to the left — based on the text in the UTM code you created — with the traffic from people who used each URL to arrive at your campaign’s main webpage.
Now that you know how to set up UTM links, how do you use them? Let’s take a look.
How to Use UTM Links for Your Campaigns
You can use a combination of UTM codes and parameters in a lot of ways. Here’s how you can use them in your day-to-day as a marketer.
1. Track the success of a promotional campaign.
Dropping product prices or launching a new product can be daunting, because if there’s no measurable ROI, it’ll be wasted effort. Luckily, you can tell whether users are effectively arriving to your site from your promotional efforts using UTM codes.
Here’s one example for a product launch:
Or, if you’re running a discount campaign through Instagram influencers, here’s what a UTM link can look like:
2. See how well your social channels promote your content versus when your followers promote your content.
How do your organic social efforts stack up against your followers’ promotional efforts? You can create two UTM campaigns to find out.
For your own posts, you can share a link as follows:
Then, prompt your followers to share the word about you, but let them share the following link:
3. Measure the effectiveness of guest posting referral traffic.
If you’re guest posting on several industry websites, it’s essential to know whether those posts are driving traffic to your site. Guest posting can be a time-consuming, costly endeavor, especially if you’re paying a freelance writer or for a spot on the publication.
Whenever you create a guest post for another publisher, ensure all the links pointing to your website on that post have UTM parameters that tell you where the traffic came from. Here’s one example:
4. Track the same piece of content across multiple marketing channels.
This is probably one of the most useful ways to use UTM tracking codes: Creating different ones for the same piece of content, and using it across different platforms. You can drop the campaign parameter for this use case, and simply track the medium, source, and content.
Let’s say you want to track referral traffic from a video you posted on LinkedIn, YouTube, and Facebook. Here are the three different links you could use:
5. See where most people click on your internal links in a blog post.
Is your internal linking strategy working as intended? You can track where your content gets the most clicks by adding UTM parameters. Here are three examples:
Above the Fold: mywebsite.com/my-content?utm_source=blog&utm_content=above_the_fold
Bottom of the Post:mywebsite.com/my-content?utm_source=blog&utm_content=bottom
Note: Use this strategy with caution, as using too many UTM parameters in internal links can cause confusion to Google. You should use it on a small batch of internal links, collect the clicking patterns, delete the UTM links, and then act on those results for your future internal linking efforts.
As always, ensure that you’ve set a canonical URL for each link to minimize confusion and prevent duplicate indexing.
UTM Tracking Best Practices
UTM tracking URLs are a powerful marketing tool, but to get the most out of them, it’s important to follow some best practices. Here are a few tips to keep in mind:
1. Create consistent UTM tracking codes.
Make sure your URLs and links are consistent, clean, and easy to read. I’d even recommend creating a standard for link tagging, or a UTM parameter guide (kind of like a brand style guide) to ensure consistency across platforms and campaigns.
For example, for monthly newsletters, you might choose to always input the “utm_medium=email” in the medium parameter and use the “utm_campaign=monthly_newsletters” in the campaign parameter.
Then, for all Facebook posts, you would always use “utm_medium=social” in the medium parameter and “utm_source=facebook” in the source parameter. Same for paid ads: You would always opt for “utm_medium=cpc” in the medium parameter and “utm_source=google” in the source parameter.
By using the same UTM parameters for similar campaigns, you can ensure that all data is accurate and easy to analyze when it’s time to calculate your ROI and put together marketing reports. This allows you to make data-driven decisions about which campaigns are most effective.
2. Capitalize your UTM codes carefully, or not at all.
UTM codes are case-sensitive, so stick with either all lowercase or uppercase. Lower case is easier to remember, because that way you don’t have to wonder whether only the first letter or the whole parameter is capitalized.
It’s not just beneficial for remembering your UTM tags easily. Having a standardized way of tagging your links makes it much easier to review and analyze your overall marketing efforts.
Plus, you’ll avoid annoying discrepancies in your website analytics. Inconsistent capitalization can create duplicate entries or split data across different channels, making your data difficult to analyze.
With consistent capitalization, you can more accurately monitor and analyze the performance of your UTM-tagged links, improving reporting across all campaigns and channels.
3. Keep names short but descriptive.
When creating UTM parameters, make the names short but descriptive. That way, your UTM codes are easier to read and remember. They also take up less space in blog posts and social media updates, ultimately making the links look clean, attractive, and professional.
But the most important benefit is that you can avoid any confusion or mix-ups between campaigns with similar names. Clear and concise UTM codes can make it easier to differentiate between similar campaigns, which is especially critical if your team runs a large volume. You really want to be specific with your parameters so your tags clearly state what you’re tracking and where.
For instance, let’s say you’re launching a new ebook as part of an email marketing campaign. A short but descriptive UTM code for this campaign might look like this:
In this example, we have used short, but meaningful names as UTM parameters. You can’t possibly get confused — unless you’re launching two ebooks at the same time. (In which case, you might differentiate your UTM parameters with each book’s name!)
4. Keep a running list of your UTM links in an accessible location.
Creating yet another spreadsheet may make you cringe, but hunting down a wide variety of UTM-tracked links is what’s sure to give you a headache. Keep a list of your UTM links so everyone on your team knows which tagged links currently exist.
I recommend maintaining your list on a cloud-based platform such as Google Sheets (as opposed to keeping it in a local Excel file), then splitting the links by campaign or platform. That way, it’s easier to see all of your links depending on your preferred categorization.
Having a running list will also prevent your team from creating duplicate UTM codes for the same campaign, which can skew your analytics data and create unnecessary confusion. With a running list, everyone on your team will have an easy reference point to ensure they are using correct UTM codes for new campaigns.
You’ll also be able to manage and maintain the codes themselves, which is critical when campaigns are changed or discontinued. In your spreadsheet, you can easily update, modify, or delete UTM tracking codes as needed.
5. Connect UTM tracking codes to your CRM or marketing tool.
Adding your UTM tracking URLs to your CRM or marketing tool is essential. (If you’re not sure of what that can look like, here’s an example of how to do it in HubSpot.) By doing so, you’ll be able to better understand the customer journey, accurately attribute sales and conversions, and make decisions based on data.
Taking this step may feel unnecessary, but linking your UTM codes to your CRM will allow you to better track the customer journey from first-touch to conversion. By tracking which campaigns and channels drive the most website traffic, you gain a better understanding of which of your marketing efforts effectively reach and engage your audience.
As a result, you’ll be able to identify trends, assess performance over time, and make informed decisions based on the success of past campaigns.
Start Creating UTM Tracking URLs
Use the steps, best practices, and tools above to start creating and using UTM tracking URLs so you’re able to track the performance of your marketing campaigns and content. That way, you can reliably boost your metrics and improve the ROI of your digital marketing strategy.
Editor’s note: This post was originally published in September 2013 and has been updated for comprehensiveness.