The Advanced Guide To Using Google Analytics UTM Parameters

Lack of Google Analytics UTM parameters cause massive tracking headaches.

We’ve seen hundreds of questions on the Google Analytics Community and Quora that are related to UTM parameters.

We believe many of them can be answered more in-depth or just better so we’ve decided to collect the FAQ and answer them in this article.

P.S. Even if you’re a rigorous and data-driven marketer, and you’ve regularly used UTM tags on a daily basis, there’s surely still room for discovery.

Table of contents

  1. What should be the values of utm_campaign, utm_source and utm_medium?
  2. How do I find Custom Campaigns in the Google Analytics interface?
  3. How do I make sure that UTM codes are working properly?
  4. Why are my UTM parameters not working properly and how to fix it?
  5. Do 301 and 302 redirects strip UTM tags and affect data?
  6. Can I use UTM tagging while I’ve already got another query parameter on my URL?
  7. How important is the order of UTM parameters in URLs?
  8. Is there any way to generate UTM tags for my website URLs that contains an anchor (#)?
  9. Should I tag internal links on my website?
  10. When visitors move from blog.example.com to example.com, should I use UTM parameters to see the number of visitors that come from my blog to my homepage?
  11. Are all five UTM codes required when tagging links?
  12. Is it a good idea to add UTM codes on other websites’ URLs in my blog to show we’re sending them traffic in their analytics?
  13. Is it possible to hide Google Analytics UTM parameters?
  14. Will all tagged links be tracked in GA without any additional setup?
  15. Do I need to make sure that UTM parameters are present till the end of the session, even on the confirmation page?
  16. Is it possible to generate a space between the words in Google Analytics instead of an underscore “_”?
  17. Where can I find data for utm_content and utm_term in Google Analytics?
  18. Should I use “cpc” as a medium when tagging social media campaigns?
  19. How should I set up UTM parameters for use in social media marketing campaigns?
  20. Why are some of my social media campaigns not reported under the social media channel in Google Analytics?
  21. What’s the best way to maintain and organize tagged URLs?
  22. How do I generate UTM Tags for my campaign?
  23. Does Google take UTM parameters into consideration when crawling the web?
  24. Should I use a trailing slash (/) before the question mark when tagging URLs?
  25. Are UTM parameters case sensitive?
  26. Why are UTM codes named as such?
  27. Does UTM tagging work if only one UTM parameter (say, utm_medium) is entered?
  28. Do I need Google Tag Manager installed for UTM tags?
  29. Should I use UTM parameters when tagging Google AdWords campaigns?
  30. Will using both Google AdWords auto-tagging and manual tagging with UTM variables create any tracking problems in Google Analytics?

1. What should be the values of utm_campaign, utm_source and utm_medium?

1. If you plan a Campaign, agree on a single “Campaign name” across sources and try to stick with it. When thinking about your “Campaign name”, try to be brief, but descriptive. If you’re running a repetitive (for example seasonal) campaign, just add a unique identifier, like month or year, for example.

For example: summer+sale+2018

Read here why it’s better to use “+” between words in the URL.

Example: https://example.com/?utm_source=facebook.com&utm_medium=display&utm_campaign=summer+sale+2018

2. When thinking about “Source” – be short, but relevant. Generally use the domain (.com, .co.uk, .net at the end) as a source name, if possible.

For example: facebook.com, twitter.com, linkedin.com, etc

3. When choosing a “Medium”, follow the Default Channel Definitions or your own Custom Channel grouping. The biggest mistake we keep seeing is the mis-tagging of mediums. This is the most important tag to get right. How a site tags a medium will determine which bucket their data adds to in the reports.

For example: affiliate, partners, display, social, paid+email, paid+social

2. How do I find Custom Campaigns in the Google Analytics interface?

Here are three different ways to find this data.

1) Use a Campaigns report

Just open your Acquisition -> Campaigns -> All Campaigns

Google AnalyticsL campaigns report

2) Use a secondary dimension

If you want to look at all your campaigns in relation to utm_source and utm_medium, you can use a powerful feature called the secondary dimension in Google Analytics.

Just open your Acquisition -> All Traffic -> Source/Medium report or Acquisition -> Campaigns -> All campaigns report and type in the name of the dimension (Campaign or source/medium) in the “Secondary dimension” field, and you’ll find the data you’re looking for.

Secondary dimension in Google Analytics report

3) Build a Custom Report

You can build a Custom Report and pick the specific dimensions and metrics and decide how they should be displayed.

Here’s how: Customization -> Custom Report -> + New Custom Report

