0

Software Stack: React
I am trying to get my website analytics, for this, I am using react-ga library. I set up the code, but I have confusion, do I need to run ReactGA.initialize every time before executing the command ReactGA.pageview or ReactGA.event. Problem is, I am not getting the google analytics data.

Currently, I am setting ReactGA.initialize only at the initialize of my application. For my pages and buttonClick events, I am only using the ReactGA.pageview (inside componentDidMount) and ReactGA.event (inside event function call)

Django
  • 103
  • 10

1 Answers1

0

You need to initialize only once, no need to initialize multiple times. If you are not able to see the analytics data one of the reasons could be you are using normal google analytics account which may take some time to update the analytics in your account.

yaswanth
  • 159
  • 9