Custom Campaign Tagging using UTM codes in Google Analytics (Universal & GA4) | GlowMetrics

Apr 30th 2021

Digital Analytics Insights

7 min read

Posted by Joanne Kearney

Custom Campaign Tagging using UTM codes in Google Analytics (Universal & GA4)

Do you invest your time and money in social campaigns, email campaigns or non-Google display campaigns? Do you stop and think about tagging these campaigns so you can see the...

GlowMetrics Social Link GlowMetrics Social Link GlowMetrics Social Link GlowMetrics Social Link GlowMetrics Social Link

Do you invest your time and money in social campaigns, email campaigns or non-Google display campaigns? Do you stop and think about tagging these campaigns so you can see the value of the traffic clearly in Google Analytics?

If not and if you can’t see this traffic coming through in Google Analytics under the ACQUISITION reports you could be a victim of lost traffic. 

What is lost traffic?

Traffic that is lost, is so because it is generally untagged, and as a consequence Google Analytics can’t accurately determine the source the user came from due to lack of detail. For example, you might look at your traffic sources report and expect to see email traffic listed alongside paid search traffic. Not there? Then it’s likely muddled in with your direct traffic, or it could be coming through as referral traffic. 

It’s the same with social traffic; while you might see Facebook social traffic coming through as a Facebook referral visit, how do you know if this is through an organic or paid post link that you shared, or a link that someone has taken from the site and posted to a friend’s profile who has then clicked on it?

While we can’t define or tag the link being used in the latter scenario, what we can do is by process of elimination, work out what links HAVE NOT been posted or shared by the business by decorating the links we DO post. 

Why spend time tagging links?

Tagging campaigns has a number of advantages including:

  • You’ll have cleaner Google Analytics reporting
  • You’ll have cleaner Data Studio reports
  • You can build out neater custom channel groupings using your newly defined sources/mediums
  • You can use these custom channels for better Multi-channel funnel and attribution analysis
  • Thankfully, GA4 (the new version of Google Analytics) also accepts UTM tagging so if you are dual tagging at present i.e. running both GA4 and Universal Analytics, as Google recommends, then these tags will work in segmenting traffic correctly via both versions.

Ultimately, you’ll end up making more accurate decisions about the effectiveness of your online campaign efforts.

How do we ensure Google Analytics categorises our traffic correctly?

Any online campaigns that you run – where you control the link – can be tracked, but this requires the use of custom campaign tracking; in other words, URL decoration that is achieved using Google’s URL builder tool that pushes details about where the user has come from, through UTM parameters in the URL.

What are UTM links & UTM Parameters?

UTM links are URLs with codes attached to them that help you to track that URL with more precision. This piece of code consists of different UTM parameters.

In summary so far:

For any online campaign where:

  1. You have control over the link that people click on 
  2. There is no option to use auto tagging OR you don’t want the auto tags to be used as they are not descriptive enough of where the traffic is coming from, OR the website set-up rejects additional UTM parameters

…it is important to take some time to tag the links with descriptive text so Google will:

  1. Identify this traffic as online campaign traffic
  2. Label the traffic as per your descriptions provided

Custom Campaign Tagging Guide

 

 

 

 

 

 

 

 

To track campaigns, parameters need to be added to the end of the URL that you use.
The easiest way to create these links is via Google’s URL builder tool: https://ga-dev-tools.appspot.com/campaign-url-builder/ The parameters on the left are variable -value pairs that contain the detail identifying the traffic. You simply fill out the fields on the left, making sure that you at least populate the Website URL, Campaign Source, Campaign Medium and Campaign Name fields.

There are a total of five parameters that you can use:

utm_source: This refers to the exact source of where your traffic is coming from and could be anything from a social media platform to an email marketing list. In the above example the source parameter is Facebook, which shows that the traffic is coming from Facebook. 

Source parameters are added by typing the name of the source after utm_source=

utm_medium: The medium parameter tells you exactly what type of traffic you’re getting- whether it’s social, referral, email or any other type of traffic. In the above example, the name of the medium is social, which means the traffic is coming from social media. 

Medium UTM parameters are added by typing the name of the medium after utm_medium=

