DEV Community

Vicente G. Reyes
Vicente G. Reyes

Posted on

Google Analytics not sending different pages aside from home page in ReactJS(Vite)

I'm using react-ga4 for my [portfolio[(https://vicentereyes.org). I have a PageViewTracker.jsx which has:

import { useEffect } from 'react' import { useLocation } from 'react-router-dom'; import { trackPageView } from '../utils/analytics'; const PageViewTracker = ({ children }) => { const location = useLocation(); useEffect(() => { trackPageView(location); }, [location]); return children;

Top comments (0)