Skip to content

Decide on GA4 tracking before policyengine.org/macro goes live #296

Backlog

Description

@MaxGhenis

PolicyEngine Macro carries no Google Analytics tag. Once www.policyengine.org serves it at /macro (#295 and PolicyEngine/policyengine-app-v2#1616), that conflicts with the website's tracking rule. Someone needs to decide before PolicyEngine/policyengine-app-v2#1616 merges.

What the website expects

The website's multizone-tracking-audit (.github/scripts/audit-multizone-tracking.mjs in policyengine-app-v2) fails any zone whose pages lack the GA4 bootstrap: gtag.js plus config('G-2YHG89FY0N'). Its message says that without it, page_view and tool_engaged events drop and Google Ads stops reporting conversions for keywords that land there.

That audit reads only website/next.config.ts. It never sees entries in website/src/data/appZoneRoutes.ts, where #1616 adds /macro, so it won't flag the gap itself.

What stands in the way

This site's Content-Security-Policy (vercel.json) sets script-src 'self' 'unsafe-inline' and connect-src 'self'. Those directives would block gtag.js from www.googletagmanager.com and its beacons to Google Analytics. Adding the tag means widening both directives as well as adding the snippet to every page, most simply through site_nav.py, which stamps all 71.

The decision

Either:

  • add the GA4 bootstrap and widen the CSP to allow it; or
  • agree an exception with the website maintainers and record it in the website's repository guidance.

This came out of the independent review of #295 (round 2).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions