From a4667bee3ec71c18ac284c2f43423fa979369d29 Mon Sep 17 00:00:00 2001 From: Austin Condiff Date: Sun, 2 Oct 2022 15:38:33 -0500 Subject: [PATCH] Removed analytics --- package.json | 1 - pages/_app.js | 19 ------------------- utils/analytics.js | 21 --------------------- 3 files changed, 41 deletions(-) delete mode 100644 utils/analytics.js diff --git a/package.json b/package.json index cd44093..2a7df38 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "react": "17.0.2", "react-dom": "17.0.2", "react-feather": "^2.0.10", - "react-ga4": "^1.4.1", "react-parallax": "^3.5.1", "styled-components": "^5.3.5", "uuid": "^9.0.0" diff --git a/pages/_app.js b/pages/_app.js index 555d8bc..0289882 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -1,29 +1,10 @@ -import { useEffect } from 'react'; import Head from 'next/head'; import Footer from '@/components/common/Footer'; import Header from '@/components//common/Header'; import Site from '@/components/common/Site'; import '@/styles/globals.css'; -import { initGA, logPageView } from '@/utils/analytics'; function MyApp({ Component, pageProps }) { - useEffect(() => { - if (!window.GA_INITIALIZED) { - initGA(); - window.GA_INITIALIZED = true; - } - logPageView(); - - const appHeight = () => { - const doc = document.documentElement; - doc.style.setProperty('--app-height', `${window.innerHeight}px`); - }; - - window.addEventListener('resize', appHeight); - - appHeight(); - }, []); - return ( diff --git a/utils/analytics.js b/utils/analytics.js deleted file mode 100644 index 76cb61f..0000000 --- a/utils/analytics.js +++ /dev/null @@ -1,21 +0,0 @@ -import ReactGA from 'react-ga4'; - -export const initGA = () => { - console.log('GA init'); - ReactGA.initialize('G-14NVNPBGNR'); -}; -export const logPageView = () => { - console.log(`Logging pageview for ${window.location.pathname}`); - ReactGA.set({ page: window.location.pathname }); - ReactGA.pageview(window.location.pathname); -}; -export const logEvent = (category = '', action = '') => { - if (category && action) { - ReactGA.event({ category, action }); - } -}; -export const logException = (description = '', fatal = false) => { - if (description) { - ReactGA.exception({ description, fatal }); - } -};