Google Analytics is by far the most used analytics tool. BuiltWith estimates that in 2024, more than 89% of all websites worldwide use Google Analytics for measuring their website usage. Unfortunately, many of the people who rely on Google Analytics for measuring their website traffic lack a good understanding of how it works and have not set up their UTM tracking codes correctly. Having a good GA setup (with proper UTM parameters) is the cornerstone of a successful marketing program.

This article focuses on how to use UTMs to ensure the traffic you acquire to your site shows up correctly in Google Analytics. Let's first discuss what UTM codes are, and then dive deeper into how you can use them to make sure visitors are shown correctly in GA.

What are UTM tags?

'UTM' stands for 'Urchin Tracking Module'. UTM codes can be added to the end of regular URLs, in order to give Google Analytics specific information about that link.

A UTM tag always contains: 

  • - Source or where the traffic is coming from
  • - Medium, or how users are finding them, and 
  • - Campaign Name parameters.

These UTM parameters help teams track marketing campaigns, and understand what’s working or what they can improve.

Other parameters you can add to your UTM tag are utm_content and utm_term, but these are optional. 

 

How Google Analytics knows where your visitors come from

When a person visits your website, their browser reads the underlying HTML and CSS code in order to know what to show. If you have Google Analytics installed, the HTML code includes a Google Analytics script. This script does a lot of things, and one of them is to interpret where your website traffic comes from. GA (Google Analytics) does this by checking the URL that led him or her there. This is called the referrer URL.

For example, on website A there is a link to Website B. Provided that Website B has installed analytics tools, visits from Website A will automatically show up in Google Analytics as:

Source = http://www.websitea.com
Medium = referral

This is probably something you’ve seen in the Google Analytics interface before, and it just means that website A has a link to your website (website B), without providing any additional information about the link. If you want more information about that link, UTM codes are needed. We'll go into how to do that in a bit.

From here on, we will use the abbreviation 'GA' when talking about 'Google Analytics'.

Google Analytics dimensions

Analytics tools like GA think of incoming visits in terms of a few dimensions. Dimensions categorize visitors into different buckets so you can understand where the website traffic is coming from. This helps you determine which marketing efforts are working well and which need adjustments.

There are five primary dimensions under your control that can be used for slicing up the traffic data:

Source: Where visitors come from, e.g., Google, Facebook, Bing, The NY Times.

Medium: The marketing medium, e.g., CPC, organic, email.

Campaign: The name of the campaign, if applicable. This can be something like 'summer-sale' 

Term: Typically used for paid traffic only. In search campaigns, it is the keyword. For other ad platforms, it is often used for identifying the audience or the level below the campaign. For example, the ad set in Facebook.

Content: Typically used for paid traffic only and represents the ad’s content, which allows for identifying individual ads. E.g., yellow-banner or the name of the headline.

Should I use all 5 parameters?

If you want to be able to track the performance of your marketing efforts on the campaign level, then you need to use the source, medium and campaign tags. If you want to be able to track performance to the ads level, then you need to use all five dimensions.

The two most important dimensions out of the five are source and medium. In fact, they are so important that they deserve a section of their own.

Frame 11

The Source and Medium dimensions

You can think of Source as "Who sent the visitor to the site?", and of Medium as "How were they sent?". In our earlier example Website A was the source of the traffic (the who) and it sent the visitor to Website B by referring to it via a non-paid 'Referral' link (the how).

In order to get a better idea of what Medium is, here are a few common examples of how to interpret it when you see it in GA:

referral: The default Medium if nothing else is set. This is often used for non-paid links, for instance when you want to refer to a website as a source of information.

(none): Traffic with no referring Medium, i.e., direct traffic. People will have come to your website directly, for instance by typing your website url in their browser.

(not set): Traffic where Google Analytics is unable to figure out anything about the origin of the traffic.

organic: Organic search traffic. This does not include paid search results, since GA automatically identifies non-paid traffic from major search engines (e.g., Google, Bing) as organic.

cpc: Short for 'cost per click' and the typical categorization of paid traffic.

email: Traffic via links in emails.

social: Links from posts on social media websites.

video: Links in videos.

You can find source / medium information in GA4 by going to Reports > Acquisition > Traffic Acquisition. Use the dropdown to select Session source / medium to see the list of top source / medium combinations:

Example of UTM source and medium in GA4

So, how do you ensure all visits to your website are categorized in a way that allows for comparing apples to apples?

 

Tagging incoming traffic with UTM codes

