September 18, 2024
Google Analytics 4 Shows Just One Total User. Why?
Here’s a situation: you are looking at the report in Google Analytics 4 and only one total user is displayed. It might be 1 user in the Events report, or Traffic Acquisition report, or somewhere else.

Why is this happening?
This might be caused by an incorrect implementation of the User ID. In a nutshell, User ID is useful if your website has a login feature and visitors can sign in with different devices. When the same user logs in with different devices, Google Analytics will understand that it’s the same user.
A sample configuration in Google Tag Manager might look like this:

But there’s a catch. If the user hasn’t logged in, you should NOT send some placeholder value to GA4, for example, “none”, 0 (zero), or “undefined” (with quotes).

Other incorrect examples of placeholder user_id for non-logged-in users:
- “N/A”
- “not logged in”
- “anonymous”
- false
I think you get the idea now.
The Solution
If user_id is not available yet on a page (e.g., in the dataLayer), the developer should not push that parameter to the dataLayer at all. Or it can be pushed as undefined (without quotes). Then user_id will work as expected.

But if a developer is pushing some static placeholder value as the user_id when the user has not yet signed it, Google Analytics will treat this as an actual ID. This means that all non-signed-in users will be treated as the same user with the same ID. Hence 1 Total User in the GA4 reports.
How Google Analytics tags in GTM handle undefined values
If you have a variable that reads user_id from the data layer (and there is no user_id in the data layer, yet), then the variable will return undefined (without quotes). If such variable is used in Google Analytics 4 tags (when value is undefined), this will work fine. GA4 tags will drop that parameter from the request and undefined user id will not be sent.
But if the variable returns a static string (text) or number, such value will still be sent, and it will mess up your data.
Can I retroactively fix the historical data in GA4?
No. Once the data has been tracked, it will stay this way. Only after the fix is implemented, the new data will be tracked correctly. Do not hesitate on this.
One Total User in GA4 Reports: Final words
To sum up, this issue appears if you are sending a static value as user_id to Google Analytics 4. If a user is not logged in, don’t send something like “none” or “not logged in”.
In this case, a developer should either not push the user_id to the data layer at all, or he/she can send it as undefined (without quotes). It’s also important to note that if “undefined” is pushed with quotes, this is incorrect, too.

0 COMMENTS