The User-ID feature lets you associate your own identifiers with individual users so you can connect their behavior across different sessions and on various devices and platforms. Analytics interprets each user ID as a separate user, which provides you with more accurate user counts and a more holistic story about a user's relationship with your business.
Before you begin
To send user IDs to Analytics, you need to create a unique ID for each user on your own and assign and consistently reassign the IDs to your users. This is typically done during login. For example, when a user signs in, you could use their email address to generate a unique ID that you can reference throughout your website or application. Each user ID must be fewer than 256 characters long.
Ensure unique User IDs for each user in GA4. Assigning the same ID to multiple users will skew your data, making it difficult to differentiate between their actual activities.
Example
You have 2 users: John and Mary. Accidentally, you assign the same User ID (UserID123) to both of them.
User activity:
- John logs in and browses your website on his laptop. He views product A and adds it to his cart.
- Later, Mary logs in on her phone using the same User ID (UserID123). She views product B and makes a purchase.
In GA4, you'll see one user with UserID123 who viewed product A and B, but only made one purchase. You might misinterpret the combined browsing data as a single user with diverse interests, while it's actually 2 users.
Send user IDs
For instructions on how to send a user ID, check Send user IDs.
Verify the reporting identity
Make sure your property uses a reporting identity that includes the User-ID option by doing the following:
- In Admin, under Data display, click Reporting Identity.
Note: The previous link opens to the last Analytics property you accessed. You can change the property using the property selector. You must be an Editor or above at the property level to change the reporting identity that includes the User-ID option.
- Select either:
- Blended: evaluates user ID, device ID, modeled data
- Observed: evaluates user ID, device ID
- Click Save.
What you can do with User-ID
Compare signed in with non-signed in users
To compare the behavior of users who are signed in with the behavior of users who aren't signed in, build a comparison that uses the Signed in with user ID dimension and select one of the below match types.
- Exactly matches
- Contains
- Does not exactly match
- Does not contain
User exploration
The user exploration displays the users who make up an existing segment, or who make up the temporary segment that results from using other Explorations techniques. You can drill down into the list to see detailed information about individual users, including how and when that user was acquired, summary metrics for that user, and a timeline of their activities on your site or app.
Create remarketing audiences based on User-ID data
You can create remarketing audiences based on user IDs. If you've linked your Google Analytics and Ads accounts, these audiences are available in your shared library in Google Ads.
- If you are using User-ID, then Analytics only includes the user identifier and the device identifier for the last device associated with each logged-in user.
- If you're not using User-ID, Analytics includes all device and user identifiers in the audience information it exports to Ads.
How Analytics handles sessions with incomplete User-ID collection
Users sometimes trigger events on your site or app before signing in or after signing out. In the first instance, Analytics uses the session ID to associate that session with the user ID provided when the user signs in. In the second instance, once a user signs out, Analytics stops associating any subsequent events with that user ID.
For example, a user starts a session with no associated user ID and triggers Events 1 and 2. No user ID is associated with those events. The user then signs in and triggers Event 3. Events 1, 2, and 3 are now all associated with that user's ID. The user finally signs out and then triggers Event 4. No user ID is associated with Event 4. Events 1, 2, and 3 remain associated with that user.
- undefined: No user ID will be sent on the hit as the hit will not be logged as the user_id. This will also happen if you never set a user ID at all.
- null: An empty or unset user ID value will be sent on the hit. You will be considered as a "logged out" user who doesn’t have a stable user_id.
- Empty string (""): This is equivalent to null.
All other values are interpreted as unique user IDs, and will be sent as such. This even includes the strings "undefined" and "null", which are different than the JavaScript values explained above.
Limits
- The User-ID feature is built for use with Google Analytics technologies. All implementations must comply with the Analytics SDK / User-ID Feature Policy.
- The user IDs you send to Google Analytics must be fewer than 256 characters long.
- Any data in your Analytics account collected and recorded prior to implementation won't be reprocessed and associated with a user ID.
- User-ID data collected in one property can't be shared or mixed with data in other properties.