Skip to content

Commit 8000418

Browse files
committed
add google analytics scripts
1 parent 412c520 commit 8000418

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

app/layout.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ThemeProvider } from "@/components/theme-provider";
55
import { Analytics } from "@vercel/analytics/next";
66
import { SITE_URL } from "@/lib/constants";
77
import { FestiveModal } from "@/components/FestiveModal";
8+
import Script from "next/script";
89

910
const geistSans = Geist({
1011
variable: "--font-geist-sans",
@@ -69,6 +70,19 @@ export default function RootLayout({
6970
<body
7071
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
7172
>
73+
{/* ✅ Google Analytics script */}
74+
<Script
75+
src="https://www.googletagmanager.com/gtag/js?id=G-MRZ0D7MXZD"
76+
strategy="afterInteractive"
77+
/>
78+
<Script id="google-analytics" strategy="afterInteractive">
79+
{`
80+
window.dataLayer = window.dataLayer || [];
81+
function gtag(){dataLayer.push(arguments);}
82+
gtag('js', new Date());
83+
gtag('config', 'G-MRZ0D7MXZD');
84+
`}
85+
</Script>
7286
<ThemeProvider
7387
attribute="class"
7488
defaultTheme="dark"

0 commit comments

Comments
 (0)