Skip to content

Commit 5600907

Browse files
committed
Fix Google Analytics placement in layout
Move GoogleAnalytics component from <head> to <body> for proper Next.js Script component rendering with afterInteractive strategy.
1 parent 3bd79d5 commit 5600907

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

app/layout.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,10 @@ export default function RootLayout({
8080
}>) {
8181
return (
8282
<html lang="en" suppressHydrationWarning>
83-
<head>
84-
<GoogleAnalytics />
85-
</head>
8683
<body
8784
className={`${geistSans.variable} ${geistMono.variable} antialiased min-h-screen flex flex-col`}
8885
>
86+
<GoogleAnalytics />
8987
<Navigation />
9088
<main className="flex-1">{children}</main>
9189
<Footer />

0 commit comments

Comments
 (0)