Glossary Term

GA4 User-ID

glossary ga4 user id featured

The GA4 User-ID is an identifier you assign to a signed-in user and send to Google Analytics with each event. It lets GA4 join that person’s sessions across browsers, devices, and platforms into one user. Unlike the client ID, GA4 does not create it for you. It comes from your own login system, and it only exists for users who authenticate.

Why User-ID Matters

User-ID is the only deterministic way to recognise the same person on a second device. Everything else GA4 has is a guess or a device-scoped cookie.

Three things change once it is running:

  • User counts get closer to reality. Without User-ID, one person on a work laptop, a phone, and a private window counts as three users. User-ID collapses those into one.
  • Conversions stop landing on the wrong device. An ad click on a phone that ends in a desktop purchase stays one path instead of splitting into a bounced session and a direct conversion.
  • Retention reports become meaningful. Cohort, lifetime value, and returning-user metrics measure people rather than cookies.

This is the deterministic half of cross-device tracking. Because the match relies on a login rather than statistical signals, it holds up under privacy law in a way probabilistic matching does not.

The tradeoff is coverage. User-ID only applies to authenticated sessions. Ecommerce stores, SaaS apps, and membership sites get the most from it.

User-ID Requirements

Google enforces rules on the value itself. Break them and the setup either fails or violates policy.

  • No personally identifiable information. Email addresses, names, and phone numbers are prohibited. Google’s policy allows account termination for sending PII to Analytics.
  • Persistent across sessions. An ID that changes on each login is worse than no ID, because it inflates user counts.
  • Unique per person, not per login. Two people sharing a family account will merge. That is expected behaviour, not a bug.
  • A string, up to 256 ASCII characters. Send it as a string even when the underlying value is numeric.
  • Consistent everywhere. Web, app, and Measurement Protocol events for the same person must carry the same value or the stitching breaks.

The safe choice is your internal database primary key or a hashed identifier. A SHA-256 hash of the email address works, provided you hash the same normalised input every time.

How to Set Up User-ID in GA4

  1. Generate the value in your application. Pull the user’s ID from your session or database at login. Do not compute it in the browser from anything a user typed.
  2. Send it with the GA4 tag. With gtag.js, pass user_id in the config call so it applies to every subsequent event:
gtag('config', 'G-ABC1234XYZ', {
  'user_id': 'a1b2c3d4e5'
});
  1. Or push it through Google Tag Manager. Write the value to the data layer on login, create a data layer variable, then map it to the User ID field in your Google tag.
dataLayer.push({
  'event': 'login',
  'user_id': 'a1b2c3d4e5'
});
  1. Clear it on logout. Set user_id to null when the session ends, otherwise a shared device attributes the next visitor’s activity to the previous user.
  2. Confirm it in DebugView. Open Admin, then DebugView, and check that the user_id property appears on events after login, not just on the login event itself.

GA4 needs no separate reporting view for this, unlike Universal Analytics. Once the value arrives, GA4 uses it automatically.

User-ID Reporting Identity

Reporting identity controls which identifiers GA4 uses to count users in reports. It sits in Admin, under Data display, then Reporting identity. Three options exist:

Setting Identifiers used
Blended User-ID, device ID, then modeled data for unconsented sessions
Observed User-ID, then device ID
Device-based Device ID only

Blended is the default on new properties. Observed drops the modeling layer and reports only what was actually collected. Device-based ignores User-ID entirely, even if you are sending it.

Two details matter. Google removed Google signals from reporting identity in February 2024 to reduce data thresholding, so Observed now means User-ID plus device ID rather than the older three-way stack. And switching between settings is not destructive: GA4 reprocesses reports on the fly, so you can move between them and back without losing data.

User-ID vs Client ID

The client ID identifies a browser. The User-ID identifies a person. GA4 collects the client ID on every hit automatically and falls back to it whenever no User-ID is present.

They are not alternatives. Both travel on the same events, and one person accumulates many client IDs over time but keeps a single User-ID. In the BigQuery export they are separate fields: user_pseudo_id holds the client ID, user_id holds the value you sent.

The practical difference is durability. Cleared cookies, a new browser, or Safari’s cookie limits create a fresh client ID and erase the history attached to the old one. A User-ID survives all of that, because it is re-attached the moment the user signs in again.

Common User-ID Mistakes

  • Sending an email address. The most common policy violation. Hash it or use a database ID.
  • Expecting historical stitching. User-ID applies to data collected after setup. GA4 does not reprocess past sessions.
  • Assuming it fixes pre-login attribution. Sessions before sign-in still rely on the client ID, so campaign source has to survive on its own.
  • Leaving reporting identity on Device-based. The data collects correctly and the reports ignore it.

Frequently Asked Questions

What is User ID in GA4?

User-ID is an identifier you assign to a logged-in user and send to Google Analytics with their events. GA4 uses it to recognise the same person across devices, replacing the device-scoped client ID as the basis for user counts. It has to come from your own systems, and it cannot contain personal information such as an email address.

What is the difference between User-ID and client ID in GA4?

The client ID identifies one browser and GA4 generates it automatically in the _ga cookie. The User-ID identifies one person and only exists if you send it. Both are attached to the same events, and GA4 falls back to the client ID whenever a User-ID is missing.

How do I set up User-ID in GA4?

Send the value in the user_id field of your GA4 configuration, either through gtag.js or by mapping a data layer variable in Google Tag Manager. Set it as soon as the user authenticates, keep it for the rest of the session, and clear it at logout. Then confirm it appears on events in DebugView.

Does User-ID enable cross-device tracking?

Yes, and it is the most accurate method GA4 offers. Because the match relies on a login rather than inferred signals, sessions on a phone and a desktop merge with certainty. Coverage is limited to authenticated sessions, so activity before sign-in still counts as separate devices.

Which reporting identity should I use with User-ID?

Use Blended or Observed. Both give priority to the User-ID, while Device-based ignores it and reports on device IDs alone. Choose Observed for reports based only on collected data, and Blended if you want modeled estimates filling the gaps left by missing consent.

Campaign source still has to reach GA4 correctly for User-ID reports to be worth reading, so check your tagged links with the GA4 URL tester at linkutm before a campaign goes live.