UTM parameters are one of the most important tasks in online marketing and one that many advertisers don’t do well. The trick is to ensure that your analytics tool gets as much relevant information as possible about how a visitor ended up on the website. For example, a visitor may come in through a regular link on a website, an ad, a link in an email, or a link on a website of a partnering company.

If you don’t add UTM parameters to your URLs, GA will only extract limited information from the visitor. This means the source of the traffic and a guess of what the medium should be, which is typically, 'referral'.

Know your website visitors

When you have created an ad, put a link in an email you sent out, or published a post on a social network, then you typically have a lot more information about the visit that you want to pass on to Google Analytics. The mechanism that is used to tell Google Analytics where the visit is coming from is to add UTM tracking codes (parameters) to the URL in the link. This overrides Google Analytics’ own efforts to infer the information.

UTM tracking links are added at the end of the URL and start with a '?'. This means the browser ignores them and the address the URL is pointing to does not change. The tracking parameters are only used to transmit information to the site receiving the visit from the link.

The tracking standard used by Google Analytics is called UTM parameters. Because Google Analytics is the de facto standard for website analytics, UTM parameters are the industry standard too. You have probably noticed these at some point in the browser URL field after clicking a link. A typical URL in an ad could look something like this:

http://www.website.com/?utm_source=newssite.com&utm_medium=cpc&utm_campaign=my-campaign

Everything after the '?' in the URL above is information for Google Analytics to correctly categorize visits from this link to the website.

If you’re lucky the platform you’re buying ads from (e.g., Google or a social media platform like Instagram) tags your ads’ destination URLs automatically. UTM links from Google Ads and Bing automatically do this. But, these two are exceptions. In most cases, you either manually have to make sure your destination URLs are tagged correctly or use a third-party ads tool to automate it for a specific channel.

Luckily it's not too difficult to add UTM parameters from a technical point of view. The hard part is being consistent. To help get the technical bits right, Google has created a URL builder that lets you generate URLs that Google Analytics can make sense of. The GA URL builder is not very fancy, but an easy way of making sure the UTMs are correctly formatted. It’s then up to you to make sure the UTM tags make sense and are consistent.

Try our tool

We’ve also built our own campaign name and URL builder tool that allows you to create nice structured advertising campaign names and automatically include these in your UTM tagged URLs. Feel free to try the tool to build your UTM links and see if it works for you.

How to use UTM parameters for your URLs

Below are the 10 most important guidelines to follow when using UTM codes in URLs. You can use them to create a framework that fits you. Just make sure to write down the rules and conventions for your UTM parameters in a document so it is available to everyone in your organization.

1. Tag all traffic that you have control over

Even unpaid traffic and links in emails that you send out should be UTM links. If a third-party tool is used it usually has an option to tag URLs. Look for it and use it! Look through all your traffic in GA and identify the traffic that is not tagged and try to figure out a way to tag it. There will be traffic that you cannot tag, such as true referral URLs and traffic that really is direct traffic, and that’s fine.

2. Be consistent when setting UTM parameters

It doesn't really matter if you use 'cpc', 'paid', 'promoted' or some other tag to signify paid traffic from a given ad platform. What is important is that you always use the same UTM codes to mean the same thing. If different people in different parts of your organization interchangeably use 'cpc', 'paid' and 'promoted' for the same type of traffic you will have a hard time getting a good overview and properly aggregating your data.

3. Use a consistent case

UTM codes are case sensitive, so use a clear rule for how to capitalize and follow it religiously. Otherwise you might see different ads from the same campaign show as 'summer-sale' and 'Summer-sale'. That's not great, since it means you manually need to add up the numbers to get to a total number of sessions (or conversions) from this campaign.

4. Create a naming convention for campaigns

The exact naming convention depends on the setup for your business. Here are some guidelines:

Keep the names as short as possible while still unique and descriptive of the nature of the campaign. Abbreviations are good if they are easy to understand. Also, avoid identical long phrases in many campaign names. A lot of that can usually be cut out.

Start with the things that are unique to the campaign as the name will often be truncated when looking at it in Google Analytics. If you advertise in different countries, use an abbreviation for the country in the campaign name. For example, US, DE, UK.

Consider whether you want to add an identifier for the type of ad in the campaign name. For example, if it is a Google AdWords display campaign you may want to start it with the abbreviation GDN for Google Display Network so you can distinguish it from AdWords search campaigns. AdWords’s auto-tagging sets the medium to cpc for all search and display traffic so it is helpful to find another way to distinguish between search and display traffic than the medium.