Bonus: Get a custom report that shows you not only which campaigns are driving the most traffic to your site but also whether or not that traffic is translating into tangible results for your business. Click here to get this custom report.

3. How do I make sure that UTM codes are working properly?

To test your UTM parameters, enter the tagged URL into your browser and see what happens.

UTM parameter server side redirect
During HTTP to HTTPS redirect, UTM parameters are not passed in this case.

If those UTM parameters remain at the end of the URL when the page is loaded, then it is very likely that your information is being tracked.

UTM parameter not redirected

I would recommend checking your Developer Console to see if there is a Google Analytics cookie that contains the UTM parameter information you passed.

You can also take a look at the “Real-Time -> Traffic Sources” report in Google Analytics to see if the test values you passed are being correctly picked up by Google Analytics servers and reported with the right information. If you haven’t implemented any internal IP filters or you haven’t blocked Google Analytics in your browser, you should see your custom campaign parameters in Traffic Sources.

real time report in Google Analytics

If UTM parameters disappear after the page loads, they are not working properly, and this information will not be captured nor sent to Google Analytics.

Google Tag Assistant Chrome plugin helps you troubleshoot common tracking problems as well (thanks Kristo for reminding me).

4. Why are my UTM parameters not working properly and how to fix it?

There could be several reasons:

1) The most common reason – UTM parameters are stripped because of the URL redirect. If you tag your campaigns, use the final destination URL, not the URL that will be redirected. If you have problems with server-side or 301 or 302 redirects, you can also modify your server settings. Ask your web developer to configure your server to pass all the tracking parameters.

2) You haven’t used a mandatory utm_source parameter. Make sure you’ve appended “utm_source” to your URL.

3) You’re using ga.js (Classic version of Google Analytics), and you’ve inserted your campaign parameters in the fragment portion of the URL. Bear in mind, if you use ga.js, _setAllowAnchor is set to “false” by default and, as a result of that, any custom campaign parameters that appear in the anchor will be ignored.

4) You don’t have Google Analytics tracking code installed on the website.

5) You’ve configured filters that prevent this traffic from affecting your data.

5. Do 301 and 302 redirects strip UTM tags and affect data?

Yes, 301 and 302 redirects can often strip your UTM parameters and categorize custom campaign traffic incorrectly.

You can easily figure out if this is your issue or not.

Usually, query parameters do not survive the redirect process. It means that anything that is appended to the end of your redirected URL will be stripped, and the information will not carry over to the new URL and thus, will not be sent to Google Analytics.

Basically, if you are using 301 or 302 redirects, make sure they preserve your tracking parameters (utm_source, utm_medium, utm_campaign) at the end of your final URL.

If you have problems with 301 or 302 redirects, configure your server to pass UTM parameters on redirects, and everything will be fine.

This does require a technical know-how, so please talk to your web developer about making the necessary changes.

6. Can I use UTM tagging while I’ve already got another query parameter on my URL?

Yes, you can. Just use a question mark (?) before the first query parameter, and then separate all other query parameters with ampersands (&).

Bear in mind, if the website CMS uses question marks to show specific content (for example store.com/?category=furniture&product=chair), you cannot add &utm_source=… to the URL because it would prevent the CMS from finding the page.

