Skip to content

Commit e02b350

Browse files
committed
Add Google analytics
1 parent 9e630bb commit e02b350

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

app/layout.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { RootProvider } from 'fumadocs-ui/provider/next';
22
import './global.css';
33
import { Inter } from 'next/font/google';
4+
import Script from 'next/script';
45

56
const inter = Inter({
67
subsets: ['latin'],
@@ -10,6 +11,18 @@ export default function Layout({ children }: LayoutProps<'/'>) {
1011
return (
1112
<html lang="en" className={inter.className} suppressHydrationWarning>
1213
<body className="flex flex-col min-h-screen">
14+
<Script
15+
src="https://www.googletagmanager.com/gtag/js?id=G-JV0T1EB3R7"
16+
strategy="afterInteractive"
17+
/>
18+
<Script id="google-analytics" strategy="afterInteractive">
19+
{`
20+
window.dataLayer = window.dataLayer || [];
21+
function gtag(){dataLayer.push(arguments);}
22+
gtag('js', new Date());
23+
gtag('config', 'G-JV0T1EB3R7');
24+
`}
25+
</Script>
1326
<RootProvider>{children}</RootProvider>
1427
</body>
1528
</html>

0 commit comments

Comments
 (0)