analytics working

This commit is contained in:
lingdocs 2021-08-04 12:58:50 +03:00
parent e32139d2fe
commit 6f5fe0b417
1 changed files with 6 additions and 0 deletions

View File

@ -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 (
<>