In that case, if you’re running Universal Analytics on your site, you can use the anchor character (#) instead of ampersand (&), and it works well by default.

For example: store.com/?category=furniture&product=chair#utm_source=…&utm_medium=…&utm_campaign=…

7. How important is the order of UTM parameters in URLs?

No specific order is required for the Source, Medium, Campaign, or other query parameters. You should use a question mark (?) before the first query parameter and then separate all other query parameters with ampersands (&).

8. Is there any way to generate UTM tags for my website URLs that contains an anchor (#)?

Yes, you can do this with the official URL builder. There’s an option to set the campaign parameters in the fragment portion of the URL, but this is not recommended.

If your CMS uses question marks to show specific content, you cannot add &utm_source=… to the URL because it would prevent the CMS from finding the page.

By default, analytics.js will search for UTM parameters in both the query string and anchor of the current page’s URL, but ga.js won’t. You need to set _setAllowAnchor to “true”, then your URLs can use a anchor sign (#) instead of a question mark (?) to indicate the beginning of the query string.

9. Should I tag internal links on my website?

No, never. If you tag your internal links with UTM parameters, you’re going to overwrite the original referrer.

For example, if I land on your website after clicking on a link on Facebook, Google Analytics will start a session and attribute it to Facebook.

Now, if you’ve tagged a banner on your homepage promoting an ebook and I click on that link, Google Analytics will start a new session and attribute it to your internal campaign. As a result, you’re inflating your session count and messing up a lot of metrics.

To sum up, UTM parameters are supposed to be used for external links only.

10. When visitors move from blog.example.com to example.com, should I use UTM parameters to see the number of visitors that come from my blog to my homepage?

No, you should never attach UTM parameters to your internal links. Make sure you use exactly the same Google Analytics UA-ID on your blog and homepage. In addition, make sure you’ve set cookieDomain to auto. If you do not set this up, the visitor session will break when they go from blog.example.com to example.com.

Make sure you’ve set cookieDomain to auto in your tracker settings, and everything will be fine. By the way, Google Analytics offers this by default, so all is well if you copy-pasted your GA snippet from the Property settings. If you’re running GTM on your site, make sure you’ve also set cookieDomain to auto.

11. Are all five UTM codes required when tagging links?

The utm_source, utm_medium, and utm_campaign parameters are strongly recommended to use but technically only the utm_source parameter is required.

If you left those two parameters (utm_campaign and utm_medium) off, campaign tracking still works, but you’ll see “(not set)” as the value for those fields in Google Analytics.

only utm_source

Long story short – as long as you include a utm_source parameter in your URL, campaign parameters still work. If you only include one of the other parameters but no utm_source, campaign tracking won’t work!

12. Is it a good idea to add UTM parameters on other websites’ URLs in my blog to show we’re sending them traffic in their analytics?

Campaign tagging is for actual marketing campaigns. I do not recommend doing it. If you do this, they will not see the Full Referrer in Google Analytics reports.

13. Is it possible to hide Google Analytics UTM parameters?

Yes. There are several different ways to hide UTM parameters:

1) You can use simple URL fragments and some GTM tricks to hide the UTM parameters and still keep tracking different traffic sources with Google Analytics. All you need to do is use a feature in Google Tag Manager called the Lookup Table. You can read more about it here.

2) You can use URL shorteners like bit.ly or goo.gl to hide UTM tags.

3) In some cases, you might want to put UTM tags on 301 redirects to hide those parameters as well.

14. Will all tagged links be tracked in GA without any additional setup?

There’s no additional setup needed in Google Analytics to start using tagged links. Anyone can create tagged URLs. You don’t even have to be an administrator or a user of the Google Analytics account to start using them.

You only need to make sure that the syntax is correct in your tagged URL, and that your site has Google Analytics code properly installed on it.

15. Do I need to make sure that UTM parameters are present till the end of the session, even on the confirmation page?

No, it’s not necessary to keep the UTM parameters in the link till the end of the session. They only need to be present when visitors land on your page.

16. Is it possible to generate a space between the words in Google Analytics instead of an underscore “_”?

Yes, you should use a + (plus) sign between the words in your campaign name and you’ll see a space in Google Analytics instead of an underscore. Plus (+) signs translate into spaces in your Google Analytics reports.

Example: https://example.com/?utm_source=facebook.com&utm_medium=display&utm_campaign=summer+sale+2018

P.S. If you enter a plus sign into the
URL builder, it will get encoded as ”%2B” in your URL and you won’t see the space character in Google Analytics.

17. Where can I find data for utm_content and utm_term in Google Analytics?

There are a couple of ways to figure this out.

1) Use a secondary dimension

If you want to look at all your campaigns in relation to utm_content or utm_term, you can use a powerful feature called the secondary dimension in Google Analytics.

a) utm_content corresponds to “Ad Content” in Google Analytics
b) utm_term corresponds to “Keyword” in Google Analytics

Just open your Acquisition -> All Traffic -> Source/Medium report or Acquisition -> Campaigns -> All campaigns report and type in the name of the dimension (Ad Content or Keywords) in the “Secondary dimension” field, and you’ll find the data you’re looking for.

Secondary dimension in Google Analytics

2) Change the primary dimension

You can also find this data by changing your primary dimension:

Changing primary dimension in Google Analytics

3) Build a Custom Report

You can build a Custom Report and pick your desired dimensions and metrics and decide how they should be displayed.

Here’s how you can do this: Customization -> Custom Report -> + New Custom Report

custom campaign report in Google Analytics

18. Should I use “cpc” as a medium when tagging social media campaigns?

Even though “cpc” is one of the most frequently used “utm_medium” parameter values when tagging social media ads and promotions, this isn’t a good option.

Why is that?

If you read Google’s Default Channel Definitions resource, you’ll find that campaigns tagged with the medium “cpc” will by default get dropped into the Paid Search Channel group in Google Analytics.

I would say that “cpc” is a great option for pay-per-click campaigns within search engines like Google AdWords or Bing Ads, but they’re not a good choice for social media campaigns (Facebook, Twitter, Instagram etc).

