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 in how you can use them to make sure visitors are shown correctly in GA.

What are UTM tags?

“UTM” means “Urchin tracking module.” UTM tags can be added to the end of regular URL’s, in order to give Google Analytics specific information about that link. A UTM tag always contains the Source, Medium, and Campaign Name parameters.

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. Provided you have Google Analytics installed, within this HTML code is the Google Analytics script which executes when the browser loads the website. This script does a lot of things, and one of them is to interpret how the visitor ended up on the website. GA (Google Analytics) does this is done 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: http://www.websiteb.com/. Provided that Website B has Google Analytics installed, 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 also be using the abbreviation 'GA' when talking about 'Google Analytics'.

Google Analytics dimensions

GA thinks of incoming visits in terms of a few dimensions. Dimensions are used for categorizing 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: The referrer of the visits, e.g., google, facebook, bing, nytimes.

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.

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

This is one of the most important tasks in online marketing and one that many advertisers don’t do well. The trick is to ensure that GA 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 tag 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.

Tracking parameters 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, the same applies to UTM parameters. 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 publisher you’re buying ads from (e.g., Google or Instagram) tags your ads’ destination URLs automatically. You can have 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 is not particularly hard 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 utm builder tool and see if it works for you.

How to use UTM tags for your urls

Below are the 10 most important guidelines to follow when using UTMs in URLs. Use them to create a framework that fits you. Make sure to write down the rules and conventions 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 tagged. 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 tags

It does not 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 tag 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 tags 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 case in campaigns. UTM tags 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

This is what Google’s auto-tagging does, so all paid traffic from AdWords will appear this way in Google Analytics unless you add your own tags. This way it is easy to filter out paid traffic. Alternatively, you can use the medium tag to signify the exact bid type for the ad such as cpc, cpm, etc. But first, consider whether you really need that information in Google Analytics. It may be better to just keep it simple.

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 this 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 is usually something that is 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 tags 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.

Image explaining Google analytics UTM tags

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 not at all 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. A recommendation is to use lower case for source and medium tags as that’s how most auto-tagging tools do it. Both AdWords’s and Bing’s auto-tagging use lower case for source and medium.

4. Wrong use of the UTM parameters 

For example, 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 thus you will not see information in the right way in Google Analytics. The source should simply be facebook (or facebook.com if you want to use that as your convention) 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 UTMs 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.io. 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.