Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions dashboard/app/layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -16,6 +17,21 @@ export default function RootLayout({ children }) {
<PolicyEngineHeader />
{children}
<PolicyEngineFooter />
{/* 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" && (
<>
<Script
src="https://www.googletagmanager.com/gtag/js?id=G-2YHG89FY0N"
strategy="afterInteractive"
/>
<Script id="google-analytics" strategy="afterInteractive">
{`window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-2YHG89FY0N');`}
</Script>
</>
)}
</body>
</html>
);
Expand Down
Loading