Of course, it’s fine to use “cpc” as a medium and tag social media campaigns if you change your Default Channel Grouping or create your own Custom Channel Grouping in Google Analytics.

Default channel grouping cpc in Google Analytics
It’s not a good idea to use “cpc” as a medium by default when tagging social media campaigns.


19. How should I set up UTM parameters for use in social media marketing campaigns?

1) General Social Media posts

I would recommend using “social” as a medium, and everything will be fine. If you decide to use anything else, make sure you follow the Default Channel Grouping definitions or modify them if needed.

Keep in mind, “utm_source” is the required parameter as well but it doesn’t matter which value you assign to it as long as you keep a consistent naming convention for UTM campaigns.

2) Promoted Social Media posts

I would recommend using “paid+social” or “paid-social” as a medium and defining it in the Default Channel Grouping settings as well. Do not use “cpc” as a medium because in Google Analytics it’s by default defined as a “Paid Search Channel”.

Here you’ll see how to modify your Default Channel Grouping settings to make sure Google Analytics routes your promoted social media traffic to the bucket you want it in:

Default channel grouping in Google Analytics: paid social
In regular expressions, the dot is a character used to match any one character.

20. Why are some of my social media campaigns not reported under the social media channel in Google Analytics?

It’s probably because you have used the “utm_medium” parameter value incorrectly. Make sure your medium parameter value matches: social or social-network or social-media or sm or social+network or social+media. You can also change your Default Channel Grouping settings to use some other values or build your own Custom Channel Grouping if needed.

Bear in mind, your traffic will be automatically reported under the Social Media Channel in Google Analytics if it’s coming from the most common social media networks like Facebook, Twitter, LinkedIn, Pinterest, Google+ or StumbleUpon and you haven’t appended any UTM parameters to the end of your URL.

21. What’s the best way to maintain and organize tagged URLs?

Maintain a spreadsheet of tagged URLs. If you need to tag 10+ links every day, and you use Campaign URL Builder, it’s easy to make mistakes. You’ll have to type in the URL and new parameters every time, and the chance of making a mistake is high.

We use this Google Spreadsheet document (you can make a copy!) that helps us to minimize the risk of making typos and keep everything consistent. This will make your life much easier when it comes to creating and tracking numerous tagged URLs across your marketing campaigns.

22. How do I generate UTM tags for my campaign?

Depending on your needs there are multiple ways to generate links with UTM tags.

1) You can use Google’s official URL Builder.
2) You can use Raven’s URL builder.
3) You can use Google Analytics URL builder on Facebook.
4) You can use Holini’s bulk URL builder spreadsheet (that’s our favorite one!)- This document will simplify your workflow, while staying organized at the same time.
5) You can use an automated Google Spreadsheet built by Annie.
6) You can use this UTM builder tool (Lars, thanks for sharing!)

23. Does Google take UTM parameters into consideration when crawling the web?

Yes, it takes (thanks Annes for letting me know). UTM parameters sometimes create the duplicate content issues.

Recently Google has updated the parameter handling feature in Search Console tool that gives you more control and helps you set preferences.

24. Should I use a trailing slash (/) before the question mark when tagging URLs?

example.com?utm_source=facebook.com&utm_medium=social&utm_campaign=summer+sale

OR

example.com/?utm_source=facebook.com&utm_medium=social&utm_campaign=summer+sale

Usually, whether you add a slash or not doesn’t affect custom campaign tracking. Test your tagged URL before you start using it, and make sure it serves the right content and there’s no redirect happening that strips those query parameters.

25. Are UTM parameters case sensitive?

Yes, UTM parameters are case sensitive so you should be consistent when tagging your links.  When manually tagging URLs, always use lowercase tags to ensure Google Analytics categorizes sessions correctly.

Since UTM tags are case sensitive, which means if you use “summer+sale” for your utm_campaign tags on some links and “Summer+sale” for your utm_campaign tags on other links, they will show up as separate campaigns in your Google Analytics.

You can also add lowercase filters on the UTM campaign parameters to overcome a part of this problem.

That’s how you can create a lowercase filter (utm_campaign):

lowercase campaign name filter in Google Analytics

26. Why are UTM codes named as such?

UTM parameters are short for Urchin Tracking Module (UTM) parameters that were originally developed by Urchin Software Corp. This company was acquired by Google in April 2005. That’s why they are called UTM parameters.

27. Does UTM tagging work if only one UTM parameter (say, utm_medium) is entered?

