Skip to content

Commit

Permalink
Google Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
PetterVargas committed Mar 31, 2024
1 parent 39e7aa0 commit 85de60f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import './globals.css'
import Script from 'next/script'

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

Expand All @@ -17,7 +18,19 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<body className={inter.className}>
{children}
<Script async src="https://www.googletagmanager.com/gtag/js?id=G-7BDQGCNNJF"></Script>
<Script id="google-analytics">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-7BDQGCNNJF');
`}
</Script>
</body>
</html>
)
}

0 comments on commit 85de60f

Please sign in to comment.