switch tracking

This commit is contained in:
Luke Berndt
2023-02-14 22:13:03 -05:00
parent 143490d93e
commit 49ddc64a30
2 changed files with 3 additions and 3 deletions

View File

@@ -37,7 +37,7 @@
window.dataLayer = window.dataLayer || []; window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);} function gtag(){dataLayer.push(arguments);}
gtag('js', new Date()); gtag('js', new Date());
gtag('config', '%REACT_APP_GOOGLE_ANALYTICS%', { send_page_view: false }) gtag('config', '%REACT_APP_GOOGLE_ANALYTICS%', { send_page_view: true })
</script> </script>
</head> </head>
<body> <body>

View File

@@ -4,12 +4,12 @@ import { useLocation } from "react-router-dom";
export const usePageTracking = () => { export const usePageTracking = () => {
const location = useLocation(); const location = useLocation();
/*
useEffect(() => { useEffect(() => {
window.gtag("event", "page_view", { window.gtag("event", "page_view", {
page_path: location.pathname + location.search + location.hash, page_path: location.pathname + location.search + location.hash,
page_search: location.search, page_search: location.search,
page_hash: location.hash, page_hash: location.hash,
}); });
}, [location]); }, [location]);*/
}; };