Skip to content

feat(analytics): enable Google Analytics 4 via docs.json integrations.ga4 - #2267

Draft
GigaHierz wants to merge 1 commit into
mainfrom
GigaHierz/2249-ga4-analytics
Draft

feat(analytics): enable Google Analytics 4 via docs.json integrations.ga4#2267
GigaHierz wants to merge 1 commit into
mainfrom
GigaHierz/2249-ga4-analytics

Conversation

@GigaHierz

Copy link
Copy Markdown
Contributor

The hole, and the fix

docs.json had no analytics configuration at all ("integrations" in docs.json → false at bdf40b37; grep for ga4|gtm|googleAnalytics|posthog|amplitude|mixpanel|segment|plausible|fathom → 0 hits), so page analytics were lost when the Mintlify plan changed. This adds Mintlify's documented GA4 block:

"integrations": { "ga4": { "measurementId": "G-0CXEKQ81V2" } }

The measurement ID is not new: G-0CXEKQ81V2 was the docs' GA4 property in docusaurus.config.js from 2021-09-21 (c931a1bf) until the Docusaurus removal on 2025-09-17 (b555aecb). Reusing it keeps the historical series in one property instead of starting a new one. (An older ID G-W2H8BZBELD existed for one month in 2021-08 and was replaced; not used here.)

What this does NOT do / residual risk

  • Does not create a GA account or verify who currently administers property G-0CXEKQ81V2. If nobody on the team can access it any more, this ships events into a property we can't read — the ops box below is the check.
  • Does not add GTM, consent banners or dashboards.
  • No change to content or navigation: 5-line insertion, 0 deletions.

Judgement calls

  • Reuse the historical property instead of creating a new one (the issue said "create a GA4 property"). Reasoning: continuity with 4 years of data; zero-cost to reverse — one-line ID swap if the team prefers a fresh property.

Issues

Refs #2249 — closes the code box (integrations.ga4.measurementId added). Still open: GA account ownership confirmed/shared with the DevRel team; Realtime verification after deploy; owner recorded.

Stacking / conflicts

Branched off main, independent of my other open PRs. Touches docs.json top-level only (lines 10–15); no overlap with navigation edits.

Verification evidence

$ python3 -c "import json;d=json.load(open('docs.json'));print(d['integrations'])"
{'ga4': {'measurementId': 'G-0CXEKQ81V2'}}
$ git diff --stat
 docs.json | 5 +++++
$ git log --all -S'G-0CXEKQ81V2' --format='%h %as %s' -- docusaurus.config.js
b555aecb 2025-09-17 remove: removed docusaurus (#2040)
c931a1bf 2021-09-21 Add Google Analytics (#121)

mint broken-links output is pasted in the first comment (run on this head). There is no test seam for a config key in a static-docs repo; mutation testing does not apply — the real check is GA4 Realtime after the preview/production deploy.

Remaining ops steps

  • Confirm a team member can open GA4 property G-0CXEKQ81V2 (Admin → Property details) and share access with the DevRel team; if access is lost, create a new property and swap the ID
  • After deploy, open GA4 Realtime and confirm hits from docs.celo.org
  • Record the account owner in task: Add Google Analytics (GA4) to docs.json #2249

Checklist

  • Title is the commit message I want on main
  • docs.json parses; mint broken-links run on this head
  • Judgement calls flagged above
  • No secrets in the diff (a GA measurement ID is public by design — it ships in page HTML)
  • Questions for the maintainer: do we still own G-0CXEKQ81V2? If not, say so and I'll swap in the new ID.

….ga4

Refs #2249

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@GigaHierz

GigaHierz commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

mint broken-links on this head (5d09092), run in a clean detached worktree:

success no broken links found

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