Be consistent in how you use letter case in campaigns. UTM codes are case-sensitive, so you need to make sure you always get this right. For more information about naming conventions for your digital marketing campaigns, look at the Campaign Naming Guide

5. Set the utm_source tag to the name of the channel you are using

Always use the name of the ad platform, affiliate, email service or publisher for the source tag. For example facebook for Facebook, hasoffers for the HasOffers affiliate network and mailchimp for emails sent using Mailchimp.

6. Consider always setting the medium tag for paid traffic to 'cpc'

By default, Google Ads automatically adds a UTM parameter called 'medium=cpc' to your links. This means any paid traffic coming from your ads will be labeled as 'cpc' (cost-per-click) in Google Analytics. This makes it easy to separate paid traffic from all other website visitors.

Option 1: Keep it Simple (CPC)

This automatic 'medium=cpc' UTM code from Google Ads works well for many website owners. It clearly shows paid traffic and allows you to filter it easily in your analytics reports.

Option 2: Get More Specific (cpc, cpm, etc.)

You can also use the 'medium' tag to show the exact type of paid advertising used. For example, 'cpc' for cost-per-click, 'cpm' for cost-per-thousand-impressions, and so on.

But is super-specific information always necessary?

Consider how much detail you actually need. While knowing the specific ad type can be helpful, it might be more practical to stick with the simple 'cpc' UTM code for easier filtering and analysis.

7. Set the utm_campaign parameter to the campaign name

The campaign parameter should be identical to the campaign name in the ads platform. Including capitalizations if applicable. Spaces are not allowed in URLs and thus not in UTM parameters. 

8. Set the utm_term parameter to signify the targeting of the ad

Google AdWords automatically sets the UTM term parameter to the keyword (for paid search), provided that you have auto-tagging enabled. Term is thus used to signify how the ad is targeted. We recommend using it in the same way for all other traffic sources where you have targeting information. For Facebook, for instance, this corresponds to the ad set name as targeting is set at the ad set level in Facebook. For Twitter and LinkedIn ads, create a string based on Twitter or LinkedIn targeting parameters used for ad. For emails, use a term that describes the email list used. For example, 'incomplete signups'.

9. Set the utm_content parameter to identify the individual ad

This UTM parameter is usually tied to the creative of the ad. Don’t worry if you use the same creative for two ads with different targeting. Then the content parameter can be the same for the two ads as the term parameter can be used to distinguish the traffic from the two different ads. Examples of the content parameter include 'blue banner' or 'all jeans 50%'.

10. Be consistent when changing campaigns

The campaign, term and content tags depend on the campaign name, keyword or targeting, and ad creative in the advertising platform. If you make changes to any of these after you have launched the ad you have two choices. Either you leave the UTM parameters as they are or you change them to reflect the new values. Our recommendation is that you change the UTM codes to reflect the modifications you have made in the ads platform. This way you know there is always a consistency between the two.

The table below shows you the five different UTM parameters with suggestions for how to use them. It should be relatively easy to decide on a convention that suits your business. Again, the most important thing is to tag all URLs and to be consistent. If in doubt, keep it simple. Also, make sure that Google AdWords and Bing auto-tagging is enabled. This will save a lot of manual work.

What do infograf

The seven most common UTM tagging mistakes

1. Not tagging at all

We are surprised how often we see this, even with larger advertisers.

2. Not being consistent in the tagging

For example, if the medium for paid traffic is sometimes tagged as 'paid' or 'cpc' or 'cpm' or 'ad' or left blank for the same ad channel, then it is really hard to see the effect of your advertising as the data is not aggregated correctly.

3. Using different cases for the same tag

URL tags are case sensitive, so 'cpc' and 'CPC' are treated as different. Make sure you have a convention for how to use cases. We recommend using lower case for source and medium tags as that’s how most auto-tagging tools do it. Both AdWords and Bing auto-tagging use lower case for source and medium.

4. Wrong use of the UTM parameters 

To distinguish between different types of Facebook traffic you could set the source to 'facebook-post' for page posts you create, 'facebook-ads' for Facebook ads. But that is not how they are meant to be used and so you will not see information in the right way in Google Analytics. The source should simply be 'facebook' and the post and paid identifier should be put in the utm_medium tag where it belongs. This way you can see information correctly in GA.

5. Using campaign names that are too long 

With very long campaign names, many campaigns that start with the same phrase, and campaigns that don’t follow a naming convention, it is really hard to see in GA what the actual campaign is.

6. Tagging internal links

