From b5a63e82d418c2fb6815a24892066c6f5730b781 Mon Sep 17 00:00:00 2001 From: Tudor Date: Fri, 3 Jul 2026 13:24:14 +0100 Subject: [PATCH] fix(analytics): restrict Umami to production hostnames The same frontend image runs on staging and prod (build once, promote), so a build-time env var can't tell them apart. Umami's data-domains attribute scopes the tracker client-side: events only fire when location.hostname is a production domain, so staging traffic and the E2E journeys never pollute the dashboards. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01PqGhF93UrpDNvXBLMjJENL --- nextjs-app/app/layout.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nextjs-app/app/layout.tsx b/nextjs-app/app/layout.tsx index 0ee5b9b..82e7c55 100644 --- a/nextjs-app/app/layout.tsx +++ b/nextjs-app/app/layout.tsx @@ -76,9 +76,12 @@ export default function RootLayout({ + {/* data-domains: the tracker only fires on the production hostnames, + so staging (same image, different host) never pollutes Umami */}