Skip to content
All field notes
Measurement
Published
Oct 31, 2026
Updated
Nov 4, 2026
Reading time
11 min read

GA4 User-ID: Audit Login, Logout and Reporting Identity

Choose and validate GA4 User-ID with a login and logout test plan. Separate account IDs, device identity, report association and historical limits.

AP
AdProof Research
Independent measurement desk
A signed-in account token connects two device event cards, then is removed at a logout gate before another account uses the shared browser.
Account identity, device identity and the login/logout boundary require separate evidence. Conceptual illustration without user or property statistics.
In this guide (10 sections)

Choose a stable, permitted identifier for an authenticated account, then test its entire login and logout lifecycle. Whether it comes from an existing internal UUID or a separate analytics mapping is a design decision. Neither a hash nor a new database column fixes shared placeholders, stale logout state or an incorrectly configured reporting surface.

Keep three questions separate: which account the application knows, which identifier the event actually carries, and how Analytics groups that activity in a report. A report can associate activity without rewriting every earlier raw event field. A passing login test also does not prove that account switching works on a shared browser.

A real production question deserves more than “use the UUID”#

A public GA4 User-ID question asks whether to send an existing random internal UUID, transform it with a hash or HMAC, or create a separate analytics-only ID. Replies favor different approaches. One raises logout clearing but makes a broad claim about activity before the ID was set.

The thread establishes a genuine implementation decision, not evidence that one approach fits every organization. The useful answer is an identity contract, a controlled lifecycle test and a clear explanation of the reporting boundaries.

Related guide

Test the full User-ID lifecycle

Record the identifier and behavior across login, logout and account switching.

Use the tracking QA checklist

Opens a practical guide. No email required.

1. Define what one ID represents#

Start with the authenticated account model. Record what happens when an account is renamed, closed, merged or recreated. Decide who owns the mapping and how the analytics implementation receives the approved value. Do not use “customer,” “person” and “account” interchangeably when shared logins or multiple accounts are possible.

Google's User-ID feature reference requires unique, consistently assigned identifiers and says each must be no longer than 256 characters. It prohibits impermissible identifying information and values that let a third party determine identity. An opaque-looking string alone does not establish that those requirements and the organization's collection policy are satisfied.

Candidate designDecision to documentFailure to test
Existing internal random identifierWhether exposing that identifier is appropriate and its lifecycle is stableA reused or changed account key breaks the agreed mapping
Approved transformation of an internal identifierWho maintains the transformation and continuityA changed method produces a new Analytics identity for the same account
Separate analytics identifierWho maintains the account-to-analytics mappingTwo accounts share a value, or one account receives a new value unexpectedly

These are engineering review questions, not a claim that Google mandates a separate analytics column or a particular transformation. Hashing is not a permission decision. Do not take an email address, transform it and assume the result is automatically an acceptable User-ID.

Write the intended coverage too. An account identifier can support permitted signed-in measurement across devices. It cannot establish the identity of every anonymous visitor, resolve account sharing or prove who was physically using a device.

2. Configure the reserved field through its supported path#

The current Google implementation guide treats user_id as a reserved configuration field. It is not an arbitrary custom user property or event parameter, and it should not be registered as a custom dimension. Sending a similarly named field through the wrong collection path does not establish that the built-in identity feature received it.

Inspect the actual implementation and destination. A data-layer key, application account object and Google tag configuration are separate checkpoints. Record which value becomes the configured identity, when that happens and which stream receives the activity. Keep identifiers in restricted test evidence rather than copying customer values into support posts or public screenshots.

For an ID known when the page initializes, Google's guide shows it in the existing configuration. For an account that signs in after initialization, the current guidance recommends updating the setting for subsequent activity rather than treating another configuration call as a harmless generic workaround. Preserve the site's existing pageview contract when making that change.

The configuration reference provides the field's supported examples. Have the implementation owner check applicable scope and overrides. A visible value in one debug panel does not prove that every route or another destination uses the same setting.

3. Treat login, logout and account switching as separate tests#

Use two synthetic accounts with deliberately different test identities. Test a fresh anonymous browser, an already authenticated page load and a login that occurs later on the page. Then test logout before allowing the second account to sign in.

Test stateExpected identity handling to verify
Never signed inThe account User-ID is not sent
Authenticated account AThe approved A value is consistently used
A signs outThe previous value is cleared with JavaScript null
Anonymous action after logoutNo stale A identity remains
Account B signs in on that browserB receives its own approved value
A signs in on another supported deviceThe account mapping is consistent, without equating device identifiers

The feature reference distinguishes JavaScript values from strings: null is not the text "null", and undefined is not the text "undefined". Shared dummy values can merge unrelated activity. Retain this distinction in the test evidence rather than accepting “the field looks empty” as a result.

For changes after initialization, Google's current implementation guide describes a setting update on login and clearing it on logout. Confirm the timing relative to the next intended event. Include a delayed login response and back navigation in the test matrix so the account state cannot silently lag behind the displayed interface.

If the application uses client-side routes, reuse the SPA event-lifecycle investigation. Correcting the identity transition should not introduce duplicate pageviews or remove required route context.

4. Separate pre-login association from historical reprocessing#

Avoid two absolute claims: “earlier activity can never be associated” and “adding User-ID recovers all history.” Google's feature documentation explicitly describes incomplete collection within a session: initial events before sign-in can become associated with the account after sign-in; events after sign-out stop being associated with that account.

