codler / react-ga4

React Google Analytics 4
https://www.npmjs.com/package/react-ga4
266 stars 34 forks source link

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

Open ChenCodes opened 1 month ago

ChenCodes commented 1 month ago

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!