Search
Clear search
Close search
Google apps
Main menu

The instructions in this help article may be affected by recent changes in the Analytics user interface. See this blog post for details. Help center updates are coming soon.

User ID reference

In this article:

Overview

Users may interact with your website or application from a number of different devices, such as a desktop web browser, a browser on a mobile phone, or via a native mobile application. By default, Analytics assigns each device a unique Client ID, and considers each unique Client ID as a unique user in your reports. User ID enables holistic measurement of user interactions that span across devices, such as attributing an interaction with a marketing campaign on one device to a conversion that occurs on another device, or de-duplicating unique users across multiple devices.

The User ID feature consists of:

  • The userId field, which can be set to a stable, non-personally identifiable ID to represent a unique user.
  • Cross-device reports that provide insight into behavior and conversion paths across devices.

When User IDs are sent with Analytics hits in the userId field, your reports will reflect a more accurate count of unique users and offer new cross-device reporting options.

This article describes how you can configure and send User IDs to Analytics, as well as how User ID data is processed and reported in your User ID-enabled views.

Configuration

Before sending User IDs to Analytics, you must enable at least one reporting view for User ID.

Enabling a view for User ID produces two effects on that view:

  1. New and unique users are calculated using unique User IDs rather than unique Client IDs.
  2. Cross-device reports that leverage the User ID will be enabled in that view.
Warning: Once you enable the User ID feature for a view, you cannot disable it. That view will only show hits for which the userId field was set.

Collection

When a user is known to your website or application, you should send an ID representing that user with all of your Analytics hits, such as pageviews, events, ecommerce transactions, etc., using the userId field.

It is up to you to provide the ID. These IDs typically come from an authentication system, in which each signed-in user account has a stable, and unique ID with which it is associated, and should have the following characteristics:

  • Non-personally identifiable
  • Unique to a user of your service or app
  • Persistent for a signed-in user across all devices

For more information on how to set userId in a particular environment, see the Collection APIs and SDK dev guide for your specific library.

Processing

Analytics hits, like pageviews, events, or transactions, for which the userId field has been set, are processed separately from non-userId hits and will only be visible in User ID-enabled views (profiles).

For example, if a User ID is set in the middle of an existing Analytics session, the session will begin with the first hit in which the User ID is set for User ID-enabled views (profiles).

Non-User ID views (profiles) would report the entire session without regard for the userId field.

Only sessions in which the userId field was set will be reported in User ID-enabled profiles

Reporting

After processing, session data for which userId was set is available for User ID-enabled views (profiles) in Cross-Device reports. Although the session data is available via the Core Reporting API, the userId field is not available as a dimension in reports and can not be exported from Analytics.

New and Unique user metrics will also be based on User ID in these views (profiles). In non-User-ID-enabled views (profiles), these metrics will be calculated using unique clientIds.

Note: Cross-device reports are only available for date ranges shorter than 90 days.

Client ID vs. User ID

The following table summarizes the differences between Client ID and User ID:

Client IDUser ID
What does the ID Represent? An anonymous device or browser instance. A single user, like a signed-in user account, that may interact with content across one or more devices and / or browser instances.
How is the ID Set? Randomly generated and automatically sent with all hits by Analytics libraries. You must set and send your own userIds with your Analytics hits.
How is ID Used to Calculate Unique Users? In a non-User-ID-enabled view (profile), Client ID is used to calculate unique users. In a User-ID-enabled view (profile), User ID is used to calculate unique users

Limits

The following limits are currently in place for the User ID feature:

  • Cross-device reports enabled by the User ID feature have a maximum date range of 90 days.
  • The User ID value can not be queried as a dimension in reports in either the web interface or the APIs.
google-developers-svg
Was this article helpful?
How can we improve it?
Google Analytics training and support resources

Check out our comprehensive list to learn more about Analytics solutions.