The Death of UTM Campaign Parameters in Google Analytics

The Death of UTM Campaign Parameters

/

blog-utm

UTM campaign parameters. We love them. We hate them.

They make it easy to track both online and offline marketing efforts. But they aren’t very pretty to look at, and they’re difficult to implement reliably, especially for a layperson (i.e. non-technical person).

Often, there’s a situation where we want to track a number of different approaches or people contributing to a campaign. Imagine the pushback you’ll get when you suggest each person modifies their UTM parameters to personally identify themselves or the approach they’re using.

Fortunately, there’s an easier way to track certain types of activities without having to resort to including all those UTM parameters. We can use a simple URL hash and some Google Tag Manager magic to uniquely identify each person.

The Problem

To illustrate this problem, I thought a personal anecdote would help. I was recently looking to buy some extra RAM for an older Mac Pro. I wasn’t sure what to get, and I had questions about sizes and configurations. Googling for answers brought up a host of forums with the same questions I had, and answers to those questions.

Now, imagine for a minute, that you own a company called RAM and You, which sells RAM for Mac Pros. You know the answers to a lot of computer hardware questions, including mine. And you have a support team that actively goes on third-party forums to answer questions, often linking back to your site and specific products.

Now, when you look at your Referrals report in Google Analytics, how do you know which users (and associated revenue) came from people who clicked on links left by your support team vs. people who clicked on links left by other people?

In other words, how much value is your support team driving by spending their time on these forums answering questions?

It’s always been possible to track this type of activity. You just had to have each member of the support team add UTM campaign parameters to the end of the links they shared on these forums. So if they shared a link on MacRumors, it would look something like:

ramandyou.com/apple/memory/Macbook_Memory?utm_source=forums.macrumors.com&utm_medium=referral&utm_campaign=support

Not only is that an ugly link to share in an answer on a forum, it’s also hard for a non-technical person to remember and get right (there are 73 characters/opportunities for typos in those utm parameters!).

The Solution

What if, instead, you just shared the following link:

ramandyou.com/apple/memory/Macbook_Memory#1

Two extra characters. Simple. Clean. Not ugly.

Two extra characters & GTM

There are two basic parts to making this work. The first part is modifying the link (adding those two extra characters). The second part is capturing the value included in the link and passing that through to Google Analytics.

The steps below will illustrate how to do the second part using Google Tag Manager (GTM). It can also be done without GTM, you’ll just need to write some scripts and add them to your site manually.

Part 1: Identify Yourself

To track your support team’s efforts (while at the same time making it easy for them to implement) simply add a number to the end of the link URL being posted in the answer (like shown above). This number can identify which support person left the answer or which team/office/vertical was involved.

For example, if you have 3 support team members posting answers on third-party forums, you would assign each person a number – 1, 2, and 3. If person 1 posts an answer linking back to your RAM installation videos, the link URL would be:

ramandyou.com/installvideos/#1

A couple of things to note about this format:

