Skip to content

Commit

Permalink
Add analytics tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
andychase committed Sep 26, 2024
1 parent 30cb4fa commit 2ba2462
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DocumentProps, Head, Html, Main, NextScript } from 'next/document';
import Script from 'next/script';

import i18nextConfig from '../next-i18next.config';

Expand All @@ -14,8 +15,26 @@ export default function Document(props: Props) {
<Head>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-title" content="Gov Chat"></meta>
<Script
id="google-tag-manager"
dangerouslySetInnerHTML={{
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-W55ZK7');`,
}}
/>
</Head>
<body>
<noscript>
<iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-W55ZK7"
height="0"
width="0"
style={{ display: 'none', visibility: 'hidden' }}
></iframe>
</noscript>
<Main />
<NextScript />
</body>
Expand Down

0 comments on commit 2ba2462

Please sign in to comment.