Created
July 18, 2024 15:16
-
-
Save jimkeller/b67a36bf979e281b513d218c4ddef025 to your computer and use it in GitHub Desktop.
Next.js Google Analytics module multiple streams bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { GoogleAnalytics } from '@next/third-parties/google'; | |
export default async function RootLayout({ | |
children, | |
params, | |
}) { | |
return ( | |
<html lang='en'> | |
<body> | |
{children} | |
</body> | |
{/* The first included stream works as expected */} | |
<GoogleAnalytics gaId="G-1234567" /> | |
{/* The gtag/js script will be added for this stream, but gtag('config') is not called */} | |
<GoogleAnalytics gaId="G-8910112" /> | |
</html> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment