DavidWells / analytics

Lightweight analytics abstraction layer for tracking page views, custom events, & identifying visitors
https://getanalytics.io
MIT License
2.43k stars 247 forks source link

Remove user_id as a custom dimension in google-analytics event payload #407

Open therealchrisrock opened 11 months ago

therealchrisrock commented 11 months ago

I'm reviewing the recommendations from google on how to handle user_id for GA4 and it states the following:

It is recommended that you do not register a user ID as a custom dimension. Creating unnecessary high-cardinality custom dimensions, like User ID, negatively impact your reports and cause data to aggregate under the (other) row

It looks like the user_id is already pushed to the datalayer in the way they recommend but it looks like we're also sending the user_id as a custom dimension in the finalPayload for page and track events.