[UA] Set up User-ID

First enable User-ID in your account, then implement it in your code.

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:

  1. Sign in to Google Analytics.
  2. Click Admin, and navigate to the property in which you want to implement User-ID.
  3. In the PROPERTY column, click Tracking Info > User-ID.
  4. Follow the steps outlined in the next sections.

1. Agree to the User-ID Policy

  1. Read the User-ID Policy.
  2. Under I agree to the User-ID Policy, set the switch to ON. Agreeing to the policy enables the feature in your account.
  3. 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.

If you're not able to assign an ID to a user, do not send the UID parameter. If you set the UID parameter to null or none when you can't assign an ID, then all of those users for which you do not have the necessary data count against your data limits and can cause discrepancies in your reporting.

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

  1. Turn session unification ON or OFF as necessary.
  2. Click Next Step.
Using Google Tag Manager? See how you can use Google Tag Manager to implement User-ID in your Analytics tracking code.

3. Create a User-ID reporting view

User-ID data can appear only in a dedicated User-ID view.

  1. Click Create.
  2. 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.
  3. Select a Reporting Time Zone.
  4. Under Show User-ID Reports, set the switch to ON.
  5. 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.

All reports in a User-ID view display data from sessions in which a User-ID is assigned and related data is sent to Analytics. Use a different view to see data from sessions in which a User-ID is not sent to Analytics.

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:

If you use Google Tag Manager, refer to User-ID in the Google Tag Manager help center.

Was this helpful?

How can we improve it?
Choose your own learning path

Check out google.com/analytics/learn, a new resource to help you get the most out of Google Analytics 4. The new website includes videos, articles, and guided flows, and provides links to the Google Analytics Discord, Blog, YouTube channel, and GitHub repository.

Start learning today!

Clear search
Close search
Google apps
Main menu