-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is this library dead? #53
Comments
does not work with GA4 for me. Debug sent work with every kind of GA Account ID even fake one. And does not firing any errors. |
Works for me! NOTE: TURN OFF YOUR ADBLOCK WHEN TESTINGIn your App.js import ReactGA4 from 'react-ga4';
ReactGA4.initialize("G-XXXXXX"); Create a // usePageTracking.js
import { useEffect} from "react";
import { useLocation } from "react-router-dom";
const usePageTracking = () => {
const location = useLocation();
useEffect(() => {
// track pageview with gtag / react-ga / react-ga4, for example:
window.gtag("event", "page_view", {
page_path: location.pathname + location.search,
});
}, [location]);
};
export default usePageTracking; Make sure you add this inside your Router, mine is in my Navbar component. //Navbar.js
const Navbar = () => {
usePageTracking();
return (...);
}; |
Yeah, this library is dead. We should all be moving to firebase analytics. Well maintained and implements GA4. |
@wmonecke I'm not quite sure I understand: do firebase analytics work for other tech stacks? Or are you recommending anyone using ReactJS who wants GA support use Firebase? |
@boxabirds I say that for any tech stack |
Hello! do you mean the following
|
Actually should be this now?
|
@echan00 why do you downvote my comment? The fact that it works doesn't mean it's being maintained. Do you know what that means? |
I don't mean anything personal but it seemed blanketing to use firebase (regardless of stack) seemed like a very opinionated comment. |
Firebase is a Google Product. I am not promoting a third party service or wrapper. |
Stumbled on this. Should be an easy drop in if using nextjs https://github.com/MauricioRobayo/nextjs-google-analytics |
thank you for your work on this @codler, works great when you need a simple upgrade path, and maintain the quality of the original library https://github.com/react-ga/react-ga |
Moved to https://github.com/codler/react-ga4 |
Can anyone confirm if this library is still alive? For the comments that I'm reading here make me think that this doesn't work very well?
The text was updated successfully, but these errors were encountered: