How to Prevent Verification Emails Screwing Up Your Attribution in Google Analytics

The problem

Note: An updated method of solving this attribution problem is demonstrated here.

Imagine this scenario.

  • A user signs up for an account on your website, having arrived on the site via a PPC ad.
  • Your systems emails them a validation link in their email that they must click on to verify their account.
  • You want to track the number of verified accounts, and attribute them back to the correct channel, medium and source.

You set up a custom metric called ‘Verified Applications’ and set up Google Tag Manager to increment this value when the post email link click page is viewed (obviously I’m simplifying things – we wouldn’t want someone refreshing the page to increment our metric in real-life).

A week later you produce a report for the marketing team and to your horror see that all verified applications have been attributed to the Referral channel, and the list of referring domains are all email providers.

Clearly something is wrong with your attribution.

The reason

What’s going on? Well, whenever Google Analytics detects a change in channel it starts a new session. People clicking on the link in the email cause a new session to be started and attributed to the referral channel (assuming you haven’t added UTM parameters to the link) because it doesn’t have any UTM params.

Adding UTM parameters doesn’t help either. You could change your email verification link to:

mydomain.com/?utm_medium=email&utm_source=email&utm_campaign=verification

but this would transfer the problem. The ‘Verified Applications’ metric will be attributed to the email, but this isn’t what we want. We want it attributed to the initial channel that brought the person to the site and caused them to complete the registration form.

Wait, what about utm_nooverride?

In the olden days of ga.js (the previous version of Google Analytics) there was a special utm parameter called nooverride. You could add this to any URL and Google Analytics would ignore channel information, picking up the channel information from the previous session, if it existed, or assigning someone to the Direct channel otherwise.

To solve our dilema above, we would just have to change our email verification links to:

mydomain.com?utm_nooverride=1

and our verified application would be attributed to PPC, not referral or email.

However, this option was removed from the new version of Google Analytics. If you are using analytics.js, this parameter no longer has any effect.

Bringing back the utm_nooverride param

So what’s a Google Analytics implementation specialist to do? We are going to create our own parameter that has exactly the same effect, that’s what!

To make things simple, I’m assuming you’ve implemented GA in GTM, although you can adapt the following technique for any style of implementation.

Step 1. Create a utm_nooverride variable in GTM

Create a variable in GTM called u.utm_nooverride (I prefix any variables that are derived from URLs with a u.). Set the type to ‘URL’, the Component Type to ‘Query’, and the Query Key to ‘utm_nooverride’. Save the variable.

This will read the URL parameter and set it in this variable.

utm_nooverride in GTM

Step 2. Create a variable in GTM to override campaign source

The next step is to use the first variable to determine if we should override the campaign source when setting up the GA tracking, and what the value should be.

Basically, if the utm_nooverride parameter exists in the URL then we want to set the campaign source to ‘(direct)’. This will ensure that the referral information is ignored, and GA will naturally associate the session with whatever channel the previous session was attributed to.

To do this, create a GTM variable called u.campaignSource. Set the type as custom JavaScript, and enter the following code:

gtm_custom_js

What does this code do? First it checks if the previous GTM variable we set up exists or not. If it doesn’t exist we return a null value. If it does exist we return the value of ‘(direct)’.

Step 3: Override the campaign source on the GA tracker

Head into the settings for your Universal Analytics tag, and expand the ‘More Settings’ -> ‘Fields to Set’ area. In there add a new field called ‘campaignSource’ and set the value as ‘u.campaignSource’.

Override campaign source in GA

What does this do? Our u.campaignSource variable can only be two values: null or (direct) when the utm_nooverride param is set in the URL. If the value is null then it will be ignored by GA and the campaignSource field won’t be set. Otherwise, it will be set to ‘(direct)’ and our campaign information won’t be overridden.

Summary

  • utm_nooverride doesn’t work with Universal Analytics
  • You can replicate the feature manually by overriding campaignSource when creating the Google Analytics tracking if a parameter of utm_nooverride exists in the URL.
  • This will help you correctly attribute sign ups to marketing activity.

 

Still having problems? A Google Analytics Consultant will ensure that you are making the most of the marketing benefits of Google Analytics.

Ed Brocklebank is the founder of Metric Mogul, a digital analytics consultancy. He helps business of all sizes become more data-driven through marketing technology. He runs training for General Assembly London on Google Analytics and Google Tag Manager.