Google Analytics : Part : 38

Google Analytics : Part : 38

Google Analytics Client ID vs User ID

If you have ever tried to track additional data about your website’s/application’s users, you probably have stumbled upon the term User ID. In fact, I have two blog posts that teach how to do that – one for Universal Analytics and the other one for Google Analytics 4.

When you read various resources about the User ID, you can notice another term, Client ID. What is it? How client ID is different from the User ID? When should you use what?

In this blog post, I will explain the differences of Google Analytics Client ID vs User ID, and when they are used.

What is Client ID in Google Analytics?

Client ID is the default identifier that Google Analytics uses to distinguish site visitors.

When you install Google Analytics out of the box (without any modifications) and a visitor lands on your page, Google Analytics stores a _ga cookie that contains a thing called Client ID. This is a random number that helps Google Analytics to distinguish the same person across multiple pages of the same website.

An example of a Client ID looks like this:


So, when a visitor lands, he/she gets a cookie with the Client ID. When that same visitor goes from the landing page to some other page of the same site, Google Analytics checks if the cookie with the Client ID exists in the browser. If yes, Google Analytics understands that this is the same device/visitor who was on a previous page, therefore, two page views are stitched and attributed to the same visitor.

This applies to older and newer Google Analytics versions.

If the same person clears cookies in the browser (or visits your site with another browser/device), the cookie with client ID will NOT be persisted, therefore a new cookie with a new randomly generated Client ID will be stored in a browser.

This kind of behavior (limited by technical aspects of how browsers are designed to work) introduces a problem. If a person uses multiple browsers/devices to navigate your website/app, you won’t be able to understand that this is the same person. Client ID on every browser/device is different.

That’s where User ID becomes useful.

Also, on Safari browser (and all iOS browsers), cookie with a Client ID is limited to 7 days (or 24 hours in some cases). If a visitor does not revisit your site within a week, the cookie will be deleted. If a visitor revisits your site after 8 days, a new client ID will be created, thus your reports will start showing a new user (even though this is the same person).

 

What is User ID in Google Analytics?

User ID is an additional way to tell Google Analytics that two devices/browsers belong to the same user. But this is usable only under one condition – you must have some internal way on your website/application to identify the user. In other words, your website/app must have a signup/login feature.

A person signs up to your website/product and then they create an account. This account must have some ID in your data base. You could use that ID and send it to Google Analytics.

If your website/app has no login and people can use it without signing up, user ID is not an option for you.

You must have some persistent identifier in your data base that developers can make available for your (e.g. in the data layer) so that you could send it to Google Analytics.

I have explained how to send User ID to GA in these two guides: for Universal Analytics and for Google Analytics 4.

User ID is not automatically tracked by Google Analytics. In many cases, you need to cooperate with a developer and ask him/her to make this data available to you (and then you can use that data with Google Tag Manager). Read the two aforementioned guides for more details).

Also, it is important to mention that User ID cannot be an email address, social security number or anything else that can easily identify the person in your reports. This goes against Google Analytics’ terms of service. If IDs in your data base are just some random letters and numbers (e.g. 18bf92n3823bf283), then that’s fine.

 

Google Analytics Client ID vs User ID: Final Words

Client ID is a random identifier that GA automatically generated for a user/device. User ID is an identifier used by your own data base and it can persist across multiple devices. You just need to send the user ID to Google Analytics.

If you want to go more in-depth, then Client ID:

  • Is a randomly generated identifier that is stored in a cookie.
  • It is generated by Google Analytics tracking code. If a visitor clears cookies or uses a different device, a new cookie with new random Client ID is created.
  • If a visitor uses multiple devices/browsers, you won’t be able to distinguish if it is the same person or not.
  • On Safari browser (and all iOS browsers), cookie with a Client ID is limited to 7 days (or 24 hours in some cases).

User ID:

  • Is an ID of a user who has created an account on your website (meaning that you must have this kind of feature on your site).
  • If you just run a blog where people don’t need to have an account, User ID feature is not for you.
  • User ID is some ID that is used in your website’s/app’s data base. Every user must have a separate ID. The developers of your website/app are responsible for creating user accounts and giving unique IDs to them.
  • Google Analytics does not track it automatically and you must do additional configuration. Read more here and here


要查看或添加评论,请登录

Soyeb Islam T.的更多文章

  • Google Tag Manager : part : 20

    Google Tag Manager : part : 20

    How to Move Google Tag Manager Container to Another Account There might be some situations where you want to move the…

  • Google tag manager: part: 19

    Google tag manager: part: 19

    Google Tag Manager Container Code. In or ? Google Tag Manager official recommendation states that in order to install…

  • Google Tag Manager : part 18

    Google Tag Manager : part 18

    Benefits of Server Side Tagging (with Google Tag Manager) You have probably heard multiple people talking about how…

  • Google Analytics: part: 37

    Google Analytics: part: 37

    Sudden drop in bounce rate of Google Analytics? Here is how to fix it One day you open your Universal Analytics (GA3)…

  • Google Tag Manager : part : 16

    Google Tag Manager : part : 16

    GTAG vs Google Tag Manager. What is the Difference? What to Choose? GTAG and Google Tag Manager are completely…

  • Google Tag Manager & Analytics : part 15

    Google Tag Manager & Analytics : part 15

    GTAG vs Analytics.js When you want to install Google Analytics on your website, one of the options is to add its code…

    1 条评论
  • Google Tag manager : part : 14

    Google Tag manager : part : 14

    Google Tag Manager Firing Twice? Here’s a solution Here’s a situation. You are using a Google Tag Assistant (legacy)…

  • Google Analytics : part : 36

    Google Analytics : part : 36

    Introducing Google Analytics 4 Community 4 years ago, I launched a Google Tag Manager community on Facebook and now it…

  • Google Analytics : part : 36

    Google Analytics : part : 36

    16 Ways to Reduce Direct Traffic in Google Analytics Direct traffic in Google Analytics is often misunderstood. If you…

  • Google Analytics: part : 35

    Google Analytics: part : 35

    Cross-domain tracking in Google Analytics 4 Note: If you are looking for a Cross-domain tracking guide for Universal…

社区洞察

其他会员也浏览了