Skip to content

Commit

Permalink
removing google analytic because of chrome policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Dario Santos authored and Dario Santos committed Dec 7, 2024
1 parent eedd517 commit 66834c6
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 137 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
"react": "^18.2.0",
"react-content-loader": "^6.2.0",
"react-dom": "^18.2.0",
"react-ga": "^3.3.1",
"react-ga4": "^1.4.1",
"react-i18next": "^11.18.5",
"react-idle-timer": "^5.4.2",
"react-native": "^0.70.5",
Expand Down Expand Up @@ -170,4 +168,4 @@
"last 1 safari version"
]
}
}
}
4 changes: 0 additions & 4 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ import React from 'react';

import AppProvider from './AppProvider';
import AppRoutes from './AppRoutes';
import ReactGA from 'react-ga4';
import { isExtension } from './utils/platform';

const App = () => {
if (!isExtension()) {
ReactGA.initialize('G-HE1ZJJBN0V');
}
// Disallow rendering inside an iframe to prevent clickjacking.
if (window.self !== window.top) {
return null;
Expand Down
5 changes: 4 additions & 1 deletion src/hooks/useAnalyticsEventTracker.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
import { useEffect } from 'react';
import ReactGA from 'react-ga4';
import { isExtension } from '../utils/platform';

const useAnalyticsEventTracker = section => {
useEffect(() => {
/*
if (!isExtension()) {
ReactGA.send({ hitType: 'pageview', page: section });
}
*/
}, [section]);

const trackEvent = (action, label) => {
/*
if (!isExtension()) {
ReactGA.event({
category: section,
action: action,
label: label,
});
}
*/
};
return { trackEvent };
};
Expand Down
Loading

0 comments on commit 66834c6

Please sign in to comment.