Search code examples
google-analyticsreact-ga

react.ga: how to get the data created in the 'set' API


I am trying to integrate Google Analytics into my react app. And currently I'm using the react-ga library.

It's a little confusing or unclear to understand the API set.

ReactGA.set({ userId: 123 })

There is not too much explanation about its functionalities. So what's the purpose of this API, and how to get the data set in the API?


Solution

  • This API is used to set the userId in the user explorer tab in your google analytics account. so that you can view the events, page views with respect to that user ID.

    This is basically to track the users based on their userID.