Warning: this content is older than 365 days. It may be out of date and no longer relevant.

How Google Analytics Decides Attribution Tracking

One of the more opaque things about Google Analytics is understanding how the software processes various types of tracking codes. If we don’t know how Google Analytics interprets the different kinds of tracking that it uses for attribution, then we may not be able to explain changes in our analytics data.

The Importance of Good Tracking

Why do we care about Google Analytics tracking? For one straightforward reason: attribution. We want to know what’s working, and the only way to know what’s working is if we’re tracking everything we’re doing. For example, if we look at the multi-touch attribution model from my website using Google Analytics data, we see the following:

Multitouch attribution model

When we’ve got everything set up correctly, when our tracking codes are working, when we leave as little to chance as possible, we understand our marketing. We understand what’s working, what’s not working, and we can match our results to our efforts. Above, this model looks at the last 3 months of conversions on my site, by channel, using a multi-touch model. How much time and effort should I put into, say, YouTube? The answer is pretty clear: YouTube didn’t make the top 25 sources of converting traffic, so the amount of time I should put into it is minimal.

If you want proper attribution, you must have proper tracking. To understand proper tracking in Google Analytics, we should know how Google Analytics processes its data. So let’s explore the order of operations to see how this sheds light on common marketing analytics practices.

Basic Rules of Google Analytics Processing

There are two basic rules to Google Analytics tracking, when it comes to various tracking methods:

  1. Paid overrules unpaid.
  2. Known overrules unknown.

Generally speaking, paid traffic always overrules unpaid traffic. If I go to SomeWebsite.com from a Google Ad and then I type in SomeWebsite.com a few minutes later (within the session timeout window), my session will still be attributed to the Google Ad.

The same is true if I click to SomeWebsite.com from, say, Blog.com. Blog.com is a known referrer. If I type SomeWebsite.com (or click from an untagged, unknown source like an improperly tagged email) within the session timeout window, Blog.com will still be the attributed source and medium for that session.

The Google Analytics Order of Operations

Based on the documentation here, Google Analytics has a clear, defined order of operations. Let’s step through it.

Google Analytics Flowchart

The first stage of processing is the campaigns stage, and there are three kinds of tags, usually in the URL or measurement protocol hits: GCLIDs, campaign tags, and UTM tags.

First, if there’s a GCLID – a Google Ads ID – available, Google Analytics reads that and stops processing; no further attribution is needed, and Google Ads gets the credit for any conversions that take place from that session in a last-touch model.

If there’s no GCLID, but campaign tags are available – campaign source, campaign medium, and campaign, then the paid channel associated with those campaign tags is given credit.

If there’s no GCLID or campaign tags, but UTM tags are available – UTM source, medium, campaign, keyword, content – and source is specified (which is the only required field), Google will use that for attribution. Note that we recommend as a general best practice to always specify source AND medium, otherwise you end up with a lot of (not set) in your medium-based reporting.

It’s important to note here that if your UTM tracking code is malformed – you type utm_soucre rather than utm_source, for example – Google Analytics will NOT attempt to interpret the rest and will simply assign it to direct / none. That’s bad news, so make sure you use some kind of UTM builder utility so your UTM tracking codes are always correct.

This is the end of the campaigns stage. The second stage is the traffic sources stage, Google’s guessing stage, and this is where a lot of attribution goes off the rails, because Google is guessing, rather than us specifying where something came from.

If there’s a referring source available (a referring URL) and Google identifies it as a known search engine, then the source is set to the identified search engine and the medium is set to organic.

If there’s a referring source available that isn’t a search engine, but Google identifies it as a known social network, then the source is set to the identified social network. Note that many social networks send data in strange URLs that Google doesn’t necessarily know, so a lot of times, social media traffic is identified incorrectly, at least in GA 3.

If there’s a referring source available that isn’t any of the above, Google sets the source as the referring source and the medium as referral.

If there’s no referring source available, but Google knows who the user is and the user has come to the website from an existing campaign (steps 1-3 above) previously, Google assigns the source and medium to the last known session’s source and medium, as long as it’s within the campaign timeout window.

Finally, if Google has nothing else to work with, it assigns the data to the dreaded (direct)/(none) source medium. This is what we want to avoid at all costs, because it means we have no idea where a visitor came from or what they did.

Key Takeaways

The most important thing to take away from all this is you never want any off-site link (ads, guest blog posts, etc.) to lack UTM tracking codes if possible. When you publish an external link back to your website without tracking codes, you force Google Analytics to guess where the traffic came from, and as you can see from the flowchart above, Google Analytics may not guess correctly.

Remember our mnemonic: UTM is short for yoU Tell Me. Google Analytics wants us to tell it where traffic is coming from if we know. Don’t make GA guess: if you’re putting a link to your website on someone else’s website (which includes social media, in-app links, etc. – ANY link that isn’t on your website), put UTM tracking codes on it.

Second, never, ever put UTM tracking codes on internal links (links from your site to another page on your site), because that will overwrite any existing tracking data. Just don’t do it.

With proper tracking, our analytics quality improves. With improved quality, we draw better insights and make better decisions. Get started today by cleaning up your tracking and using UTM codes as much as you can for every link not on your website.


You might also enjoy:


Want to read more like this from Christopher Penn? Get updates here:

subscribe to my newsletter here


AI for Marketers Book
Get your copy of AI For Marketers

Analytics for Marketers Discussion Group
Join my Analytics for Marketers Slack Group!