utm_campaign: As the name suggests, this UTM parameter can help you trace your traffic back to a specific marketing campaign. This can help you track exactly how much traffic each individual campaign is driving and whether it is successful or not. In the above example, the name of the campaign is sale. Campaign UTM parameters are added by typing the name of the campaign after utm_campaign= utm_term: 

The keyword parameter allows you to track which keyword term a website visitor came from. This parameter is specifically used for paid search ads. Term UTM parameters are added by typing the name of the term after utm_term= utm_content: Used to differentiate similar content, or links within the same ad. For example, if you have two call-to-action links within the same email message, you can use utm_content and set different values for each so you can tell which version is more effective, or this can be used to indicate the ad size e.g. MPU v’s Leaderboard. Content UTM parameters are added by typing the name of the term after utm_content=

For example, the tag utm_source=newsletter identifies that the traffic came from a newsletter and the tag utm_campaign=may identifies that this was the campaign in the month of May. There is no limit to the number of values you can have, but we recommend you use transparent names and keep track of what campaigns each value relates to.

The parameters from a URL are separated with a question mark. Variables and values are separated by an equals sign. Each variable-value space is filled with an ampersand. Parameters can be added to a URL in any order, but must use the proper syntax. 

utm_term (Campaign Term) and utm_content (Campaign Content) can be used for tracking additional information about your campaign, but are not required fields.

 

 

 

 

 

Once you add the UTM code to your campaign’s URL, you can track the performance in Google Analytics in a few different reports.


> Go to Acquisition -> Overview -> All Traffic -> Source/Medium to view traffic > Go to Acquisition -> Campaigns -> All Campaigns to view traffic based on your custom campaign names. Here you will be able to analyse how traffic from specific campaign subsets are interacting with your site. Best Practices for Campaign Tagging

  • Tag only what you need

There are certain links that you don’t need to tag and many times are not able to tag. The URL builder tool DOES NOT need to be used for search organic listings as the URL that is used by Google is taken from the crawl of the website, conducted by the bot. The other common cases where manual tracking of links does not need to occur is for Google Ads campaigns as there is the ability to link an Ads and Analytics account. Apply auto tagging and Google will automatically take the traffic source details from Ads and push this into campaign reports in Google Analytics.

  • Check that there isn’t an option for auto tagging in other non-Google products (if there is this will save you time)

Because Google Analytics is used by the majority of websites, some online campaign distribution tools allow you to simply tick a box and the links that are pushed out are automatically tagged with UTM parameters. Mailchimp – one of the most common email platforms – has a simple tick box option, as do many social post scheduling tools.

  • Google Analytics does not change the case of the text you use in the fields

Google Analytics is case sensitive, so you should decide whether you are going to use all upper case or lower case in your string fields. For example, utm_source=google will be tracked different from utm_source=Google in Google Analytics, i.e. they will appear on two separate lines. Case sensitivity applies for each variable that you define, so choose a case and stick with it. This leads us onto our next point- naming conventions.

  • Establishing naming conventions is key

It’s important to establish naming conventions that your entire team will use. If someone on your team uses “facebook.com” and the other half uses “facebook” for the source, or someone writes the medium as “social” vs “social media” you will get muddy data. Capitalisations or spaces will make your analytics a mess by splitting the same campaigns into 2.

  •  Use Easy to Understand Names

Your campaign, content and source links should be easy to understand. Anyone looking at the code should be able to figure out at one glance what the code means. 

  • Use Link Shorteners for User-Friendly URLs

The complexity of a UTM code is directly related to its length. As you start running more sophisticated campaigns, your URLs will become longer and longer. This isn’t the best thing from a UX perspective. The solution: link shorteners. By using Goo.gl or Bit.ly, you can turn lengthy links into more shareable URLs. The shortened link will still keep the UTM parameters in-tact- this is especially helpful for your social media posts. Some people will also opt to use branded shorteners as well. These are available to purchase via Bit.ly so for example, if you don’t want to use bit.ly/xxxxx you can use glo.mt/xxxx. Did you know you can also use short links for TV, Radio and Press campaigns with hidden UTM links? Meaning that, alongside your online campaign sources e.g. paid social, organic social, display, email, etc… you would also be able to view TV, radio, press or outdoor driven traffic.

  • Have lots of links to tag?

