Skip to content

Commit fdb5bae

Browse files
committed
Add Google Analytics tracking
- Add gtag.js script to layout.tsx - Configure Google Analytics with tracking ID G-37FQN2MXTQ - Track page views and user interactions across the app
1 parent 28ab3b0 commit fdb5bae

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

app/layout.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,21 @@ export default function RootLayout({
183183
return (
184184
<html lang="en">
185185
<head>
186+
{/* Google Analytics */}
187+
<script
188+
async
189+
src="https://www.googletagmanager.com/gtag/js?id=G-37FQN2MXTQ"
190+
/>
191+
<script
192+
dangerouslySetInnerHTML={{
193+
__html: `
194+
window.dataLayer = window.dataLayer || [];
195+
function gtag(){dataLayer.push(arguments);}
196+
gtag('js', new Date());
197+
gtag('config', 'G-37FQN2MXTQ');
198+
`,
199+
}}
200+
/>
186201
<link rel="preconnect" href="https://fonts.googleapis.com" />
187202
<link
188203
rel="preconnect"

0 commit comments

Comments
 (0)