Questions tagged [react-ga]
67 questions
1
vote
1 answer
React-ga not computing first access
I have React-ga set up with React Router in the following manner:
...
import { Router } from 'react-router-dom';
import createHistory from 'history/createBrowserHistory';
import {Provider} from 'react-redux';
import ReactGA from…

Matheus Alves
- 90
- 2
- 15
1
vote
2 answers
How to get GA Tracking IDs from GTM code
Is there with javascript a way to retrieve the Google Analytics "Web Property ID" for a given GTM code?
I am including the snippet for GTM in the HEAD of my pages, and the Google Tag Assistant extension sees the tags properly, including the "Web…

nevermind777
- 81
- 7
1
vote
0 answers
Google analytics. combining server sent events with Custom UserId and client pageviews with React.GA
Since some of my logic is front end (page views) and some server side oriented (async events shot after user doing some things, not always "clicking" on something) I'm trying to combine reporting to Google analytics from front end and server…

alonisser
- 11,542
- 21
- 85
- 139
1
vote
0 answers
Trouble with react-ga npm package in Rails API/React-Redux App
I'm trying to add react-ga to a Rails 5 API and React-Redux app. I've followed the steps outlined in the docs and events are logged in the console when debug mode is enabled, but Google Analytics isn't receiving any tracking information. I'm curious…

lgants
- 3,665
- 3
- 22
- 33
0
votes
0 answers
Google Analytics 4 Showing more user in real time
Recently I have updated my google analytics to Google Analytics 4, now number of user is displaying more in realtime

Supriya Kumari
- 181
- 2
- 14
0
votes
1 answer
Where is my collected data after 30 minutes on inactivity in Google Analytics 4?
I'm writing an app in React and I want to add Google Analytics to can see where are people getting stuck.
My app is collecting data correctly, but after 30 minutes all my collected data is gone and the average duration of the interaction is not…

SnNaCk
- 2,370
- 2
- 5
- 16
0
votes
0 answers
is it normal to have "Direct source" for the most of the traffic and purchses for new website | React and Google Analytics
My website here newminatis has its most traffic from direct sources, which is weird as it doesn't have good SEO practices.
I'm running ads through social media and I would expect honestly to have the traffic from there, am I missing something in my…

Omar Aljoundi
- 21
- 1
- 4
0
votes
1 answer
GA4 - React-ga4 add_to_cart event not triggering
I've tried to add an event on an 'Add to cart' button, but it is not triggering and I don't know hot to do it.
ReactGA4.gtag("event", "add_to_cart", {
currency: "RON",
value: price,
items: [
{
item_id: id,
…

Florin200217
- 3
- 2
0
votes
1 answer
Google analytics user property react-ga4
I'm using react-ga4.
I wonder how i could send user properties using this library and set it up in the google analytics panel as I think that i'm doing something wrong.
This is how i initialize ReactGA4
ReactGA.initialize(
[
{
…

Zenit
- 429
- 1
- 8
- 20
0
votes
0 answers
How do i integrate Google Analytics 4 in a react app with React router?
I would like to know how i can set up google analytcis in a multiple page react app that uses react router. After a lot of looking around i discovered that my react-ga solution wasn't woking because the id wasn't UA- but G- and google will stop…

DaiF
- 21
- 5
0
votes
1 answer
Google Analytics 4 property tracking React app now that Google is discontinuing Universal Analytics properties
So... every tutorial on using Google Analytics with React specifies to use Universal Analytics property only. However, Google says:
Universal Analytics properties will stop collecting data starting July 1, 2023. It’s recommended that you create a…

openSourcerer
- 63
- 6
0
votes
1 answer
Google analytics UserId view is not working with react
I want to track users by their login ID in a ReactJS application. I followed all of the tutorials on the documentation to set up the User Id View. I enabled userId tracking in google analytics and I've set a userId upon logging in. this is my login…

Hazem Ben Abdelhafidh
- 254
- 1
- 6
- 21
0
votes
1 answer
How does one properly install reactGA with npm?
I created a react app with React 18, but when I try installing reactGA using npm install react-ga --save, I get errors:
I tried reinstalling nodejs but nothing seems to be working, I can install other packages but for some reason react-ga is not…
0
votes
1 answer
Google Analytics using react-ga recommended react-router implementation uses page title from previous route
Apologies if this is a duplicate question or has been addressed elsewhere but I haven't been able to find an answer. I am trying to integrate google analytics in a react app that uses react-router-dom as per…

Dave
- 457
- 4
- 15
0
votes
0 answers
Get events from react-ga
I'm trying to implement Google Analytics in a SPA React-app to record events.
I have created a data stream in Google Analytics and got a measurement ID. Then I made a custom hook:
import ReactGA from 'react-ga'
type GoogleAnalyticsReturn = {
…

olamatre
- 61
- 2
- 6