From c357ea66b7aa366a117b4d705f7c9aae326fd24f Mon Sep 17 00:00:00 2001 From: louis-md Date: Mon, 13 May 2024 15:59:24 +0200 Subject: [PATCH] Only get google tag data from consenting users --- pages/_app.tsx | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/pages/_app.tsx b/pages/_app.tsx index 39428fe1..96bc90fa 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -58,7 +58,11 @@ const GoogleAnalytics: React.FC = () => { location.reload() } }, [isAnalyticsEnabled]) - return null + return isAnalyticsInitialized ? ( + + ) : null } const App = ({ @@ -68,27 +72,22 @@ const App = ({ emotionCache = clientSideEmotionCache }: AppProps & { emotionCache?: EmotionCache -}): ReactElement => { - return ( - <> - - - - - - - - - - - - - - - - ) -} +}): ReactElement => ( + <> + + + + + + + + + + + + + + +) export default App