16 June 2023

User ID in GA4

Chains

In summary

  • User ID is a unique identifier for each signed-on user on your website or application
  • User ID is the most accurate and durable form of user identity in Google Analytics 4 (GA4)
  • Benefits of using User ID in GA4 include cross device attribution, audience segmentation and targeting, session unification, shared identity with other data sets and offline insights via data import

What is a User ID?

User ID is a unique identifier you assign to each signed-on user on your website. As long as the user remains signed-in, this ID persists regardless of how many sessions the user has had or which browser or device they are on.

GA4 reporting identities

Google has de-emphasised its reliance on device level identities and single identity scopes such as Client ID to having the option of multiple reporting identity types which you can reconfigure on the fly without permanently changing your underlying dataset. You can think of these different reporting identities as a way of applying a different lens or view over your dataset.

These GA4 identities are sorted by their order of preference (with User ID being the strongest and most desirable user identity type and Modelling being the least preferred). Learn read more about Google Signals and its limitations.

GA4 reporting identities

The GA4 Reporting Identity settings can be found in the GA4 admin settings of your property.

How does User ID in GA4 work?

User ID is not something GA4 provides you with, instead it’s a first-party identifier you need to feed into GA4 yourself.

User ID must be a unique identifier for each signed-in user on your website or app. What this enables is that as long as a user remains signed-in, this form of ID can theoretically persist indefinitely. That is regardless of how much time has elapsed, which browser, app or device a user engages with your business through, or how many sessions, days, weeks, months or even years the same user decides to engaged with your business over.

What are the benefits of using User ID?

User ID offers a much more durable form of user identity with a multitude of added benefits over the traditional Client ID approach to user identity.

For example: After Apple launched ITP in September of 2017, identifiers like Client ID have become less reliable as they are reset more frequently by browser vendors including the likes of Apple, Firefox, Brave etc. This change can result in the same user appearing as multiple Client IDs over different sessions, in the case of Safari visitors, a Client ID can be reset in as little as 7 days.

However it’s not just browser vendors that can cause issues for Client IDs, it’s also user behaviour. If someone engages with your brand over multiple distinct devices such as desktop, phone, tablet, smart TV and so on, in a Client ID focused identity scope, that same user will have a distinct identity from a GA4 perspective on each respective device. This makes cross-device user engagement, cross-device campaign attribution and lifetime value insights much harder or even impossible to stitch together.

Let’s look at a hypothetical scenario: if user John Doe 1 uses their phone to search for a product today, but the next day uses a laptop to purchase the same product and returns 3 months later for another purchase via a tablet, an implementation using User ID can identify this as a single returning user.

However with a Client ID-only approach, GA4 will record three seperate users completing three different courses of action, even if John Doe 1 uses the same login details for all interactions and all data points were recorded similarly.

User vs Client ID process

Cross-device attribution

In today’s world, it’s common for customers to interact with your business website via multiple devices. Unlike Client ID which can only associate the same user to the same browser-device pair, User ID recognises a logged-in user regardless of the platform they engage with. This means you will have a more unified and holistic view of the user’s journey on your website and their full buying cycle over a sustained period of time, helping you to build a more accurate picture of user lifetime value and more effective audience segmentations.

Audience segmentation and targeting

User ID enables for more accurate user count, thus more accurate analysis and segmentation of users. Moreover, custom and machine-learning-powered predictive audiences would also be more accurately built. As audiences can be exported to Google Marketing Platforms for retargeting, you can build more personalised ads for different user groups, which could result in better customer retention and higher conversion rates.

Session unification

Not all websites or business models require users to immediately sign into an account before engaging with that business. You may be wondering how User ID would help in that context.

Well, there is a feature known as session unification that helps with stitching together pre-sign in user activities.

Session unification allows hits collected before the User ID is assigned to be associated with the same ID. This is particularly useful if users sign-in half-way through their user session. In GA4 this feature is automatically turned ON and it attributes all activities before log in to the same user.

In the diagram below, a user signs in part way through the second session of their journey and signs out half way through their fourth session. In this scenario, all of session 2, 3 and the first half of session 4 are connected. The user has signed in for session 6 so this will also be joined.

Session unification

Session unification helps to tie your marketing efforts to users, then see their long-term commitment with your brand and their lifetime value.

Shared identity with other data sets

Unlike Client ID or a Google Signals based ID, you must generate your own unique User IDs and assign them to users.

What you should use as your user identity depends on what’s already available to you. In many instances, an ID from a client relationship management (CRM) tool would be the ideal User ID candidate. Your content management system (CMS) or login ID (eg: Okta ID) may be the next best identity in terms of ease of access. You should also consider the primary key used to identify customers in other customer databases and datasets. The more consistent your ID is across disparate systems, the easier it will be to merge more datapoints for deeper insight and sophisticated retargeting use cases.

The benefits of using the same User ID across different systems is unparalleled: you can match GA4 data with back-end data to get insights into the customer’s full user journey, from when they first saw your ads, scrolling through your website until they make a purchase and become a loyal customer. In a broader sense, User ID helps you to stitch between disparate technology and provide a more holistic view of your customer base. In return, this enables more sophisticated audience segmentation and targeted messaging in paid campaigns.

Offline insights via data import

Many ecommerce websites have customer interactions that begin online during the research stage, but move to an offline context when committing to making an actual purchase, especially larger purchases.

Historically it has been challenging to effectively measure offline conversion data in Google Analytics. However, by enabling User ID, you can get a clearer picture of the full customer journey leading up to a purchase. This is one method of stitching both online and offline customer interactions together, interactions with the call centre or via email, activities and purchases in-store, and understand how your digital media activities help with motivating conversions online or offline.

Joining GA4 with CRM data

Limitations

Whilst User ID is the most durable and also ideal form of identifier to leverage in GA4, it also does have some limitations worth being mindful of:

  • A user must identify themselves to your business by logging in so that you can leverage User ID. Prior sessions where a user engaged with your business without signing in isn’t automatically stitched up with signed in sessions. However, with some creative work in BigQuery, you could potentially join prior Client ID only based sessions to later sessions where User ID was made available.
  • It is important to correctly configure User ID in GA4 to avoid issues, including high cardinality problems. Refer to this GA4 Cardinality support document for more details
  • In some contexts and choice of User ID value, you may wish to pre-hash your User ID before sending it into GA4. However if you do pre-hash your User ID value, be sure to use the same hashing algorithm in other environments so that you consistently set the same value for a given user in different contexts.

To learn more about User ID, you can view these additional articles in the series:



About Sophia Vu

Sophia is a data and business analyst, specialising in digital analytics and tagging. In her spare time, she enjoys working on her music skills and enjoying nature.