To set up the User-ID feature, you must first enable it in your Analytics account and then implement it in your tracking code.
You also have to create a User-ID view to see the data in your Analytics reports.
Learn more about User-ID and read about User-ID limits before you implement this feature.
In this article:Set up User-ID in your account
You must have the Editor role for the property.
To set up User-ID:
- Sign in to Google Analytics.
- Click Admin, and navigate to the property in which you want to implement User-ID.
- In the PROPERTY column, click Tracking Info > User-ID.
- Follow the steps outlined in the next sections.
1. Agree to the User-ID Policy
- Read the User-ID Policy.
- Under I agree to the User-ID Policy, set the switch to ON. Agreeing to the policy enables the feature in your account.
- Click Next Step.
2. Set up User-ID in your tracking code
After you enable User-ID by agreeing to the policy, you must implement User-ID in your tracking code.
To employ User-ID, you must be able to generate your own unique IDs, assign IDs to new users and consistently reassign the same IDs to returning users, and include these IDs in the data you send to Analytics.
The tracking-code update should be completed by a developer. See Related resources, below.
You can employ User-ID for both websites and mobile apps. Both types of reporting views (web and app) will accept both web and app hits and report them together. With User-ID, we recommend that you maintain a consolidated view that includes all types of hits, and that you configure filtered views to isolate web and app hits as necessary.
Session unification
Session unification lets you associate hits that are collected before the User-ID is assigned with the User-ID when it is assigned, so long as those hits occur in the same session in which the ID is assigned for the first time.
Session unification is on by default.
When session unification is off, only hits that are collected when the User-ID is already assigned are associated with an ID.
Learn more about session unification
- Turn session unification ON or OFF as necessary.
- Click Next Step.
3. Create a User-ID reporting view
User-ID data can appear only in a dedicated User-ID view.
- Click Create.
- Enter a Reporting View Name.
You might want to include the term "User-ID" in the name to help you remember that this is a special User-ID view. - Select a Reporting Time Zone.
- Under Show User-ID Reports, set the switch to ON.
- Click Create.
You can create more User-ID views anytime by following the standard process to create a new view.
User-ID Views can't be converted to standard views, and standard views cannot be converted to User-ID views. Only new views added to a User-ID enabled property can be designated as User-ID Views.
Related resources
For details on how to add User-ID to your tracking code, refer to the instructions in the Developer Guide for your specific environment:
- Websites: gtag.js
- Mobile apps: Android apps or iOS apps
If you use Google Tag Manager, refer to User-ID in the Google Tag Manager help center.