How to Set Up User Tracking in Google Analytics

Do you have a membership site, an online forum, or an education or training website, or a website that otherwise has protected content that your users need to log-in to view?

That’s great news– because with ExactMetrics’ User Tracking feature you can track each user who has logged into your WordPress website with their User ID.

The behavior of each specific logged-in User on your WordPress website can be tracked via ExactMetrics’ User ID function and will be visible in Google Analytics in the User Explorer, and also a custom dimension if setup.

Please note that the User ID is the WordPress User ID as seen below, not the username, email or real name of the individual. This is because Google Analytics doesn’t allow any personally identifiable information (PII) to be added to Google Analytics as per their Terms of Service.

Prerequisites: To get started, you’ll need:

Step 1: Enable User Tracking in ExactMetrics

First, go to ExactMetrics » Settings» eCommerce in your WordPress dashboard and find the User ID Tracking section. You might need to click the arrow on the right to reveal the entire section.

Click the Toggle to Enable User ID tracking in ExactMetrics. This will auto-save your new setting.

Step 2: Enable User Tracking in Google Analytics

Below are step-by-step instructions for users who have a Google Analytics 4 (GA4) property or a Universal Analytics (UA) property. If you’d like, you can track into both a UA and GA4 property through ExactMetrics’ Dual Tracking feature (learn more about How to Set Up Dual Tracking).

Google Analytics 4

User ID tracking is enabled by default in a GA4 property.

Within your Google Analytics account, at Admin » Reporting Identity, you will see two options:

  • Blended
  • Observed

Both options will attempt to record a User ID if available, and as a fallback, a client ID will be used.

We recommend leaving the Blended option selected.

Once you’ve confirmed that User ID tracking is enabled, if you haven’t yet already, go to the Explore page and create a User Explorer custom report, where you’ll be able to view your User ID data.

Universal Analytics

First, log in to your Google Analytics account. Next, select the UA property you need to enable user tracking for:

Click on the Admin settings for this profile:

Now, on the settings page, under your the Property column (the middle column), click Tracking Info » User-ID:


On the panel which expands, you’ll need to click the toggle to On and then push the Next step button which will indicate your agreement to the User-ID policy:

Next, leave “Session Unification” turned On and click Next step.

Click the Create button which will begin the process of creating the User-ID view for your website.

Next, you will need to name your new Reporting View Name (we recommend including User-ID in the name so it’s easy to remember which view has User-ID tracking enabled).

Note: Be sure that the Show User-ID Reports toggle is enabled in this view:

And to finish creating your new User-ID view, click the Create View button.

You’ll see a brief success message, which means it was successfully created.

Now you have a new User ID View:

There will not be any data in the User ID view.

It can now take 24 hours for data to display in the new view. It will not contain data from the past, however, data will start being collected now and moving forward.


While you can now access your new User-ID view, please ignore any errors in the reports until 24-hours have passed and data has been collected.

However, we have sometimes seen a bug in Google Analytics where upon initial creation of the new User-ID view, in some rare instances, the User-ID setting isn’t actually enabled on the 1st try. To make sure this didn’t happen to you, please navigate back to the admin area and confirm User-ID is active:

Step 1. Navigate to the view:

Step 2. Click View Settings.

Step 3. Ensure User-ID reports are enabled for this view:

Please note that when a new view is created, it doesn’t contain any data, so it will only contain data moving forward.

After enough time has passed, and you’re sure some users are likely to have logged into your site, please navigate to Audience » User Explorer at Google Analytics in the left menu to see your user data.

You’ll see that each user is now listed by their User ID in WordPress.

You can now click on the User ID of individual users who have logged in to see more detailed info on each user:

To know which WordPress User is associated with each ID you will need to go to your WordPress dashboard and click on Users » All Users.

When you hover your cursor over the user you want to find the ID for you can see a URL appear at the bottom of your browser.

In that URL, it says “user_id=”. The number after that is the user’s ID number in Google Analytics, above.

You can also click the Edit link under the username. Now the User ID will appear in the browser web address on the edit page:

Now, you know how to track each logged-in WordPress user who has an account on your WordPress LMS or Membership site!

Next, please see our guide on how to get started with the ExactMetrics eCommerce addon, or our Getting Started with ExactMetrics: Guide and Checklist for Advanced Metrics for even more step-by-step guides for very advanced metrics setups.