diff --git a/client/package-lock.json b/client/package-lock.json index 5c2bd4d2..3a57e50b 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -26,6 +26,7 @@ "nsfwjs": "^2.4.2", "react": "^18.2.0", "react-dom": "^18.2.0", + "react-ga4": "^2.1.0", "react-icons": "^4.10.1", "react-loading-icons": "^1.1.0", "react-router-dom": "^6.15.0", @@ -5839,6 +5840,11 @@ "react": "^18.2.0" } }, + "node_modules/react-ga4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/react-ga4/-/react-ga4-2.1.0.tgz", + "integrity": "sha512-ZKS7PGNFqqMd3PJ6+C2Jtz/o1iU9ggiy8Y8nUeksgVuvNISbmrQtJiZNvC/TjDsqD0QlU5Wkgs7i+w9+OjHhhQ==" + }, "node_modules/react-icons": { "version": "4.10.1", "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.10.1.tgz", diff --git a/client/package.json b/client/package.json index f2bd8ff2..1c811e25 100644 --- a/client/package.json +++ b/client/package.json @@ -30,6 +30,7 @@ "nsfwjs": "^2.4.2", "react": "^18.2.0", "react-dom": "^18.2.0", + "react-ga4": "^2.1.0", "react-icons": "^4.10.1", "react-loading-icons": "^1.1.0", "react-router-dom": "^6.15.0", diff --git a/client/src/App.jsx b/client/src/App.jsx index b02114a0..df4cd2db 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'; import { Navigate, Route, Routes } from 'react-router-dom'; import { KindeProvider } from '@kinde-oss/kinde-auth-react'; +import ReactGA from 'react-ga4'; // Store import { useAuth } from 'context/AuthContext'; @@ -26,6 +27,8 @@ import useIsTabActive from './hooks/useIsTabActive'; const clientID = import.meta.env.VITE_IMPORTANT; function App() { + ReactGA.initialize('G-HL8CN4JFXN'); + const { isLoggedIn, dispatchAuth } = useAuth(); const { loadUserSettings, updateOnlineStatus, app } = useApp();