mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-15 10:17:33 -05:00
switch tracking
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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]);*/
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user