Skip to content

[AAASM-3552] 📈 (docs): Wire GA4 analytics into the Docusaurus site#177

Merged
Chisanan232 merged 1 commit into
masterfrom
v0.0.1/AAASM-3552/docusaurus_ga4
Jun 22, 2026
Merged

[AAASM-3552] 📈 (docs): Wire GA4 analytics into the Docusaurus site#177
Chisanan232 merged 1 commit into
masterfrom
v0.0.1/AAASM-3552/docusaurus_ga4

Conversation

@Chisanan232

Copy link
Copy Markdown
Contributor

Target

  • Task summary:

    Wire Google Analytics 4 into the Node SDK Docusaurus docs site so we can measure documentation traffic. Uses the gtag support built into @docusaurus/preset-classic (already a dependency), so no new package is added.

  • Task tickets:

    • Task ID: AAASM-3552.
    • Relative task IDs:
      • N/A.
    • Relative PRs:
      • N/A.
  • Key point change (optional):

    Added a gtag block to the classic preset options in website/docusaurus.config.ts:

    gtag: {
      trackingID: "G-6FHQKGLDE4",
      anonymizeIP: true,
    },
    • Measurement ID G-6FHQKGLDE4 is public (it ships in client-side HTML by design), so committing it directly is safe.
    • anonymizeIP: true truncates the visitor IP before it reaches Google.
    • Cookie consent — recommended fast-follow: gtag sets analytics cookies. There is no consent banner on the site today, so as a follow-up we should add a cookie-consent banner before (or gating) GA initialization to satisfy GDPR/ePrivacy expectations.

Effecting Scope

  • Action Types:
    • ✨ Adding new something
      • 🟢 No breaking change
    • 🟠 Has breaking change
  • Scopes:
    • 📚 Documentation
    • 📦 Project configurations
  • Additional description:
    Docs-site config only. No SDK runtime, API, or type changes.

Description

  • Added a gtag block (trackingID: G-6FHQKGLDE4, anonymizeIP: true) to the preset-classic options in website/docusaurus.config.ts.
  • Verified pnpm build succeeds (installed via pnpm install --ignore-workspace per the documented docs-build path) and that G-6FHQKGLDE4 (the gtag/js?id=... loader) is emitted into every page under website/build/.

Closes AAASM-3552.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

Copy link
Copy Markdown

@Chisanan232

Copy link
Copy Markdown
Contributor Author

Claude Code — review result

CI green — full suite passes (17 checks: build, coverage, module-smoke, test 18/20/22/24 ubuntu, CodeQL, SonarCloud). No fails to ignore.

Scope vs AAASM-3552 (node-sdk site) — covered. Wires GA4 G-6FHQKGLDE4 via the classic-preset gtag option (@docusaurus/preset-classic, already a dependency) with anonymizeIP: trueno new dependency, no lockfile change. One small commit. Verified pnpm build succeeds and the gtag/js?id=G-6FHQKGLDE4 loader is emitted site-wide. ID is public (committed correctly).

Ready for approval + merge. Note: gtag sets cookies and there's no consent UI on this site yet — a cookie-consent banner is correctly flagged as a fast-follow.

@Chisanan232 Chisanan232 merged commit fc74066 into master Jun 22, 2026
17 checks passed
@Chisanan232 Chisanan232 deleted the v0.0.1/AAASM-3552/docusaurus_ga4 branch June 22, 2026 14:21
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