Questions tagged [react-ga]
67 questions
0
votes
1 answer
Why I'm not able to access google analytics in my React app?
I am trying to enable google analytics with the help to react-ga hook.
I folloed their docs on github, I don't know why I'm not getting any data and don't know how can I debug this. I've paste this ReactGA.initialize("G-NHW4EP16PN"); code on every…

Chandler Bing
- 410
- 5
- 25
0
votes
1 answer
Is there a way to track a user active time spent in the React web application via Google Analytics?
Let's say an user with user_id(1000) and email(user101@example.com) logged into the reactjs based web application and browsed a few pages for 2mins and then moved to other application tabs/windows for 30mins and came back to the web application and…

bravokeyl
- 346
- 3
- 16
- 28
0
votes
1 answer
Google Analytics/React GA: History object is sending increasing numbers of hits with each location change
I've followed what appear to be fairly boilerplate instructions for using React-GA with React Router by listening on the history object for a change of location. Here's the snippet:
if (process.env.NODE_ENV === 'production') {
…

ipenguin67
- 1,483
- 5
- 22
- 39
0
votes
1 answer
Unable to connect ReactJS App with google analytics
I am trying to connect my personal website made using ReactJS to Google Analytics. I have followed this tutorial but I am still not able to see an active user (when I access the site on local host or when I deploy it using netlify).
Here is my…

Dhruv Mittal
- 1
- 4
0
votes
1 answer
Google Analytics session management for same app in different tabs, in a react app
Here's an example flow:
Referrer -> My App (1) -> Email is sent -> User clicks on email link -> My App (2)
I'm using react-ga. Step 1 is a session that contains Referrer URL (outside site that links to mine). Step 2 comes from an email, react-ga is…

George K
- 243
- 2
- 13
0
votes
1 answer
How to track react-ga events with react-router-dom
I want to track events with react-ga in my web app project. I used react-router-dom for my routing and I always used Link to redirect users. An example from my header - directing the user towards the "explore" page:
…

Dimitar Belchev
- 1
- 2
0
votes
1 answer
Google Analytics with react-ga library
I put in the initialization code, but it only runs once for one page. How do I get the google tracker to fire for multiple pages in the app?
In App.js
ReactGA.initialize("UA-XXXXXXXXX-1");
let baseUrl = window.location.pathname;
…

M B
- 11
- 3
0
votes
1 answer
Custom dimension is not storing in Google Analytics
I have a 2 tracking ids. one for Development environment and another for Production environment.
Both are having same custom dimension property called 'dimension1'.
custom dimension values are storing in Development Environment but Production…

Chandramohan
- 46
- 1
- 7
0
votes
1 answer
Show userid's for each history route
I implemented google analytics in my react website with the help of react-ga npm module.
I'm able to generate user report
and page view report
App.js
history.listen(location => {
ReactGA.set({ userId: sessionStorage.getItem("networkId") });
…

Abbas Ali
- 151
- 10
0
votes
1 answer
google analytics request being sent multiple times when code is being executed just once
We have this code of react ga that we have put inside ComponentDidMount and the debugger shows that the code is being run just fine which is fine. However the issue that I see is that in my network tab is that there are three requests going and all…

horrible_nerd
- 115
- 3
- 9
0
votes
1 answer
Google Analytics setup for React
I have managed to set up Google Analytics for my React application with the ReactGA library so it will send the pageview to analytics when the user navigates around.
The problem
The problem I'm facing is that I'm not sending any analytics to google…

Martin Nordström
- 5,779
- 11
- 30
- 64
0
votes
0 answers
How to check if an element is partially visible after scrolling past it?
I want to trigger a React.GA event after someone scrolls past a particular form.
I added this line to my componentDidMount
window.addEventListener('scroll', this.onScroll);
and then I have these two functions
isVisible = (el) => {
var rect =…

Paschalis
- 191
- 10
0
votes
1 answer
event goal conversion is shown 0 anytime
I am using google analytics to track the events. I mean when user comes from the landing page by hitting signup button which has utm values as follow app.abc.com/?utm_source=marketing&utm_campaign=ads&utm_medium=click. I then save those utms to…

Serenity
- 3,884
- 6
- 44
- 87
0
votes
0 answers
Google analytics not working with react app with SSR
I'm having trouble getting google analytics running within my react/meteor app. I think the problem is related to me have SSR enabled and then using ReactDOM.hydrate to update the app. I've been at this for 24 hours and I'm completely stumped. Any…

bp123
- 3,217
- 8
- 35
- 74
0
votes
0 answers
How to track Specific User activity or page views on the bases of User Id in React JS with google analytics using react-ga
I am not able to track specific user page views on the bases of User Id.
I tried in componentDidMount by setting userId.
I am expecting when user with user-id 1 visit any page on my site, then I can see its activity in the google analytics…

Bilal Abbasi
- 31
- 8