You should not put UTM parameters on links from your own website that lead to other pages on your website. First, it is not necessary. Google Analytics can track traffic on your site without any URL tagging. Second, if you add UTM tracking parameters on internal links you will lose information on where the traffic originally came from.

7. Not accounting for sub-domains

It is quite common for websites to have sub-domains such as blog.website.com or app.website.com. If you don’t explicitly tell Google Analytics they are all the same website it will interpret them as separate properties. This means you will see traffic from your own domains in your Google Analytics account. A typical example is when visitors click a link on Facebook to your blog and after reading the blog post click on to your main site. Without the proper setup, Google Analytics will interpret the source of the traffic as blog.website.com when it, in fact, was Facebook. You can learn how to avoid this scenario at the Google Developer site.

The value of Google Analytics UTM tagging

If you use a consistent framework for tagging all your web traffic Google Analytics will be able to provide a lot more insight for you. You will be able to see the effect of individual marketing campaigns and even specific ads. This way you can evaluate which ads and campaigns lead to sales and which ones have little effect.

Furthermore, tagging up your web traffic from your paid advertising allows you to match your Google Analytics data with your spend and advertising data from your ads channels. You can either do this manually or by using an automated tool like Funnel. The table below shows you what this data can look like.

Ads channel Ad spend Sessions Transactions Assists Revenue CAC ROAS
Google ads  Search $45 489 36 012 1 801 3 601 $194 465 $25 428%
Google Ads Display $9 765 28 319 283 850 $28 035 $34 287%
Bing paid search $8 345 6 828 273 546 $28 130 $31 337%
Facebook $37 654 115 472 2 309 8 083 $228 635 $16 607%
Twitter $4 921 5 249 142 638 $14 172 $35 288%
LinkedIn $3 548 1 833 55 220 $7 149 $65 202%
YouTube $12 493 7 853 275 825 $26 660 $45 213%
Total $122 215 201 566 5 138 14 762 $527 248 $24 431%


On the left-hand side are the different ads channels. Then comes the data from the ads channels (ad spend), then the data from Google Analytics (sessions, transactions, assists, revenue) and finally the metrics that are calculated from the ads channel and Google Analytics data (customer acquisition cost (CAC), return on advertising spend (ROAS)). This is the information you need in order to decide which ads channels work best for you and which do not perform well. This is very powerful information.

The next step is to do this analysis for all campaigns for all ads channels to see which campaigns work best cross channel. You can even drill down to the ads level and see which ads work the best and what the customer acquisition cost and return on advertising spend is for these ads.

 

FAQ

How does tracking UTM parameters help marketing efforts?

UTM tagging can benefit your marketing efforts in several ways:

  • See what marketing channels are working: By tracking UTM parameters, you can see which sources and mediums are driving the most traffic to your website. This helps you understand which marketing channels are most effective and where you should invest your resources.
  • Measure the success of individual campaigns: You can use UTM tags to track the performance of specific marketing campaigns. For example, you can create unique UTM tags for a banner ad campaign and track how many website visitors and sales those ads generate.
  • Optimize your marketing campaigns: UTM tagging allows you to see which specific ads, emails, or social media posts are performing the best. This information can be used to optimize your campaigns and improve your results over time.
  • Match ad spend with website data: UTM tagging allows you to connect your website analytics data with your spending data from advertising platforms. This gives you a more complete picture of your return on investment (ROI) for your marketing campaigns.
  •  

Are UTM parameters and dimensions the same?

UTM parameters and dimensions are closely related in web analytics, but they're not exactly the same. Here's the breakdown:

  • UTM parameters: These are codes you add to the end of a URL. They act like little labels that tell Google Analytics where your traffic is coming from (source), how they found you (medium), and details about specific campaigns (campaign, term, content). For example, a UTM parameter might look like utm_source=facebook&utm_medium=social.
  • Dimensions: These are categories used in Google Analytics reports to organize your website traffic data. UTM parameters contribute to some of these dimensions. For instance, the "Source" dimension in a report might show data segmented by traffic coming from various sources like "facebook," "google," or "email."

 

What is the difference between source and medium in UTM parameters?

Source: This tells you who sent the visitor to your site. It answers the question "Where did this visitor come from?". Examples of sources include search engines (google, bing), social media platforms (facebook, twitter), email marketing tools, affiliate websites, etc.

Medium: This tells you how the visitor arrived at your site. It answers the question "What type of link did the visitor click on?". Examples of mediums include organic search, paid search (CPC), email, social media referral, display advertising, etc.