mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
Revert "Merge branch 'master' into master"
This reverts commit7dcadc4501, reversing changes made to0c5774fbce.
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
const GA_MEASUREMENT_ID = "G-2M2VYEFL7B";
|
||||
|
||||
const useGoogleAnalytics = () => {
|
||||
const location = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window.gtag === 'function') {
|
||||
const fullPath = location.pathname + location.search + location.hash;
|
||||
window.gtag('config', GA_MEASUREMENT_ID, {
|
||||
'page_path': fullPath,
|
||||
});
|
||||
window.gtag('event', 'page_view', {
|
||||
'page_path': fullPath,
|
||||
'page_location': window.location.href.replace('/#', '')
|
||||
});
|
||||
|
||||
}
|
||||
}, [location]);
|
||||
|
||||
};
|
||||
|
||||
export default useGoogleAnalytics;
|
||||
Reference in New Issue
Block a user