Skip to content

Commit

Permalink
Google analytics package integration (#99)
Browse files Browse the repository at this point in the history
* [GIT SETUP] Tests pre push hook, disallowing direct push to develop
Problem
Solution
Note

* [GIT SETUP] Adds pre commit script
Problem
Solution
Note

* [GIT SETUP] Finalises pre commit hook script
Problem
Solution
Note

* [GIT SETUP] Changes git hook to pre push instead of pre commit
Problem
Solution
Note

* [GIT SETUP] Updates pre-push script comments
Problem
Solution
Note

* [GIT SETUP] Updates readme with git hook setup instructions
Problem
Solution
Note

* HOTFIX - Add Google Analytics (#97)

Co-authored-by: marcaufderheyde <[email protected]>

* HOTFIX - use google analytics package (#98)

Co-authored-by: marcaufderheyde <[email protected]>

---------

Co-authored-by: Hector Jones <[email protected]>
Co-authored-by: marcaufderheyde <[email protected]>
  • Loading branch information
3 people authored Jul 19, 2024
1 parent 1efc5dd commit 35aec57
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 121 deletions.
29 changes: 5 additions & 24 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { Inter } from 'next/font/google';
import 'leaflet/dist/leaflet.css';
import 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.webpack.css';
import './globals.css';
import Script from 'next/script';
import { GoogleAnalytics } from '@next/third-parties/google';
import { GoogleTagManager } from '@next/third-parties/google';


const inter = Inter({ subsets: ['latin'] });

Expand All @@ -24,29 +26,8 @@ export default function RootLayout({
}>) {
return (
<html lang={locale}>
<head>
<Script id="gtm-script" strategy="afterInteractive">
{`
(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-PBKDVXT9');
`}
</Script>
</head>
<body className={inter.className}>
{/* Google Tag Manager (noscript) */}
<noscript>
<iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-PBKDVXT9"
height="0"
width="0"
style={{ display: 'none', visibility: 'hidden' }}
></iframe>
</noscript>
{children}
</body>
<body className={inter.className}>{children}</body>
<GoogleTagManager gtmId="GTM-PBKDVXT9" /> // METRIC ID
</html>
);
}
Loading

0 comments on commit 35aec57

Please sign in to comment.