Its limits separately say data collected and recorded before implementation is not reprocessed and associated with a User-ID. Those statements describe different boundaries. The same-session example is not a promise to identify every anonymous event across previous months or unrelated devices.

Consider the exact evidence being examined. An earlier outgoing request may not contain the account field. A processed report may associate activity under the documented session behavior. Neither observation authorizes editing historical source records or assigning account IDs to unrelated events based on timestamp proximity.

Save the implementation date, account-state timeline and report method before comparing results. If a stakeholder asks whether historical activity was recovered, specify the period and association being demonstrated. A changed aggregate user count alone is insufficient proof.

5. Verify reporting identity without changing collection to fit a total#

Google's reporting-identity reference distinguishes Blended, Observed and Device based. The first two can use User-ID; Device based uses the device identity. Blended can also include eligible modeled behavior. The selected option does not itself prove that modeling is available or that the account mapping is correct.

Record the original setting and use an authorized, controlled comparison for a specific question. The documentation says changing the option does not permanently change collection or processing. A count changing with the option establishes sensitivity to that reporting method, not that the largest or smallest result is the correct number of people.

For model availability, use the separate behavioral-modeling eligibility guide. User-ID collection and model eligibility are different tasks. Do not create synthetic traffic or substitute account identifiers for a denied collection choice merely to make a reporting option appear useful.

Keep report dates, filters, metric names, extraction times and any quality message together. Comparing a device-based daily sum with an account-deduplicated full-period total mixes both identity and aggregation rules. For a comparison with Play Console or RevenueCat, audit each product’s activity signal and identity unit before interpreting different daily totals as a failed User-ID implementation.

Worked example: account observations and device observations differ#

This example is hypothetical. Suppose an approved controlled test has three test accounts. Account A signs in on two browser instances, while B and C each sign in on one. The signed-in portion therefore contains four browser instances but three distinct account mappings.

Separately, assume two more browser instances perform anonymous actions only, with no evidence connecting them to those accounts. The exercise contains six browser instances: four with the tested signed-in activity and two without an established account mapping.

Three mapped accounts plus two anonymous browser instances is not proof of five people. Either anonymous instance could belong to an existing account holder, and an account might be shared. The evidence supports the declared units, not a complete census of individuals or a guaranteed GA4 interface total.

For a separate QA measure, suppose eight of ten synthetic events that should carry a signed-in identity have the correct assignment. 8 ÷ 10 = 80% is the assignment success rate for those ten test occurrences. Inspect the two failures; do not relabel anonymous production traffic as defective or project the test's rate to the whole property.

After a correction, use a new cohort and repeat logout and second-account cases. Keep the original result. A later passing test does not erase a previously observed stale-ID event or quantify historical user-count impact.

6. Choose a supported way to inspect identity#

Google's User-ID best-practices guide maps different tasks to different features: signed-in comparisons, User Explorer, debugging and authorized BigQuery analysis. It warns against recreating User-ID as a high-cardinality custom dimension.

Do not expect a raw account-ID column to appear in every standard report or Free Form Exploration. The implementation guide documents specific supported access through User Explorer and exported data. Keep individual-level evidence restricted and use aggregate reporting when it answers the business question.

The BigQuery export schema contains both user_id and user_pseudo_id. Those fields describe different identities. Do not replace missing account values with a device identifier and then label the result “unique accounts.” Likewise, a warehouse analysis of retained fields is not automatically the same grouping used by every Analytics report.

Use DebugView for the permitted test device alongside the configuration and request timeline. Privacy controls and denied Analytics consent can limit that surface. An absent debug event is not evidence that collection policy should be bypassed.

7. Hand over a reviewable identity contract#

Retain the identifier's defined meaning, mapping owner, supported login states, implementation release, affected streams and test matrix. Include known account-sharing limits, unsupported journeys, the report identity and any authorized export used for verification. Keep data already collected before implementation in a separate historical discussion.

For a server event that should join an existing browser session, use the Measurement Protocol session-association guide. A valid account ID does not replace every client, session and timing requirement of that different workflow.

For AdProof-measured campaigns, export the supported campaign period, timezone and available dimensions as a separate delivery baseline. The anonymized fashion-retail delivery-quality case concerns ad impressions; it does not validate a website's account mapping or establish sales attribution. AdProof's campaign-export workflow does not configure GA4 User-ID or recover missing account history. Discuss a scoped delivery review with the measurement unit and reporting contract explicit.

Frequently asked questions#

Should I use the internal UUID, a hash or a separate analytics ID?

There is no universal choice established by the forum replies. Review the permitted use, stable account mapping and lifecycle with the implementation owner. A transformation or separate identifier does not excuse collisions, stale logout state or impermissible identifying information.

What should happen to User-ID after logout?

Clear the former value using the documented JavaScript null behavior, then verify subsequent anonymous activity and another account signing in. Do not use a shared placeholder or the literal string "null" as the logged-out identity.

Can GA4 associate events that happened before login?

Google documents association of initial events in its same-session sign-in example. That differs from reprocessing data collected before User-ID implementation, which its limits exclude. Preserve the event timeline and reporting surface rather than treating either case as an unlimited historical recovery promise.

Does a lower User-ID-based user count prove the implementation works?

No. It may reflect the chosen grouping, but reused account IDs or incomplete collection can also alter results. Validate assignment, logout and account switching independently, and compare the same metric, period and reporting conditions.

Your next step

Test the full User-ID lifecycle

Record the identifier and behavior across login, logout and account switching.

Use the tracking QA checklist

Opens a practical guide. No email required.

Back to all field notes