Skip to content

Commit

Permalink
feat: add analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
jonyw4 committed Nov 24, 2021
1 parent 167225c commit 35f24eb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 22 deletions.
37 changes: 15 additions & 22 deletions webapp/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import "normalize.css";
import "../components/global/styles/global.css";

import Head from "next/head";
import Script from "next/script";
import { UIProvider } from "../components/global";
import { useRouter } from "next/router";
import type { AppProps } from "next/app";
Expand All @@ -21,26 +20,20 @@ export default function MyApp({ Component, pageProps }: AppProps) {

return (
<UIProvider themeData={themeData} locale={{ locale, changeLocale }}>
<Head>
<link
rel="apple-touch-icon"
sizes="180x180"
href="/favicon/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/favicon/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/favicon/favicon-16x16.png"
/>
<link rel="manifest" href="/site.webmanifest" />
</Head>
<Script
async
src="https://www.googletagmanager.com/gtag/js?id=G-3S37WC9HP3"
strategy="afterInteractive"
/>
<Script id="google-analytics" strategy="afterInteractive">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-3S37WC9HP3');
`}
</Script>
<Component {...pageProps} />
</UIProvider>
);
Expand Down
18 changes: 18 additions & 0 deletions webapp/src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ class MyDocument extends Document {
return (
<Html>
<Head>
<link
rel="apple-touch-icon"
sizes="180x180"
href="/favicon/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/favicon/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/favicon/favicon-16x16.png"
/>
<link rel="manifest" href="/favicon/site.webmanifest" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
Expand Down

1 comment on commit 35f24eb

@vercel
Copy link

@vercel vercel bot commented on 35f24eb Nov 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.