From 1e9ae4c04ca85d8b681c7792525701a2fd80d932 Mon Sep 17 00:00:00 2001 From: PavelMakarchuk Date: Thu, 29 Oct 2026 11:35:50 -0400 Subject: [PATCH] Track page views with policyengine.org's Google Analytics Load the GA4 tag (G-2YHG89FY0N) in the root layout in production builds, so policyengine.org/uk/bus-fare-cap sends page views. Page views only; no custom events. Co-Authored-By: Claude Opus 5.5 --- dashboard/app/layout.jsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dashboard/app/layout.jsx b/dashboard/app/layout.jsx index 2cf406f..cc5860d 100644 --- a/dashboard/app/layout.jsx +++ b/dashboard/app/layout.jsx @@ -2,6 +2,7 @@ import PolicyEngineFooter from "../src/components/PolicyEngineFooter"; import PolicyEngineHeader from "../src/components/PolicyEngineHeader"; import "./globals.css"; +import Script from "next/script"; export const metadata = { title: "£2 bus fare cap analysis | PolicyEngine", @@ -16,6 +17,21 @@ export default function RootLayout({ children }) { {children} + {/* Google Analytics: policyengine.org's GA4 property; this app is served at policyengine.org/uk/bus-fare-cap through a rewrite, where the main site's GA does not reach. */} + {process.env.NODE_ENV === "production" && ( + <> + + + )} );