From a06a93019fe66fbb38928fbb8c1ba7349d0782f8 Mon Sep 17 00:00:00 2001 From: andwati Date: Wed, 30 Sep 2026 14:19:13 +0300 Subject: [PATCH] Only load analytics in production --- src/app/layout.tsx | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index f481847..9c29b3f 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -58,6 +58,7 @@ const websiteLd = { author: { "@type": "Person", name: site.name }, }; +const isProd = process.env.NODE_ENV === "production"; const gaId = "G-9XLTKZF07C"; const umamiScript = process.env.PUBLIC_UMAMI_SCRIPT_URL; @@ -83,17 +84,21 @@ export default function RootLayout({ children }: LayoutProps<"/">) { {children} - - {umamiScript && umamiId && ( + {isProd && ( + <> + + + )} + {isProd && umamiScript && umamiId && (