Traffic attribution identifies which sources drive visitors to a web property. And it’s impossible to credit a conversion to the correct source without first knowing how a visitor got to a website.
In other words, the foundation of conversion attribution is traffic attribution. Simple as it may sound, attributing a session to its traffic source can be tricky, even impossible.
This post details the role that UTM parameters play in traffic attribution in Google Analytics. After reading this post, you’ll know more than 99% of marketers about how to use UTM parameters.
Here’s what I’ll cover:
- Why conversion attribution starts with traffic attribution
- How Google Analytics understands traffic sources
- What are UTM parameters?
- Best practices for each UTM value
- How to send multiple values through a single UTM parameter
- UTM parameter builders and related tools
- Other UTM parameter tips
Why conversion attribution starts with traffic attribution
Marketers must be able to reliably credit conversions (i.e. results) to the correct traffic source to compare the performance of marketing activities across various channels.
Imagine the following situation: A user visits a website five times before making a purchase. If we’re not tracking from which websites, which campaigns, or which channels they visit, how could we know how much of that conversion to attribute to each source?
If we can’t determine where the traffic comes from, we can neither attribute conversions to their original sources of traffic, nor can we find out the true cost per acquisition (CPA) or return on ad spend (ROAS) for each marketing activity.
Proper tracking of traffic sources delivers a clear view of the user’s purchase journey:
We can see how search engine optimization helped an in-market searcher discover our website, and how our Facebook remarketing and abandoned cart email campaigns nudged a user to come back and finish their purchase.
The above level of visibility is something that you have to plan in advance and invest in execution. It does not happen automatically.
How Google Analytics understands traffic sources
To understand how traffic attribution works in Google Analytics, we need to first understand how Google Analytics recognizes the traffic source for any given session.
Previously known as a visit, a session in Google Analytics is:
A group of user interactions with your website that take place within a given time frame. A single user can open multiple sessions. Those sessions can occur on the same day, or over several days, weeks, or months [. . .] These user interactions can be page views, events, or transactions.
Each session can have only one traffic source. To understand the traffic source of a session, Google Analytics relies on two critical pieces of information: the HTTP Referrer and UTM parameters.
1. HTTP Referrer
When someone clicks on a link to navigate from Page A (referring page) to Page B (destination page), the URL of the referring page is passed to the destination page by the browser in a field called “HTTP Referrer.”
That field is readable by a Google Analytics script (or any other script, e.g., Google Tag Manager, Facebook Pixel, etc.) that runs on the destination page.
Google Analytics uses the value of HTTP Referrer to understand which page “referred” the user to initiate the session and will identify that “referrer” website as the source of the traffic for that session.
Site visits initiated by clicking a link on another site almost always have an HTTP Referrer value. But there are cases for which a value isn’t available:
- Navigation from a secure (HTTPS) page to a non-secure (HTTP) page; for security reasons, the URL of the secure page won’t pass to the non-secure page.
- Navigation from a link on a tool that doesn’t pass the HTTP Referrer value or has no referring page (e.g., a link in a PDF or spreadsheet, or a link within an email—especially when opened in a desktop client like Microsoft Outlook or on a mobile device).
- Links shared and clicked within mobile apps and instant messengers.
- Browser bookmarks or directly entered URLs.
- Scanned QR codes.
In the absence of a value for HTTP Referrer, Google Analytics relies on a set of URL query parameters, known as UTM parameters, which allow the link to self-identify its source.
If there’s neither a value for HTTP Referrer nor any UTM parameters, Google Analytics classifies the source of traffic as Direct, which basically means it has no idea where the user came from.
2. UTM Parameters
For the reasons described above, HTTP referrer is not always available to Google Analytics, blinding us to the source of, in some cases, a large portion of our traffic.
Even when HTTP Referrer exists, it provides only one basic piece of information—the source, which can’t answer the following questions:
- Which marketing campaign was this link click a part of? You may run, for example, several Facebook campaigns.
- Which email campaign was this link in?
- Which social media post was this link a part of? We might know it was from Facebook or Twitter, but we can’t know which Facebook post, or ad, or tweet, etc.
- What was the text of the link or button that was clicked on?
- And so on.
Imagine if we could tell Google Analytics everything we know about that link—where it was shared, the campaign it was part of, the purpose of sharing it, and the anchor text or call to action (CTA).
That knowledge would allow us to understand which campaign is working, what traffic source is working, what email in an email series is doing best, or which CTA is performing better or worse.
This is where UTM parameters come to the rescue.
What are UTM parameters?
Initially created by Urchin Software, which was acquired by Google to build Google Analytics, Urchin Tracking Modules (UTMs) are a set of five query parameters that we can append to a link pointing to our website.
The five parameters are:
The first two parameters, utm_source and utm_medium, are required; having a value for utm_campaign is highly recommended.
For example, imagine it’s mid-November and you share a link in a Facebook group to drive traffic to your winter sale promotion. The CTA is “Shop Now 40% Off.”
The UTM Parameters on the link might look like this:
Why are UTM Parameters important?
UTMs are the building blocks of traffic and conversion attribution. They help:
- Identify sources of traffic and their properties;
- Organize incoming traffic into meaningful buckets;
- Attribute results (conversions) to the correct traffic sources.
By developing and following a proper strategy to add UTM parameters consistently to your inbound links, you not only gain clarity into your traffic sources, but you also save time and money cleaning up your data in the future.
A link that is properly tagged with UTM parameters helps you answer the following questions:
- Where is the traffic coming from? The utm_source value tells Google Analytics the name of the website with the link that the user clicked.
- How are they arriving at our website? The utm_medium value identifies the communication channel used to create the source.
- For what reason are they coming to our website? The utm_campaign value identifies the marketing campaign or promotion responsible for the click.
- What keyword exactly? The utm_term value is used mainly to identify the search term, but it can also be used to pass similar information, like the CTA on the link.
- What else do we know about that link? The utm_content value sends more information about the link that was clicked on. This can be the type of link (e.g., image vs. text vs. button), the placement of the link within a document, the variant in an A/B test, etc.
In the following sections, I describe—in detail—what each of these UTM parameters are used for, their best practices, and some criteria for deciding which values to use for them.
That knowledge will help you go from mere identification to high-value analysis.
From UTM identification to UTM-based analysis
While it’s nice to identify the source, medium, campaign, and other properties of a single click, serious analysis requires organizing traffic into meaningful categories based on their shared properties.
For example, if UTMs only identified the properties of each click to a website, we could freely use any of the below values to identify traffic generated from a Facebook ad:
- Possible values for utm_source: Facebook, facebook, facebook.com, FB, fb, FB-Ad, facebook Ad;
- Possible values for utm_medium: Ad, PPC, CPC, PAID, Paid, cpc, paid-ad, ppc, ad.
Any of these values can identify the source to be Facebook and the medium to be some kind of paid traffic acquisition. But identification is not organization.
Imagine if each person, team, or media buyer responsible for running Facebook Ads could decide which combination of values they prefer. We’d end up with a report that looked like this:
Not so useful, right? What we want to see is the total of those rows:
That allows us to compare Facebook ads to other paid campaigns:
Without a consistent value of “cpc” for utm_medium and the name of the platform in lowercase as the utm_source (Google Analytics is case sensitive!), we would never get a clean report.
Always use the same value for the same entity. Once the values pass into Google Analytics, you can’t go back in time and fix inconsistent ones. At scale, a disorganized system of UTM parameters can easily ruin the integrity of your analytics reports.
A few overarching standards can help you avoid that catastrophe.
Standards for all UTM parameters
There are some immediate ways to improve your UTM tracking, no matter how you decide to do it (or which parameter you’re using):
- Use lowercase whenever possible—“Email,” “email,” and “eMail” are considered three values in Google Analytics. (The exception is if you need to join data from Google Analytics to another tool for analysis or enrichment. The caveat doesn’t apply to utm_source and utm_medium, which should always be lowercase.)
- Use dashes instead of white spaces in your parameters.
- Don’t use punctuation or special characters.
Sometimes, it’s impossible to control all values passed into Google Analytics through UTM parameters. People make mistakes, and some tools don’t allow custom UTM parameters.
In those cases, you can create filters in Google Analytics to convert campaign values to lowercase and keep traffic reports clean and consistent.
Once you have unique values for each UTM parameter, create a custom UTM-tagging strategy for your organization, as well as a central document that’s accessible to all team members.
Here’s how to decide what to use for each.
Best practices for each UTM value
The value of utm_source should be the name of the platform or tool that’s used to create the medium (e.g., Facebook, YouTube, Google, or, in case of email traffic, Mailchimp, ActiveCampaign, InfusionSoft, Drip, etc.).
The utm_source value is required along with utm_medium. If utm_medium is omitted, utm_source will be ignored, too. Traffic will be reported as Direct.
If present, utm_source will take precedence over the HTTP referrer. Imagine a link from John’s blog (blog.com) to your website (site.com) with the following URL:
If there were no UTM parameters, the value of the HTTP Referrer, blog.com, would be the source of traffic. But because there’s a value for utm_source, it will override the HTTP Referrer, and Google Analytics will report the source of traffic as “johns-blog,” and not “blog.com.”
In the absence of utm_source, the top-level domain of the HTTP Referrer will be reported as the source. For example, for Facebook traffic, the source will be reported as facebook.com.
If neither utm_source nor HTTP Referrer is present, the source for the session will be reported as Direct, which we’ll cover in more detail later.
A note on utm_source for email campaigns
When it comes to email, some marketers prefer to insert the name of the email list or newsletter as utm_source instead of the name of the email service provider (e.g., “newsletter” instead of “mailchimp”).
It’s even recommended in Google’s documentation (emphasis added):
Every referral to a website has an origin or source. Possible sources include: “google” (the name of a search engine), “facebook.com” (the name of a referring site), “spring_newsletter” (the name of one of your newsletters), and “direct” (users that typed your URL directly into their browser, or who had bookmarked your site).
The idea goes back to a time when email was mostly for sending newsletters, and email automation tools weren’t yet popular.
The approach might make sense if you want to report only on email traffic performance—not to compare email with other sources and mediums. But the approach has issues.
Imagine you have 20 lists (and growing) in your email marketing tool. In this case, you introduced 20 new rows to your report: list-01, list-02, etc., which are reported alongside the name of other tools and websites.
When looking at the list of sources and the amount of traffic from each, you’re no longer comparing apples to apples—unless the report is filtered to include only email traffic.
In addition, if you use different platforms to send emails (your CRM, your shopping cart, and an email automation service), then you won’t know from which service the email was sent. When issues arise, finding and fixing the exact email wouldn’t be easy.
The name of the email service provider should be consistent with the values for other types of traffic, and the newsletter people subscribed to (or their behavioral or RFM-based segment—comparable to the target audience of an ad) should go in utm_content (more on that later).
The utm_medium value identifies the type or high-level channel of traffic. It tells Google Analytics how someone arrived on your site website—through email, a paid ad, social media, etc.
Many sources can create the same medium. For example, the medium for paid ads is “cpc” (Cost per Click); multiple platforms fall within that medium, like Google Ads, Microsoft Ads (Bing Ads), Facebook Ads, etc.
Similarly, for a medium such as email, sources are email service providers and automation tools, like Mailchimp, Klavyio, Infusionsoft, ActiveCampaign, ConvertKit, and Drip. They can also be CRMs, such as HubSpot or Salesforce, or shopping cart platforms, like Shopify or WooCommerce, which send transactional or marketing emails.
Google Analytics relies on the value of medium for its Default Channel Grouping, so follow the most widely used values for a medium (whenever possible) and refrain from passing custom values for medium.
Many tools offer a built-in feature to add UTM parameters to all links within their platform. If it’s possible to customize these values, use values from the above list to keep everything within the same bucket.
For example, if your email automation tool uses “email-automated” as the default value for utm_medium but you have the option to change it, change it to “email” to prevent email traffic from fragmenting into two categories.
Also note that the same source (website, platform, or tool) can create different mediums. For example, Google as a source can send traffic to your site through several mediums:
- Organic: Non-paid Google search;
- CPC: Google Ads;
- Display: Google Display Network;
- Referral: In the rare (but pleasant) event that Google mentions your website on their blog and links to one of your pages.
Facebook can do the same:
- Referral: When someone shares a link to your website on their personal wall;
- CPC: Traffic from Facebook Ads;
- Social: When you post an update on your company page or to a Facebook group.
(This is why Google Analytics reports on source/medium as a pair by default.)
While comparing the performance of different sources or mediums is beneficial, we’re still missing some key information. For example, if a source/medium report shows “mailchimp/email,” we still don’t know:
- The email campaign;
- The email title;
- Which link in the email was clicked (if there were multiple);
- When the email was sent.
- What behavioral or RFM segment the user was part of or who the email targeted.
These are pieces of information that we have access to in our email platform and ideally want to pass to Google Analytics. To get that information, we can use the remaining set of UTM parameters: utm_campaign, utm_term, and utm_content.
Unlike source and medium, there are no strict values; instead, best practices and business needs define the strategy.
There are a couple schools of thought on values for utm_campaign. I’ll cover both approaches.
While having a value for utm_campaign is optional, it’s highly recommended. If omitted, the value is reported as “(not set)” in Google Analytics.
Approach 1: The tactical approach
Most marketers follow this approach—simply use the name of the internal campaign of your marketing or advertisement platform as the value for utm_campaign:
Pros of the tactical approach
- It’s easy to see the results of each campaign in Google Analytics.
- If there’s a cost associated with running a campaign (i.e. ad campaigns), it’s easy to see the revenue and ROAS for each campaign.
- It’s easy to communicate to different teams.
- Since utm_campaign values come from marketing tools and advertising platforms, it’s easy to link the campaign from the tool/platform to Google Analytics data.
This is also useful to compare the performance of different campaigns within a single source/medium:
Cons of the tactical approach
- In some cases, there’s no internal campaign name on the platform from which the link is shared (e.g., organic post on Facebook, tweet, video on a brand’s YouTube channel, affiliate link). As a result, a large portion of traffic will lack a campaign value.
- Inconsistent naming of campaigns can cause a mess, making the Google Analytics campaign report virtually useless.
- It can cause chaos when looking at campaign reports that aren’t filtered for a single source/medium.
The tactical approach introduces a hierarchy in which source/medium indicates which values to expect in the utm_campaign field:
As you can see in the diagram above, while comparing the performance of different campaigns inside a platform makes sense, each platform (or team in charge of it) may have a different naming convention for their campaign titles.
Viewing them all in a single table wouldn’t make sense.
Approach 2: The strategic approach
The second, possibly better, approach is to use a high-level, strategic value for utm_campaign that identifies the product/category/event being promoted or the higher-level marketing or promotional objective.
This is closer to the classic concept of a pre-digital marketing campaign executed across different channels and mediums, like a Black Friday campaign across print, billboards, TV, and radio.
Here’s a modern example: I used to run an ecommerce store selling iPhone cases, and whenever Apple launched a new iPhone, we had a product launch campaign to introduce a new line of cases. We ran Facebook Ads, Google Ads, Instagram Ads, and sent out a series of emails.
If we had used the internal campaign name within each tool as the value for utm_campaign, our final campaign report would’ve looked like this:
That’s not useful.
What would a high-level, strategic value of “iphone-x-launch” for all the links—regardless of source, medium, or internal campaign—offer? It would let us compare the results of our iPhone X campaign with other campaigns that year:
And we can still drill down to the performance for each traffic source:
Depending on the campaign, here are some sample naming conventions that make sense:
When following the strategic approach, a campaign can span multiple sources and mediums:
Pros of the strategic approach
- A clean campaign report with clear, strategic values;
- A clear overview of how traffic sources perform per campaign;
- The ability to view and compare the results of different marketing campaigns.
Cons of the strategic approach
- Campaigns in Google Analytics reports won’t correspond to the title of the campaign in each marketing tool/platform, making it harder to compare Analytics data with costs reported in the tool.
- Only the cost and revenue for the whole marketing campaign across all sources can be directly compared, and breaking down the report requires further analysis.
- Clear communication and central documentation are required. If one team or person doesn’t follow this approach, all campaign data in Google Analytics will become nearly useless.
Campaign Grouping: A hybrid approach
Business owners and C-suiters are likely more interested in campaign-level reports and comparing high-level marketing activities, their costs, and their results.
Digital marketers, media buyers, and teams working with advertising platforms on a day-to-day basis, however, like to monitor and assess results for individual campaigns.
A comprehensive solution isn’t built into Google Analytics, but there is a workaround: Campaign Grouping. Campaign Grouping assigns different campaigns (as named in each tool) to a higher level group that represents the marketing campaign.
Imagine you’re promoting two product lines, a yellow line and a green line, across different channels:
What if you could tell Google Analytics which campaign promotes which product line? What if you could group all campaigns into yellow, green, or general?
That would give each team the flexibility to pass their internal campaign names to Google Analytics while preserving the ability to:
- Link conversions to the campaigns;
- Compare the value of conversions (or revenue) to the cost of running each campaign;
- Calculate CPA and ROAS at the product-line and tactical-campaign levels and sum costs and revenues from all campaigns within a group;
- Prepare a strategic, high-level report to review and compare the performance of campaign groups together.
The execution varies on a case-by-case basis. Here are some ideas on how to do it:
1. Ask teams to prepend the strategic value to the internal campaign title before passing it as the value of utm_campaign. For example:
This still breaks conversion-to-campaign attribution and makes it hard to import campaign costs. However, it’s easier to read in reports. Plus, it doesn’t apply retroactively.
2. Create and maintain a central look-up table for all team members to identify campaign groups. Aggregate costs and results in a tool like Google Data Studio or BigQuery. This is the most flexible method and can group historical campaigns, too.
3. Create and maintain rules for a Custom MCF Channel Grouping in Google Analytics. This will apply retroactively, but it’s impossible to pull these through the Google Analytics API to other reporting tools. In addition, it’s hard to maintain rules.
The value of utm_term depends on the source and medium of traffic. When deciding on what value to use for utm_term, think about one that clearly identifies the specific entity within the medium (your promotion or marketing activity) responsible for driving traffic to your website.
Depending on the medium, utm_term can identify a specific email, an ad in an ad group, a post on social media, the title of a blog post, a search keyword, the title of a video, or the body of a tweet:
According to Google, utm_term is used to “identify the paid keywords,” and, hence, its values appear as the field “Keyword” in Google Analytics. However, you can use this field to pass useful information from other sources.
According to Google, utm_content differentiates similar content, links within the same ad, links within a blog post, CTA buttons within an email, or variations of an A/B test.
It’s an optional but useful field that can send any information about the click to Google Analytics.
How to send multiple values through a single UTM parameter
As utm_source, utm_medium, and utm_campaign have strict values, and utm_term has its own limitations, we’re left with only one UTM parameter—utm_content—to send all other information about a click.
That’s why we need a plan to send multiple values through a single UTM parameter. I recommend the following format:
So, for example, your utm_content value might look like this:
“Key” identifies the type of information being sent and is separated with two dashes from the “value”; key-value pairs are separated by underscores.
This format is readable in reports and also allows you to search and filter tables in Google Analytics or, later, to extract values in reporting tools.
UTM parameter builders and related tools
Some tools make it easier to document your UTM strategy, share it with everyone on your team, and automate the process of adding UTM parameters. You’ll save time and minimize human errors.
- Google’s URL Builder. A free tool by Google that helps you add UTM parameters to your URLs.
- UTM.io. A web-based tool to build, share, and sync UTM parameters.
- Terminus. A web-based tool to define, manage, and enforce UTM naming conventions.
Other UTM parameter tips
Don’t use UTMs on internal links!
Never use UTM parameters on internal links (e.g., homepage sliders, internal banners, or internal links on blog posts).
Clicking on those internal links will cause the current session to end and a new session to start—attributing the new session to the source/medium used on the internal link.
Any subsequent user action, goal completion, or transaction will be attributed to the internal source, not the one that brought the user to the site.
Be careful of what you include in UTM parameters.
UTM parameters are visible in the URLs to visitors and competitors. Personal information like someone’s name, email address, or telephone number should never be put in the UTM parameters (or any other URL query parameter).
Not only are these parameters visible to other users, but collecting personal data in Google Analytics is against their terms of service.
Use short links for cleaner URLs.
Links containing UTM parameters can get very long, so when sharing them on social media (or anywhere else that the actual link will be seen), use a URL shortener like bit.ly.
If you prefer branded links to generic bit.ly ones, use a custom URL shortener that works with your domain.
Hide UTM parameters from the user.
Even when using a short link, the user is redirected to the destination URL, which includes the UTM parameters. Fresh URL by Wistia hides UTM parameters from the browser’s address bar after they’re recorded by Google Analytics.
UTM parameters are an essential component of accurate traffic attribution, which, in turn, is pivotal to understanding which online marketing efforts lead to conversions.
But a seemingly simple process of adding UTM parameters can quickly go awry, burying valuable data in a pile of inconsistent, inscrutable parameter names.
Take the time to build a strategy for your UTM parameters that ensures consistent tagging. The rewards are well worth the effort.
Working on something related to this? Post a comment in the CXL community!