Skip to content

Track page views with policyengine.org's Google Analytics - #13

Merged
PavelMakarchuk merged 1 commit into
mainfrom
ga-page-views
Oct 29, 2026
Merged

PavelMakarchuk merged 1 commit into
mainfrom
ga-page-views

Conversation

@PavelMakarchuk

Copy link
Copy Markdown
Contributor

Why

The page at policyengine.org/uk/bus-fare-cap sends no page views. policyengine.org serves this app through a rewrite, and the main site's Google Analytics does not reach an app served that way.

What changed

  • dashboard/app/layout.jsx: load policyengine.org's GA4 property (G-2YHG89FY0N) with next/script (afterInteractive), the same snippet as policyengine-app-v2 website/src/app/layout.tsx.
  • The tag loads only when NODE_ENV === 'production'. It sends page views only: no custom events, no user inputs or results.

How I tested

  • bun install and bun run build: the build passes.
  • The production build output (dashboard/.next) contains G-2YHG89FY0N.
  • The dashboard has no JS test suite.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
bus-fare-cap Ready Ready Preview Oct 29, 2026 3:36pm UTC

@PavelMakarchuk
PavelMakarchuk merged commit d900261 into main Oct 29, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview – bus-fare-cap — 1e9ae4c0 Deployed Oct 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant