Next.js Discord

Discord Forum

Cookie “_ga” has been rejected for invalid domain.

Unanswered
Bonga shad posted this in #help-forum
Open in Discord
Bonga shadOP
My portfolio website in build in Nextjs 14 ( app router ) and I has integrated Google Analytics in the it, using @next/third-parties/google i n layout.tsx . The code

// other imports 
import { GoogleAnalytics } from "@next/third-parties/google";

export default function RootLayout({ children }: Props) {
    return (
        <html
            lang="en"
            className={cn(interFont.variable, "dark")}
            suppressHydrationWarning
        >
            <body className={sourceFont.className} suppressHydrationWarning>
                <BlogProvider>
                    <Suspense fallback={null}>
                        <Header />
                    </Suspense>
                    {children}
                    <Footer />

                    <ScrollToTop />
                    {process.env.NODE_ENV === "development" && (
                        <TailwindIndicator />
                    )}

                    <Toaster />

                    {process.env.NODE_ENV === "production" && (
                        <Suspense fallback={null}>
                            <GoogleAnalytics
                                gaId={env.googleAnalyticsMeasurementId}
                            />
                        </Suspense>
                    )}
                </BlogProvider>
            </body>
        </html>
    );
}



How do I solve this

0 Replies