1. We’re setting this number as part of the URL fragment. A URL fragment is the part after the hashmark (#). This is important because Google Analytics ignores URL fragments, so you won’t see the same page showing up three different ways in your reports.

2. The number after the hash (#) would identify which support team member left the response. So each support team member would have their own number, and each would add a different number to the end of their links (e.g. #1, #2 and #3).

If this is not important to you, you could use this parameter to identify other information you’d like to know (e.g. which brand or product the post was about). Just keep it simple, easy to remember and easy to to type in for the support team members leaving the answers.

3. This works as long as the page you’re sharing doesn’t already include a fragment. For example, if you’re sharing www.example.com/awesome-page#section2, you can’t just add an additional hash at the end (www.example.com/awesome-page#section2#1 will not work). In this case, you would need a slightly different solution (e.g. use query parameters instead of URL fragments).

4. Rather than messing with source/medium/campaign, we’re using a Custom Dimension to group all activity from one of these links together. If that link that was posted by your support specialist gets tweeted or passed around, you’ll still see exactly where the traffic is coming from, but you’ll also be able to attribute it back to the correct team member.

Part 2: GTM

In Google Tag Manager, we can capture the value of this URL fragment (when it exists) and send it as a session-level custom dimension.

To do this, first we need to create a macro in GTM to grab the URL fragment. This is easy (see below):

gtm-utm-1

This macro will grab the value after the hash (#). So for ramandyou.com/installvideos/#1, the value of this macro will be 1.

Then, we need to create a Lookup Table Macro that matches the value of the previous macro to the appropriate support team member.

lookup table macro

This macro looks at the {{url fragment}} macro we just created, and based on that value sets the appropriate name for the support specialist.

So now that we have our {{support specialist}} macro, we can use that in our Google Analytics pageview tag. I recommend setting this as a session-level custom dimension (which requires first setting up the custom dimension in Google Analytics).

custom dimensions google tag manager

Now that you’re sending this as a custom dimension, you can use this in your reports or build a custom report that shows you exactly how much each of your support team members contribute to site traffic and revenue!

utm-custom-small

Jim Gianoglio is a Senior Analytics Consultant. He works with implementation, analysis and training of Google Analytics and Google Tag Manager. Before focusing on analytics, he led the SEO campaigns of Fortune 500 companies in the insurance, retail and CPG industries. Things you didn’t know about Jim: he’s biked from Pittsburgh to Washington DC in 41 hours, roasts coffee beans and has done voiceovers for TV commercials.

  • http://www.hub-scan.com/ Julien Coquet

    Nice and slick, thanks Jim!

  • https://plus.google.com/108774090143038749085 Jim Gianoglio

    Thanks Julien! Always happy to beautify our URLS.

  • Sayf Sharif

    I’d like to point out how awesome I am at supporting people at macrumors.com#4

  • Mickael ROBIN

    Thanks for the post.

    I found the params shortening idea interesting.

    In that case (assigning support agent) populating a custom dimension via GTM is OK, but it is worth noticing that session-level custom dimensions are not proper acquisition dimension.

    Most importantly, custom dimensions can’t be used for custom channels grouping, which is a very useful feature for acquisition and attribution analysis.

    Personally, I ended up concatenating several criterias in Campaign Content (utm_content) (on top of potentially put them in dedicated custom dimensions) to be able to populate custom channel groupings.
    => any opinion on this?

    Mickael

  • https://plus.google.com/108774090143038749085 Jim Gianoglio

    @Mickael –

    You make a good point, but the acquisition analysis can be done just as easily by applying a secondary dimension to the channels report, or creating a custom report. I originally went down the path of using the short parameters to change the source, medium, campaign, etc., but found it much easier and less error-prone to just record it as a custom dimension.

    I do like the idea of adding the info (and more) to the campaign name and content fields (while leaving the source and medium intact).

  • http://www.conversionworks.co.uk/ Aime Yann Mbabazi

    Awesome post. I Like it. Just one question:what will happen if another company or competitors start to use the same value like yours? Mayhem? If the solution is to use a complicated value such as #fghzk3 and be unique; surely we are back to square one. aren’t we?

  • https://plus.google.com/108774090143038749085 Jim Gianoglio

    @Aime –

    Yes, there is the possibility that other people could add these simple parameters when sharing links to your site, and that could pollute your data. But they can already do that with utm parameters. I don’t think this is a big concern (unless you have nefarious competitors).

    The bigger concern (which also applies if you’re using utm parameters) is if a user lands on a page with those parameters, then copies the URL and shares it with other people (through email, social media, IM, etc).

    But as long as you’re not changing the source/medium, but just using a custom dimension to store the name of the support team member (following the example in the post) then this is actually beneficial. If support team member #1 leaves a comment/link on a forum, and user X clicks on that link and shares it with users Y and Z, then it could be argued that support team member #1 should get credit for driving all three users to the site.

  • Ben

    Oh, the irony of having landed here with UTM parameters from your Google+ channels! 🙂
    In all seriousness, though, great article, example, and argument for leveraging this. Thanks!

  • GG

    Hello,

    Your solution is real interesting but when you create 2 URLs like :
    – ramandyou.com/installvideos/#1
    – ramandyou.com/installvideos/#4

    It’s 2 URLs for a same page and so same content. Can Google consider this as duplicate content?

  • Joe Chasse

    Jim, how will this approach work if the URL already contains a hash in the URL (used for deep linking to content within AJAX)? Thanks.

  • http://www.affordableseoindia.com Rajan

    Nicely framed understood. Good job thanks for the sharing wonderful post

  • Udi Sabach

    Hi Jim,

    i have a slightly different challenge that i think i can solve using your method. We have a handful of traffic that are hitting the site using a utm_campaign=catalogbrochure-us2015 This traffic is a bit suspicious, so i’d like to overwrite the source UTM for all traffic with this campaign value with GTM’s built in Referral variable. So we can see the true referral of this traffic.

    Do you think this will work? Or is there a more preferred method for accomplishing the overwrite?

    Thanks,
    Udi

    • Jim Gianoglio

      I have another blog post that maybe better explains how to do what you’re trying to do:

      http://www.lunametrics.com/blog/2014/06/11/campaign-tracking-dynamic-source/

      You could update the source based on the value of your utm_campaign (i.e. if the campaign is catalogbrochure-us2015, then update the source to be the built-in {{Referral}} variable in GTM).

      However, one thing to keep in mind if you use this method is that if the {{Referrer}} is undefined, then it will not set the source at all. Since the source is required for campaign tracking, if you don’t set it Google will just ignore all the campaign parameters, result in a session that shows up as Direct.

      The best method is to leave the campaign parameters alone, and just capture the {{Referrer}} as a custom dimension. This gives you all of the possible pieces of information, without any inadvertent side effects.

      • Udi Sabach

        Thank you.. i did try to set {{Referrer}} as a custom dimension, but it’s not pulling any values.

  • Paul

    How would this work with Single Page Apps, that rely on the fragment for routes?

  • Ben Reed

    Great post. I have what may be a beginner question.

    Since you are creating a custom dimension and you are now no longer relying on the UTM parameters that define source, medium, and campaign, then my assumption is that we are no longer able to track these parameters.Is this a problem? Or are we still tracking them somewhere that I cannot see.

    If you are in fact no longer tracking these parameters, my assumption is that despite the lack of this knowledge, because we set up the custom dimension, and we still know the source (would we?), we can deduce that the medium was a referral (i.e. this parameter is no longer explicitly needed….but wasn’t this always the case?).

    Yet, what happens if the support team is posting on different sections within the forum. For example, let’s say the link is posted to different categories that may ultimately relate to one another. Wouldn’t we want to know what those categories are beyond just the overall source, or would this be reflected in the source (this is obviously dependent upon the respective forum we are speaking of). Wouldn’t this data require a UTM parameter?

    Overall, my question and related struggle is what data are we losing by using the URL fragment opposed to the UTM parameter?

  • http://www.danielmelbye.com/ Daniel Melbye

    I have a question about the source UTM code for emails. Many people recommend using the email list/segment in this section, but I prefer to group this in campaign, as I use lists for retargeting and I want to group this information together in the same way. In my mind the source for email should be the email client that the person who views the email uses. Is there any way to grab that information with a link?

  • databackup

    Amazing how clear a marco can make things. I have been using http://www.whysr.com/ for omni marketing tags, outside of google builder. I am going to try the above across social sites see how it cleans up my reports. As always good post.

Contact Us.

LunaMetrics

24 S. 18th Street, Suite 100,
Pittsburgh, PA 15203

Follow Us

1.877.220.LUNA

1.412.381.5500

getinfo@lunametrics.com

Questions?
We'll get back to you
in ONE business day.