How to See User ID in Google Analytics

Cody Schneider

While Google Analytics is great at showing you what anonymous groups of users are doing on your site, it struggles to connect the dots when one person visits from their laptop, then their phone, then their work computer. Setting up User-ID tracking solves this by linking all of that activity to a single, consistent profile. This article will explain what a User-ID is, why it's essential for accurate reporting, and exactly how to implement it and find the data in Google Analytics 4.

What is a User-ID in Google Analytics?

By default, Google Analytics identifies "users" based on a unique Client ID stored in a web browser cookie or a device's App Instance ID. This system is anonymous and works okay for a basic count, but it has a massive limitation: it tracks browsers, not people.

If someone visits your marketing site on their Chromebook and then logs into your product on their iPhone, GA4, by default, counts this as two separate users. Their journey is fragmented, your user count is inflated, and you can't truly understand how people interact with your brand across different platforms.

The User-ID feature fixes this. It’s a unique, non-personally identifiable string that you generate and assign to a user once they log in or create an account. When you send this ID to Google Analytics, GA4 uses it as its primary key to stitch together all sessions and hits from that person, regardless of the device they use.

Why User-ID is a Game Changer for Your Analytics

Implementing User-ID isn't just a minor technical tweak, it fundamentally upgrades the quality and accuracy of your data. Here’s why it’s worth an afternoon of setup:

  • Accurate User Counts: By deduplicating users across devices, you get a much more realistic count of your actual user base, not just a count of browsers that have visited your site.

  • True Cross-Device Tracking: Finally understand the entire customer journey. See how a user discovers your brand via a mobile search ad, browses on their tablet, and finally converts on their desktop.

  • Deeper Behavioral Insights: You can analyze the specific behavior of your most valuable group: logged-in customers. Understand which features your power users engage with or where new signups get stuck.

  • Connect Online and Offline Data: Because you control the User-ID, you can use the same identifier in your CRM, payment processor, or other internal systems. This allows you to connect a user's web behavior in GA4 to their lifetime value or support tickets in your CRM, creating a holistic view of the customer.

  • Smarter Audience Building: Create highly specific retargeting or personalization audiences. For example, build an audience of "logged-in users who have abandoned their cart on both mobile and desktop" to target them with a specialized offer.

Step-by-Step Guide: Setting Up User-ID in GA4

Setting up User-ID involves two main parts: getting the ID from your website's backend and then passing it to Google Analytics. This typically requires a small bit of developer help, but the process is straightforward.

Step 1: Generate a Unique, Stable, and Anonymous ID

This is the most critical step and happens entirely on your own website or application. You cannot create the ID in Google Analytics, you must provide it.

The ID you generate must meet three conditions:

  1. It must be unique to each user. No two users should ever have the same ID. Database record IDs (like 78A92B45) are perfect for this.

  2. It must be persistent. The same user should be assigned the same ID every time they log in, forever.

  3. It cannot be Personally Identifiable Information (PII). This is a strict Google requirement. You cannot use email addresses, usernames, or phone numbers. Doing so violates Google’s terms of service and can get your account suspended. Stick to generated alphanumeric strings.

Your developer's task is simple: when a user successfully logs in, make their unique, anonymous ID available on the web page.

Step 2: Send the User-ID to GA4

Once the ID is available, you need a way to send it along with your GA4 tracking data. The best way to manage this is with Google Tag Manager (GTM), as it doesn't require hardcoding changes directly to your site's template files.

Using Google Tag Manager (Recommended)

This method uses GTM's data layer, a virtual layer that holds data from your site to be used by tags.

Part A: Push the User-ID to the Data Layer

First, have your developer push the User-ID to the data layer when a user logs in. The code should be fired on any page after a user authenticates. It looks like this:

Make sure this populates the user_id value dynamically for each logged-in user.

Part B: Configure GTM to Capture and Send the ID