As long as you include a utm_source parameter in your URL, custom campaign tracking works. If you only include one of the other parameters but no utm_source, UTM parameters won’t work properly. So no, UTM tagging does not work if you only enter a UTM_medium parameter.

28. Do I need Google Tag Manager installed for UTM tags?

No, you don’t. Google Tag Manager is not needed to start tagging your links.

29. Should I use UTM parameters when tagging Google AdWords campaigns?

It depends.

Even if auto-tagging is a recommended approach by Google, there are some special cases when you might want to use UTM parameters.

Examples of special cases:

1) If your site doesn’t allow arbitrary URL parameters you might need to use UTM tags instead of auto-tagging when tagging AdWords campaigns. Some websites display an error page when auto-tagging is turned on.

You can test it out. Turn on auto-tagging and click on a live version of your ad on Google Search. If you get an error, you need to turn auto-tagging off from your Google AdWords account.

2) If you want to use UTM parameters for non-analytics purposes and pull values from cookies, you should manually tag your URLs. P.S. Thanks Jeff for giving me some great ideas on how to use them for non-analytics purposes. 🙂

For example, when using UTM parameters and referrer information along with your lead generation forms you can capture a lot of valuable information about your visitors. Find more information here.

Keep in mind, if you tag your AdWords final URLs manually, you should enable the auto-tagging override setting in Google Analytics to avoid data discrepancies.

30. Will using both Google AdWords auto-tagging and manual tagging with UTM variables create any tracking problems in Google Analytics?

You should allow manual tagging (UTM values) to override auto-tagging (GCLID values) if you’d like to mix manual and auto-tagging. Otherwise, you might encounter data discrepancies.

Override auto-tagging setting in Google Analytics
Instructions for configuring it by Google

Notes:

1) If you have a free Google Analytics account (not GA 360), enabling UTM values to override GCLID values can result in sampling for some of your Google AdWords reports.

2) If you have linked your DoubleClick Search account to your Google Analytics account, this setting will also apply to all clicks coming from search campaigns managed in DoubleClick Search.

3) Manual tags and UTM override are not supported in Multi-Channel Funnels report in Google Analytics.

4) If you want your AdWords clicks to appear in the Google Analytics AdWords reports, you have to use: utm_medium=cpc, utm_source=google

Source: Analytics help

P.S. If you haven’t specified UTM values for one or more of these parameters (utm_campaign, utm_term, utm_content), Google Analytics uses the auto-tagged values for those parameters instead.

Final Thoughts

We hope this blog post raised your awareness of some best practices about UTM parameters and will help you avoid these common issues in the future.

Here’s some additional reading on the subject:

If you have any questions or feedback, please post them in the comments section below. We may even use them to update this guide and make it even more valuable to everyone.

7 Comments. Leave new

  • Hey Taavi,
    outstanding and very elaborative article. Concerning number 21: have you checked out https://www.utm-builder.com/live-demo/ this is by far the best way for consistent and fast UTM Tracking throughout an entire organization! Cheers

  • Hello;
    Great article! Do you know if we can use UTM paramters on actual page urls (rather than just in links) to record traffic by different criteria? Here’s an example. Let’s say we have a site called “website.com” and we want to track all visits to pages dealing with dogs. If we modify the urls for all pages talking about dogs to something like “www.website.com/?utm_source=topics&utm_campaign=dogs” would all visits to that page be recorded in our campaign reports?

    Thanks so much for your help.

    • Hi Dan,

      Great question. I wouldn’t recommend appending UTM parameters to your internal links/URL-s.

      For example, if someone lands on your website (website.com) after clicking on a link on Facebook, Google Analytics will start a session and attribute it to Facebook.

      Now, if this visitor land on your internal URL (website.com/?utm_source=topics&utm_campaign=dog) where you’ve attached UTM parameters, Google Analytics will start a new session and attribute it to your internal campaign (source = topics, campaign = dog). As a result, you’re inflating your session count and messing up a lot of metrics.

      You’re going to overwrite the original referrer and that’s a problem.

      Take a look at these paragraphs:
      1) https://holini.com/utm-parameters/#9
      2) https://holini.com/utm-parameters/#10

      Hope this helps.

  • Hi Taavi,
    thank you for the great article! There are a lot of useful information in it.

    What is with tha canonical links? I can’t find the utm-parameters in such links. However sometimes I see sthat the utm parameter are recognized (i.e with GoogleTagAssistant or in the real time report in GoogleAnalytics), but sometimes – not. Could you write, what do you think about the utm-tracking if the canonicals are present?
    Thank you for your help.

You must be logged in to post a comment.
155 Shares
Share
Share
Pocket
Buffer
Tweet