Skip to content
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

Next.js V15 #90

Open
m7eng opened this issue Oct 31, 2024 · 2 comments
Open

Next.js V15 #90

m7eng opened this issue Oct 31, 2024 · 2 comments

Comments

@m7eng
Copy link

m7eng commented Oct 31, 2024

Hello, how do I used react-ga4 in NextJS V15 especially with the App Router?
Is it sufficient to put

import ReactGA from 'react-ga4'; (...) const TRACKING_ID = "G-R85LV3LZ4X"; ReactGA.initialize(TRACKING_ID);

into the page.tsx and it will track all other routes as well?

@kleinaber
Copy link

Haven't tested this with v15 yet but at least in this post it's said to work right out of the box: https://medium.com/@vergil333/google-analytics-4-in-react-a250005c2455

@andreynovikov
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants