This guide provides an overview of User ID in Google Analytics, including how it is configured, processed, and reported.
More
|
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, Google Analytics assigns each device a unique Client ID, and considers each unique Client ID as a unique user in your reports.
Measurement activities that span across devices in Google Analytics, such as attributing an interaction with a marketing campaign on one device to a conversion that occurs on another device, require the use of the User ID feature.
The User ID feature consists of:
- The
userIdfield, 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 Google 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 reference doc describes how you can configure and send User IDs to Google Analytics, as well as how User ID data is processed and reported in your User ID-enabled views.
Configuration
Before sending User IDs to Google Analytics, you must enable at least one view (profile) for User ID.
Enabling a view for User ID produces two effects on that view (profile):
- New and unique users are calculated using unique User IDs rather than unique Client IDs.
- Cross-device reports that leverage the User ID will be enabled in that view (profile).
Collection
When a user is known to your website or application, you should send an ID representing that
user with all of your Google 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
Google 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 Google 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.
userId field was set will be reported in
User ID-enabled profilesReporting
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 Google 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.
Client ID vs. User ID
The following table summarizes the differences between Client ID and User ID:
| Client ID | User 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 Google Analytics libraries. | You must set and send your own userIds with your Google 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.