From 8af8509e524e9875ff1e686d7fa1cc8c4cbd3dec Mon Sep 17 00:00:00 2001 From: Soft Nation Date: Mon, 27 Apr 2026 11:05:12 +0000 Subject: [PATCH] perf: use next/script lazyOnload for non-blocking analytics (#179) --- src/app/layout.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index cdf77b91..d6611adb 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,6 +1,7 @@ import type { Metadata } from 'next'; import { cookies } from 'next/headers'; import { Geist, Geist_Mono } from 'next/font/google'; +import Script from 'next/script'; import './globals.css'; import { RootProviders } from '@/providers/RootProviders'; @@ -58,6 +59,24 @@ export default async function RootLayout({ {children} + + {/* Non-essential analytics — loaded after page is interactive */} + {process.env.NEXT_PUBLIC_ANALYTICS_ID && ( + + )} );