Problem
client/package.json depends on react-ga v3.3.1, the client library for Google's legacy Universal Analytics (UA-XXXXXXX-X tracking IDs). Google fully shut off standard Universal Analytics data processing in July 2023.
Any Google Analytics property created or migrated since then only issues GA4 Measurement IDs (G-XXXXXXXXXX), which react-ga cannot use. ReactGA.initialize(TRACKING_ID) (called in client/src/index.js and client/src/App.js) will silently no-op or error with a GA4 ID, meaning analytics reporting is effectively non-functional regardless of what value is configured in the VITE_GA_TRACKING_ID env var / GA_TRACKING GitHub secret.
Fix
Migrate from react-ga to react-ga4 (or load the gtag.js snippet directly), updating the two call sites:
client/src/index.js
client/src/App.js
Context
Found while auditing PR #1389 (dev container / Vite migration). Separately, the GA_TRACKING GitHub secret needs updating from the old REACT_APP_GA_TRACKING_ID=... naming to VITE_GA_TRACKING_ID=... (Vite only exposes VITE_-prefixed env vars) — but that rename alone won't restore working analytics without this library migration too.
Problem
client/package.jsondepends onreact-gav3.3.1, the client library for Google's legacy Universal Analytics (UA-XXXXXXX-Xtracking IDs). Google fully shut off standard Universal Analytics data processing in July 2023.Any Google Analytics property created or migrated since then only issues GA4 Measurement IDs (
G-XXXXXXXXXX), whichreact-gacannot use.ReactGA.initialize(TRACKING_ID)(called inclient/src/index.jsandclient/src/App.js) will silently no-op or error with a GA4 ID, meaning analytics reporting is effectively non-functional regardless of what value is configured in theVITE_GA_TRACKING_IDenv var /GA_TRACKINGGitHub secret.Fix
Migrate from
react-gatoreact-ga4(or load thegtag.jssnippet directly), updating the two call sites:client/src/index.jsclient/src/App.jsContext
Found while auditing PR #1389 (dev container / Vite migration). Separately, the
GA_TRACKINGGitHub secret needs updating from the oldREACT_APP_GA_TRACKING_ID=...naming toVITE_GA_TRACKING_ID=...(Vite only exposesVITE_-prefixed env vars) — but that rename alone won't restore working analytics without this library migration too.