Google Analytics User ID: a chaotic mess, a marketer’s nightmare, or the reason the programmer stopped answering the phone. That is how the concept of User ID is often perceived—if you’ve even heard of it before.
We first heard about the Google Analytics User ID back in 2013, but no one in our region actually implemented it at the time because the necessary infrastructure wasn't ready. Now, however, as the market has matured to embrace CRM systems, management analytics, customer segmentation, personalized offers, and deep data analysis, the User ID feature is becoming highly relevant for many projects. So, let’s take a look at how User ID works in Google Analytics 4 and what you need to do to get ready to use it.
User ID is a unique ID assigned to a site visitor to consolidate analytics regarding all their actions across different devices and over time.
What is the primary purpose of User ID?
👉 Stitch together user visits across different devices, accounting for behavioral dynamics, to gain a clear picture of the true sources of customer acquisition.
What can be achieved by setting up User ID?
👉 The initial source/channel or advertising campaign that led a specific user to specific conversions.
👉 A clearer picture of user analytics — specifically, by synchronizing visit data for the same users across different devices.
👉 A foundation for building end-to-end analytics.
What do you need to get started with User ID?
👉 Personal identification of users on the website across various devices.
User ID присваивается конкретному пользователю в момент идентификации и должен присутствовать при повторных сессиях этого пользователя.
👉 Management accounting of users, namely:
- Analytics by User ID in the site's admin panel;
- Synchronized user and order analytics at the CRM system level.
Implementation of User ID in 2 steps
User ID implementation is carried out using two data protocols: GTAG and DataLayer. We will focus on DataLayer, as virtually all websites operate using Tag Manager for tag management. So, let’s go through this step by step.
➊ Assigning a User ID at login
When a user logs in to the site or undergoes identification—for example, via a key or promo code - your site must assign a User ID to that user. This process takes place on two parallel tracks:
1.1 Create a “user_login” event tag in Tag Manager, specifying the “user_id” variable in the event parameters.

1.2 You add an event in the code with a specific user ID.
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'user_login',
'user_id': '987654321abc'
});
</script>
➋ Adding User ID to repeat visits
After the User ID has been assigned, the system must be informed that the user possesses a User ID. This is also carried out in two parallel ways:
2.1 Add the “user_id” configuration parameter to the GA4 tag.

2.2 Add the User ID information for the specific user to the code above the Tag Manager tag.
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'user_id': '987654321abc'
});
</script>
➌ Correction identification methods in GA4
Under the identification methods, select the "Blended" method; according to the regulations, this specific method takes the maximum number of matches into account and prioritizes the user identifier.

Sending offline events to GA4 from a CRM system using User ID
This operation is performed via the Measurement Protocol. When a User ID is present in Google Analytics 4, it acts as a more global identifier than the Client ID; the system merges sessions, and in your Explorations, you will see the User ID instead of the Client ID (read our article to learn the difference).
By implementing User ID functionality and tracking offline conversions - sending them via the Measurement Protocol - you effectively build a basic end-to-end analytics setup.
Every project involves numerous details and nuances that require alignment and discussion. For more information, please contact the agency.