feat: add Google Analytics (gtag.js) to layout head

This commit is contained in:
Emre Emir
2026-07-05 18:51:52 +03:00
parent 51d97a5337
commit 5c35a75c46
+15
View File
@@ -50,6 +50,20 @@ export default async function RootLayout({
lang="tr"
className={`${sans.variable} ${geistMono.variable} h-full antialiased`}
>
<head>
{/* Google tag (gtag.js) */}
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WS38QJS8CB" />
<script
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-WS38QJS8CB');
`,
}}
/>
</head>
<body className="min-h-full flex flex-col bg-white text-[var(--foreground)]">
<ConsentInit gtmId={gtmId} />
{children}
@@ -58,3 +72,4 @@ export default async function RootLayout({
</html>
);
}