Now, let’s go into Google Tag Manager to set everything up.

  1. Create a Data Layer Variable:

    • Go to Variables > User-Defined Variables > New.

    • Choose Data Layer Variable as the variable type.

    • In the Data Layer Variable Name field, enter user_id. This must match the name from the code snippet exactly.

    • Name your variable something clear, like "DLV - user_id", and save it.

  2. Update Your GA4 Configuration Tag:

    • Navigate to Tags and click on your main Google Analytics: GA4 Configuration tag.

    • Under Tag Configuration, go to the Fields to Set section.

    • Click Add Row.

    • For Field Name, enter user_id.

    • For Value, click the variable icon (+) and select the {{DLV - user_id}} variable you just created.

    • Save your tag.

Once you publish your GTM container, Google Analytics will begin receiving the User-ID for every tracked event for a logged-in user.

Using the Global Site Tag (gtag.js)

If you don't use GTM, you can set the User-ID directly in your gtag.js script. Your developer needs to modify the standard config script by adding the user_id parameter after a user logs in:

Step 3: Verify It's Working

Before you celebrate, make sure events are coming through correctly. The best tool for this is GA4's own DebugView.

  1. In GTM, enter Preview mode for your site.

  2. In a new tab, open your GA4 property and navigate to Admin > DebugView.

  3. On your site (while in preview mode), log in to an account.

  4. In DebugView, you should see events like login and page_view start to flow in. Click on an event and look at its parameters. You should see a user_id parameter listed with the correct non-PII value. If it's there, you're all set!

Where do I See the User-ID Data in GA4?

This is a source of confusion for many. You won't find a report with a column listing the exact User-ID values. Google intentionally obscures the raw IDs in standard reporting to protect privacy. However, the User-ID is now working in the background to make your other data much more powerful.

Reporting Identity: The Engine Behind the Scenes

In GA4, go to Admin > Reporting Identity. You’ll see the "Observed" method is selected by default. This tells GA4 to stitch user journeys together using the following priority:

  1. First, look for a User-ID.

  2. If not found, use data from Google Signals (if enabled).

  3. If not found, fall back to the Device ID (the browser cookie).

Your main benefit comes automatically: the standard 'Users' metric in all your reports (from Reports Snapshot to Traffic Acquisition) is now de-duplicated and more accurate. GA4 is automatically resolving identities for you.

Using User-ID in Explorations and Segments

The real power of User-ID is unlocked in the Explore section, where you can build custom reports and segments.

  • Better Path Explorations: Your path exploration reports will now show combined user journeys across multiple devices, giving you a much clearer picture of how users navigate your platform.

  • Hyper-Specific Segments: You can create complex segments that would be impossible without device unification. For example, build a segment where the first session was on a mobile device and the conversion session occurred on a desktop.

  • Analyze Logged-in vs. Anonymous Behavior: Build two segments: one for sessions where "User-ID is present" and one where it's not. Compare their behavior to see how your paying customers differ from your anonymous visitors.

See a Count of Logged-in Users

If you want to quickly see the volume of traffic that has an associated User-ID, create a simple Exploration report:

  1. Go to Explore and start a new Free form exploration.

  2. In the 'Rows' section, add a dimension like Device category.

  3. In the 'Values' section, add the metric Active users.

  4. Scroll down to 'Filters'. Create a filter for "Signed in with user ID" - contains - "yes".

This will show you a basic breakdown of active users who were correctly identified with your User-ID system. Easy peasy.

Final Thoughts

Setting up User-ID tracking transforms GA4 from a tool that measures anonymous sessions into one that helps you understand concrete user journeys. It does require planning and a touch of development work to implement, but the payoff in data accuracy, audience capabilities, and cross-device insight is a foundational step toward becoming a truly data-driven organization.

Connecting all your tools and getting meaningful insights doesn't have to be a multi-week technical project. At Graphed, we remove the friction by building an AI data analyst that connects to sources like Google Analytics in just a few clicks. Instead of wrestling with filters and explorations in GA4, you can get insights by simply asking a question in plain English, like "Show me how many of our logged-in users come from paid search compared to organic social." We believe you should spend less time finding data and more time acting on it.