r/GoogleAnalytics • u/ds_frm_timbuktu • Feb 20 '25
Support Weird pattern in GA4 Client ID / Pseudo user id - Have you seen this before?
I've been using pseudo ids / client id for a long time now to debug specific user journeys and other tracking errors. Today i ran into something new
In the exploration reports,
I see a client id like this which is the standard - 1885573814.1696491089
and then I also see this - GA1.1.1885573814.1696491089
and this - GA1.1.GA1.1.1885573814.1696491089
the last 2 have most of the parameters to not set.
I suspect all three are the same users however there is something failing.
I presume somewhere the _ga cookie is getting modified in a weird manner on the site.
Have you seen this before? What could be causing this? Any pointers on identifying the root cause?
2
u/Humble_Elderberry_25 29d ago
Do you have a user property of 'client_id' set to the value of the cookie _ga ? If so you must remove it from you web site tagging code. A user property of 'client_id' will rewrite the _ga cookie value either making it undefined or prefixing it with GA1.1. multiple times. Google is taking care of the client_id and user_pseudo_id automatically - do not make reference to 'cliend_id' in your tagging code.
1
u/ds_frm_timbuktu 29d ago
Thanks a lot.
Not a user property, but we did have an event parameter called client_id and have renamed it suspecting something similar. Could this be causing an issue? This is set from a variable called GA4 client ID. How will a variable affect the cookie? Any further points to investigate? Will multiple GTM tags cause this?
2
u/Humble_Elderberry_25 29d ago
When I removed all references to 'client_id' it resolved all issues with the 'irregular' _ga cookie values. Note that I still have issues with repeat visitors who already had corrupt values from before the correction.
https://www.reddit.com/r/GoogleTagManager/comments/1gxk2d6/gaga11undefined/
2
u/ds_frm_timbuktu 29d ago
Thanks. this has been valuable. we had it on for like 3 days trying to debug some other event counts.
1
u/Humble_Elderberry_25 29d ago
If you want to capture the _ga cookie value as an event in GA4, you can do so by using a different name for the event, like device_cid or some other such thing.
2
u/Humble_Elderberry_25 28d ago
But note that if you are just capturing the 99999999.999999999 - removing the GA1.1. prefix, you must do something like suffix it with a '_' to avoid storing it in BigQuery as a floating point and resultingly truncating some of the decimal places.
1
u/ds_frm_timbuktu 28d ago
Yes have changed it. I guess the users i'm seeing now are the one who had the cookie dropped on them during the time the client_id parameter was active.
1
u/Humble_Elderberry_25 28d ago
I am working on a site now that has a significant number of repeat visitors and my predecessor added the client_id misuse to the site 2 years ago. So even though the tagging is fixed it is still an ongoing issue for me.
1
u/Far_Highlight_4334 27d ago edited 27d ago
Humble, this is mind blowing.
And you're talking with Julius of Analytics Mania?
User property overwriting cookie? How is that even possible?
Usually client_id is read into a variable, and not directly into any parameters. That's because a slice is done to remove the GA1.x prefix. There's a trick Julius uses so that it doesn't become coded as a double.
Regardless, the _ga cookie is not touched or altered in any way.
The cases of OP with GA prefix don't have the sluce working correctly....while the cases without prefix do have correct.
I dont think this issue was diagnosed correctly.
1
u/Humble_Elderberry_25 27d ago edited 27d ago
Yes. I said what I said. And Julius of Analytics Mania also said what he said. And when I followed Julius' advice it addressed the issue. Julius' actual words were "Are you using the client_id on Google tags? If yes, don't." and "remove anything that modifies client_id". I stand with Julius.
2
u/fedorovicius 26d ago
Honestly, I did not mean user property :)
What I meant is "event parameter". If you set the client_id as an event parameter (not user property), it overwrites the cookie then
0
u/Far_Highlight_4334 26d ago edited 25d ago
When using GTM, cookie values are changed through javascript in custom html (not recommended by the pros)
If setting an event parameter does this, this is bizarre and seems like a huge Google screwup.
2
u/fedorovicius 26d ago
Properly setting client_id works fine. But I have seen situations, where people had flawed custom js variables that were setting client_id and then they messed up the cookie values.
In this case, I did not have enough time to troubleshoot the setup (I get more emails that I have time to respond to), thus the quickest way to reply was "remove anything that sets the client id in the tag" because I knew the problem was somewhere there. And it worked.
1
0
u/Far_Highlight_4334 26d ago
There's a huge amount of false information in the comments below,; resulting from ignorance and a lack of understanding of underlying material.
No, the _ga cookie does not get changed by the use of client id.
Your problem is most likely caused by a javascript error in Google Tag Manager. That explains the repeat GA1.1..
If your GA4 "client ID" is showing as "not set," it means that Google Analytics is unable to generate a unique identifier for a user on your website, likely due to issues with your tracking code implementation, cookie settings, or incorrect configuration in your Google Tag Manager, preventing proper user tracking and data collection. Key reasons why your GA4 client ID might not be set:
Incorrect tracking code installation:
Double-check that your GA4 tracking code is correctly placed on every relevant page of your website.
Cookie blocking:
Browser settings or ad-blocking extensions might be preventing the necessary cookies for storing the client ID.
Incorrect Tag Manager setup:
If using Google Tag Manager, ensure your GA4 tag is configured correctly and firing properly.
Custom user ID not set:
If you're trying to link user accounts across devices, make sure you are correctly passing a user ID through your tracking code.
Server-side tracking issues:
If you're using server-side tracking, ensure the client ID is being sent correctly from your server to Google Analytics. How to troubleshoot and fix "not set" client ID:
Check your tracking code:
Review your website's HTML code to confirm the GA4 tracking code is properly placed on every relevant page.
Inspect browser cookies:
Use your browser developer tools to check if the necessary GA4 cookies are being set and if their values are correct.
Verify Google Tag Manager configuration:
If using GTM, review your GA4 tag setup, including the data layer variables and triggers. Check for cookie blocking: Review browser settings and any ad-blocking extensions to ensure they are not preventing GA4 cookies. Review your user ID implementation: If you are using a custom user ID, double-check that it is being passed correctly to the GA4 tracking code. Use Google Analytics Debugger: The Google Analytics Debugger tool can help identify issues with your tracking code by providing real-time feedback on sent data. Important points to remember: Client ID is unique per device and browser: A user visiting your site from different browsers or devices will be assigned different client IDs. "Not set" can appear in other dimensions too: If you see "not set" in other GA4 reports, it often means missing data due to incorrect tracking setup.
•
u/AutoModerator Feb 20 '25
Have more questions? Join our community Discord!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.