File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 11import { type Metadata } from 'next'
2+ import Script from 'next/script'
23
34import '@/styles/tailwind.css'
45
@@ -10,8 +11,28 @@ export const metadata: Metadata = {
1011}
1112
1213export default function Layout ( { children } : { children : React . ReactNode } ) {
14+ const gaId = 'G-FN7FNMGXNM'
15+
1316 return (
1417 < html lang = "en" className = "h-full bg-sky-900 text-base antialiased" >
18+ < head >
19+ { gaId && (
20+ < >
21+ < Script
22+ src = { `https://www.googletagmanager.com/gtag/js?id=${ gaId } ` }
23+ strategy = "afterInteractive"
24+ />
25+ < Script id = "google-analytics" strategy = "afterInteractive" >
26+ { `
27+ window.dataLayer = window.dataLayer || [];
28+ function gtag(){window.dataLayer.push(arguments);}
29+ gtag('js', new Date());
30+ gtag('config', '${ gaId } ');
31+ ` }
32+ </ Script >
33+ </ >
34+ ) }
35+ </ head >
1536 < body className = "flex min-h-full flex-col" > { children } </ body >
1637 </ html >
1738 )
You can’t perform that action at this time.
0 commit comments