From 6f5fe0b4173f647f6c0b36350a02835ff4eb307b Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Wed, 4 Aug 2021 12:58:50 +0300 Subject: [PATCH] analytics working --- src/App.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/App.js b/src/App.js index a549ccd..57904c9 100644 --- a/src/App.js +++ b/src/App.js @@ -33,8 +33,14 @@ if (prod) { function App(props) { const [navOpen, setNavOpen] = useState(false); + useEffect(() => { + ReactGA.pageview(window.location.pathname); + }, []); useEffect(() => { window.scroll(0, 0); + if (prod) { + ReactGA.pageview(window.location.pathname); + } }, [props.location.pathname]); return ( <>