Talk to one of our Senior Strategists
Send us a message, and we’ll get back to you shortly.
Join us on Thursday, December 5th, at 12:00 PM (GMT +2) to gain a deeper understanding of GTM server-side tagging. Read more.
Google Analytics UTM parameters are a very handy way to track your online marketing efforts. They’re used to capture important reporting data and they help you figure out which posts, banners or emails bring the most traffic and customers to your website.
Although pretty much all digital marketers should be using Google Analytics UTM parameters, we’ve seen that many of them are still not doing it. There are probably a couple of reasons for this.
In the following tutorial, we will focus on the third reason and show you how to hide the UTM parameters with Google Tag Manager, so that you could still keep using them.
In some cases, you’d really like to track the performance of different links, but don’t want to attach the “ugly” UTM parameters to the end of the URLs. Let’s go through some of the following examples to get a better picture.
It’s useful to know how many people click on the link on your company page on LinkedIn so that you can separate this traffic from the rest.
At the same time, you probably don’t wish to see those ugly Google Analytics UTM parameters at the end of your company’s website address.
Would you like to be a hardcore data-driven sales person who knows exactly how much your specific lead knows about your business and your services before you make a call?
If you attach the Google Analytics UTM parameters to the end of this website URL, you can analyze the user journey later with tools like Google Analytics and HotJar. After that you can know exactly what a specific person knows about your business and your services before you call her or send another email.
But I guess that in a lot of cases, you wouldn’t want to drive your potential customer to an URL like this:
https://holini.com/?utm_source=signature&utm_medium=email&utm_campaign=Taavi
How would you know the number of people who click on the link on your Facebook profile page?
And how could you separate this traffic from the rest?
These are just some of the quick examples from a variety of places where you normally wouldn’t use any UTM parameters.
You can use simple URL fragments and some Google Tag Manager tricks to hide the UTM parameters and still keep tracking different traffic sources with Google Analytics. For this, you can use a feature in Google Tag Manager, called the Lookup Table.
This is probably the easiest way to do it.
So how can you turn your long URLs with Google Analytics UTM parameters like this…
https://holini.com/?utm_source=linkedin&utm_medium=social&utm_campaign=profile+page
… into short and sweet web links that can look something like this (and still track your traffic source)?
https://holini.com/#agency
First of all, you need to have Google Tag Manager installed on your website to make this happen. If you’d like to learn more about Google Tag Manager, you should take a look at this amazing Google Tag Manager tutorial for beginners.
While this tool allows users with even minimal technical experience to start creating tags, triggers and variables in a matter of minutes, the installation itself may require an upfront effort and close collaboration with your web development or IT team.
Simo Ahava’s post called Tag Management Does Not Make IT Redundant pointed out 10 suggestions for making the deployment and the use of tag management systems more manageable for both the marketers and the IT department. Highly recommended reading if you’re either a developer or a marketer who’s taking the first steps towards becoming a tag management ninja.
Bear with me. It’s not THAT difficult. We’ve got you covered!
I recommend reading the Google Tag Manager Naming Strategies to Organize Your Container article written by Zee Drakhshandeh to learn more about the naming strategies.
Now, you’ll need to create three Lookup Table Variables in Google Tag Manager – one for utm_source, one for utm_medium, and one for utm_campaign. Then you’ll need to choose the URL fragment as the input variable for each of the Lookup Tables and match it with the values for the source, medium, and campaign that you would like to send to your Google Analytics property.
A step-by-step guide
Let’s go through an example and create a custom link for your Sales Letter, LinkedIn and Facebook profile pages.
Set up a Lookup Table for different Mediums
Set up a Lookup Table for different Campaign Names
The final setup piece is to send the output of your Lookup Tables into Google Analytics. You can use your generic Universal Analytics Page View tag that is already set up in Google Tag Manager.
The values will now be sent to Google Analytics just as if you were using the UTM parameters: utm_source, utm_medium and utm_campaign.
Here’s how it looks like in the Google Tag Manager:
Now it’s time to test if everything you’ve done works properly:
Take a look at the screenshot:
You should also check your Real-Time Traffic Sources report to see which mediums and sources referred the users who are on your site right now. You should see yourself in this report as well.
Even though using shorteners (e.g bit.ly) is a good way to hide tracking information and make URLs shorter, they still do not seem be 100% trustworthy and there are a lot of reasons why I prefer not to use them.
Things to keep in mind when using URL shorteners
In some cases, you also might want to put UTM tags on 301 redirects.
URL fragments are much more acceptable and trustworthy than UTM parameters and shortened URLs.
I believe that it’s not too much hassle to go to Google Tag Manager before publishing a new link and adding some values to your Lookup Tables. Especially, if those are the links that you want to track without showing Google Analytics UTM parameters.
The inspiration for this post came from the articles written by well-known GTM practitioners:
Hopefully you learned something new. Feel free to share any other feedback on Twitter @holini or in the comments section below.
9 Comments. Leave new
my redirect table is dropping the appended GTM input
Do you have a resource tip on how to keep the tracking parameter on the redirect? or my options? i can possibly create (…/#agency) that redirect to the long URL with tracking but then that defeats the purpose of the lookup table…right?
thanks in advance
Hi Ivan,
Would you like to hide UTM campaign parameters or they are just disappearing after the page loads?
Hope you can clarify.
I’ve understood the basics but I am unable to understand the name of input and output.
First of all, is it possible to totally hide? Just to say that input is left blank. Is it meaningful?
Secondly, let’s say I imagine I have n campaigns made with x medium and y sources, how should I manage for a right naming?
Moreover, what’s input and what’s output? The parameter after utm_campaign when I use UTM is output? If so, may I leave the input blank or set something like a number.
What does it happen whether:
– 1= linkedin
– 2= facebook
– 3 = instagram
1=e-mail
2= social
3= blog
1= client1
2= client2
and so on….
how should I manage client1, social and facebook #111?
Thanks
Hi,
If you’d like to totally hide, you should put UTM tags on 301 redirects.
Only the utm_source parameters is required but I highly recommend using all 3 parameters (source, medium and campaign).
Your example: Client1, social, facebook.com
Now, you should update all your lookup tables:
Lookup – URL – Fragment – Campaign Name
1 -> Client1 (input -> output)
Lookup – URL – Fragment – Medium
1 -> social
Lookup – URL – Fragment – Source
1 -> facebook.com
URL that you should use: yourdomain.com/#1 that is equal to yourdomain.com/?utm_source=facebook.com&utm_medium=social&utm_campaign=Client1
Hope this helps.
Hi Taavi,
I’ve set up my tags as instructed (you explained it very well), and I see that they are all firing correctly when I used GTM Preview mode.
However, I’m now trying to see how that translates to Analytics. I’m not actually sure if GA is displaying the Source/Medium/Campaign according to the fragments I’ve created. How would I go about testing that? I’m looking at the Realtime reports, and the Acquisition reports, but I can’t see that the UTM parameters are being tracked. They only show up in reports when I use the full UTM URL.
Hi. Sorry for the late response.
You don’t need to create a custom report. You should see those Source/Medium/Campaign parameter values in your Acquisition reports and also in your Real-Time report.
Make sure you haven’t created any filters that might prevent this data from being processed by Google Analytics. In addition, make sure your fragment remains at the end of the URL when the page is loaded.
Recommend reading this article about UTM parameters to learn more about debugging: https://holini.com/utm-parameters/
What’s the URL of you website? (I will double-check your tracking quickly)
Great question Palexk, I came across this as well and what’s not explicitly explained here is with Step 4, how using “fields to set” on pageview overrides default parameters for that hit (this is a good thing, you want this to happen). I was puzzled by this myself, and after some research on “fields to set”, campaignName, campaignSource, and campaignMedium are the field names that GTM recognizes to replace with the custom Campaign, Source and Mediums and sends it along with that pageview hit.
Lunametrics talks about it here: https://www.lunametrics.com/blog/2016/09/27/fields-set-google-tag-manager/
[…] How to Hide Google Analytics UTM Parameters Using Google Tag Manager […]
[…] 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. […]