The Marketing Technologist.

We talk about analytics, code, data science and everything related to marketing technology. Backed by the tech geeks of Greenhouse Group.

About the Google Analytics client ID

One of the core concepts of Google Analytics is the client ID. You can leverage its workings to get interesting insights, e.g. connecting offline revenue connected to online campaign sources. But it’s important to understand what it is. That’s what this post is for, to give you a better understanding of what it is by discussing three topics: what it is, what it’s used for, and what it can be used for.

1 It’s a cookie

First thing first, it’s a cookie. Every time a new user visits your website, the Google Analytics tracking code will generate a cookie, the _ga cookie. This cookie lasts for a maximum of 2 years and holds the client ID.

google analytics client id example

A _ga cookie sample.

If the user returns to the website, the tracking code will update cookie so it’ll last 2 years from your last activity onwards.

It also has some limitations because of the cookie based setup. Cookies are limited to a browser and a top level domain. If you visit the website from a new browser, you’ll get a new cookie. If you have a website called www.my-awesome-website.com any website on the .my-awesome-website.com top level domain can access the cookie information. And don’t forget that users can also delete cookies themselves.

With this in mind, it’s time to discuss to what Google Analytics uses it for.

2 What it’s used for

Google Analytics uses the client ID for two types of data: user insights and attribution modelling

2.1 User insights

The literal meaning of users in Google Analytics is unique Google Analytics client IDs on your website. A user that visits your website on mobile and tablet will account for 2 users in your report. Another important dimension reported by Google is the Visitor type: new or returning. As you might guess, these values translate to have seen this client ID before (returning) and haven’t seen this client id before (new).

2.2 Attribution modelling

Google Analytics applies the last non-direct click model by default. This means that every direct session, meaning sessions without a source (so no organic search, referral or utm tagging) will be applied to the last known source of the past 6 months of that user. Again, if we translate this to how this utilises the client ID:

System registers session without a source. Has this client ID been on the website before? If so, what was it’s last known source in the past six months? If there is one, apply it to this direct session.

Keep in mind that the real-time report will always show the user as direct if he doesn’t have any source information. Google Analytics will apply the source based on the model when the user is added to the standard reports.

3 What it can be used for

There’s a neat trick that leverages the concepts discussed in chapter 2: you can attribute off-site data to your Google Analytics users. A good example is recruitment data. Users can often apply through the website, but the really important stuff happens off-site: will the person be invited over for an interview? Without offsite data, you’ll have these metrics:

  • Sessions on website;
  • Vacancy page visited;
  • Application form visited; and
  • Application form submitted.

The important step is missing:

  • Invited for an interview.

If you can send client ID with the submitted form date (e.g. via a hidden input field), you can use this client ID to send data (e.g. an event) to GA when they get invited for their interview. If you don’t add any source information, the event will be attributed to the user’s last known source: the source of his online application. This allows you to not only see how sources attribute to online form submissions but also to actual qualitative job applications, people who are invited over.

I’ll discuss a lean setup to the sample above in a separate post.

The gist

We can summarise the workings of the client ID in four key points:

  • the Google Analytics client ID is a cookie that expires after two years of inactivity.
  • the number of users on your website is equal to the number of unique client IDs.
  • it determines if a user is new or returning.
  • It’s a key value in Google Analytics’ last non-direct click model.

With this list in mind, you'll have a good understanding of the concept of the client ID.