Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not seeing user-id event parameter in GA4 dashboard #85

Open
ChenCodes opened this issue Aug 16, 2024 · 1 comment
Open

Not seeing user-id event parameter in GA4 dashboard #85

ChenCodes opened this issue Aug 16, 2024 · 1 comment

Comments

@ChenCodes
Copy link

ChenCodes commented Aug 16, 2024

Hi there!

I'm trying to use ReactGA.send to pass user_id to React GA4.

useEffect(() => {
    ReactGA.send({ hitType: 'pageview', page: location.pathname, user_id: user?.id ?? '' })
    // Track the pageview with react-ga
  }, [location, user])

In my local environment, I do see an event call being made with the user id as uid.
Screen Shot 2024-08-16 at 2 23 42 PM

In Google Analytics 4 dashboard, I tried viewing the page_view events, but I don't see user_id or anything of the sort as one of the event parameters. Is there something that I may be missing on the GA dashboard side to be able to see the event parameter show up?

Screen Shot 2024-08-16 at 2 25 14 PM

Any help / insights would be greatly appreciated!

@ChenCodes ChenCodes changed the title Viewing events with user_id event parameter Not seeing user-id event parameter in GA4 dashboard Aug 16, 2024
@sbatson5
Copy link

I found that if you separately set the user id via ReactGA.set you can track it across all events:

ReactGA.set({ user_id: user?.id });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants