DavidWells / DavidWells/analytics
Remove user_id as a custom dimension in google-analytics event payload
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.7k
- Forks
- 267
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace how the finalPayload is assembled for page and track events, and compare that with the existing datalayer handling for user_id. The change is done when user_id remains in the recommended datalayer path but is no longer included as a custom dimension in either event payload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100