Update useGoogleAnalytics.js

This commit is contained in:
plebeius.eth
2023-09-23 21:15:03 +02:00
committed by GitHub
parent e518dedf38
commit 93eb4d78cf
+7 -2
View File
@@ -12,9 +12,14 @@ const useGoogleAnalytics = () => {
window.gtag('config', GA_MEASUREMENT_ID, { window.gtag('config', GA_MEASUREMENT_ID, {
'page_path': fullPath, 'page_path': fullPath,
}); });
window.gtag('event', 'page_view', {'page_path': fullPath}); window.gtag('event', 'page_view', {
'page_path': fullPath,
'page_location': window.location.href
});
} }
}, [location]); }, [location]);
}; };
export default useGoogleAnalytics; export default useGoogleAnalytics;pat