If you’ve lots of links to tag in bulk, e.g. you are running Bing ads and needed all your keywords tagged, then you can replicate what the URL builder tool does, by using the concatenate formula to create a dynamic tagging template that auto generates the decorated link. You can view an example of this in our sample sheet here:  https://docs.google.com/spreadsheets/d/1ZCkQzg-gDqXl7Nrneg5o_8xkU9M7gUEfkp3M5xSltoc/edit?usp=sharing If you are using the manual linking via Concatenate- just make sure you:

  1. Copy the formula and then PASTE SPECIAL – VALUES to get the final link that you use for your online campaign.
  2. When you are populating your fields DO NOT leave any spaces- separate the values you use with either a dash, an underscore or %20 (what the UTM tool uses). Remember a URL will not function if it includes spaces so don’t use any!

  • You don’t need to modify code on your website

We commonly get asked if you need to tell Google Analytics that you are using these codes or modify your current GA code. The answer is no! Google Analytics will read the URLs as they come in and recognise them automatically, then segment your traffic accordingly. You also DON’T need to make any changes to your Google Analytics or Tag Manager code – you just need to ensure you are decorating the links that you push out to your audiences and Google Analytics will do the rest. So there you have it, if you want to better segment your inbound traffic and lose the ambiguity around where users come from, start tagging! 


GlowMetrics Social Link GlowMetrics Social Link GlowMetrics Social Link GlowMetrics Social Link GlowMetrics Social Link

6 responses to “Custom Campaign Tagging using UTM codes in Google Analytics (Universal & GA4)”

  1. Guilherme Lopes says:

    Great overview. However, GA4 is mentioned and currently there are lots of limitations of UTM links which seem that aren’t working properly in GA4. Lots of traffic is going to direct even though links are properly tagged.

    • Hi Guilherme,

      Thanks for your comment. UTM tagging is referenced in official GA4 documents as the approach that should be used for online campaign tracking. We had been testing this out before writing the blog and found that it did work and was reporting around a 10% higher number of sessions when compared to the same campaign traffic in Universal Analytics. Obviously there will be some discrepancy in GA4 v’s UA stats but in our tests, UTM tracking did work in GA4.

      That’s not to say that your point isn’t valid, Google are still making updates to the GA4 product plus there could be other reasons outside GA4 that are causing your UTM parameters to be dropped and/or not recognised. If you are still using Universal Analytics how do the numbers for tagged campaigns compare for you?

      • Joseph Kos says:

        Hi Joanne, are you certain you were able to use it? If yes, you either have a special GA4 account, or me and other bunch of people do not know how to do it. As Guilherme mentioned GA4 UTM tagging does not works yet. Would you be so kind and outlined in your article, how did you make it working?

        • Hi Joseph, yes it works and I can see the traffic that we used UTM codes for in our GA4 reports under the same source/medium/campaign names we used as UTM parameters. We can see the same across client accounts too. Happy to look into this further for you to see what the issue might be if you want to drop me an email: joanne[at]glowmetrics.com.

  2. Dimitar says:

    Hi Joanne! Yes indeed, I can confirm that it works and utm data is indeed visible in GA4. However, we can’t see the utm_content parameter which was available (as well as a bunch more useful parameters) in UA. Could you kindly confirm if you are having the same issue? This is very annoying, especially for facebook ads (both single image and carousels especially).

    • Hi Dimitar,

      Yes- utm_content and utm_keywords aren’t unfortunately available in GA4 at present. If we notice this changing, I’ll reply to this comment and let you know but in the meantime you could update the campaign name to include the ad type. Not ideal as this wouldn’t be consistent with the naming convention you are currently using and feeding through (into both Universal and GA4), but at least you’d have some way of distinguishing the ad type if both ad types use the same URL.

      Kind Regards,

      Joanne

Leave a Reply

Your email address will not be published. Required fields are marked *

GlowMetrics

Posted by
Joanne Kearney

Joanne has over 10 years’ experience working in digital analytics, executing and managing many large scale projects across the UK and Ireland. Joanne is also an experienced trainer, having developed many customised corporate training schemes and regularly speaks at digital and analytics events.
Read more from Joanne Kearney

Browse by Category



GlowMetrics
Optimise your website and marketing campaign performance with Ireland’s leading digital analytics agency
Sign up to our newsletter