feat: add Google Analytics (gtag.js) to layout head
This commit is contained in:
@@ -50,6 +50,20 @@ export default async function RootLayout({
|
|||||||
lang="tr"
|
lang="tr"
|
||||||
className={`${sans.variable} ${geistMono.variable} h-full antialiased`}
|
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)]">
|
<body className="min-h-full flex flex-col bg-white text-[var(--foreground)]">
|
||||||
<ConsentInit gtmId={gtmId} />
|
<ConsentInit gtmId={gtmId} />
|
||||||
{children}
|
{children}
|
||||||
@@ -58,3 +72,4 @@ export default async function RootLayout({
|
|||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user