Skip to content

Commit

Permalink
fix: re-add google analytics (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivopr authored Jun 12, 2023
1 parent c1ab063 commit e4bb1a0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "client",
"version": "2.0.6",
"version": "2.0.7-next.1",
"private": true,
"scripts": {
"build": "next build",
Expand Down
21 changes: 21 additions & 0 deletions apps/client/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { QueryClientProvider } from "@tanstack/react-query";
import { type AppProps } from "next/app";
import dynamic from "next/dynamic";
import Head from "next/head";
import Script from "next/script";
import { SessionProvider } from "next-auth/react";

import { PageLoadingIndicator } from "@app/components/general/loading-indicator/full-page";
Expand Down Expand Up @@ -68,6 +69,26 @@ export default function App({
) : null}
</SidebarProvider>
</QueryClientProvider>
{process.env.NODE_ENV !== "development" ? (
<>
<Script
async
src="https://www.googletagmanager.com/gtag/js?id=G-02198VT7VC"
/>
<Script
id="google-analytics"
strategy="afterInteractive"
>
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-02198VT7VC');
`}
</Script>
</>
) : null}
</SessionProvider>
</>
);
Expand Down

0 comments on commit e4bb1a0

Please sign in to comment.