Skip to content

feat(docs): Add Google Analytics tracking to VitePress documentation#216

Merged
polaz merged 1 commit intomainfrom
feat/#214-featdocs-add-google-analytics-tracking-to-vitepres
Jan 25, 2026
Merged

feat(docs): Add Google Analytics tracking to VitePress documentation#216
polaz merged 1 commit intomainfrom
feat/#214-featdocs-add-google-analytics-tracking-to-vitepres

Conversation

@polaz
Copy link
Copy Markdown
Member

@polaz polaz commented Jan 25, 2026

Summary

  • Add Google Analytics 4 tracking to VitePress documentation using vitepress-plugin-google-analytics
  • Support VITE_GA_ID environment variable override (default: G-RY1XJ7LR5F)

Implementation

Used Option 1 (Plugin) from the issue as recommended — cleaner code and proper SPA navigation handling.

Test plan

  • yarn lint passes
  • yarn test passes (132 suites, 4178 tests)
  • Verify GA tracking in deployed docs via browser DevTools Network tab

Closes #214

- Integrate vitepress-plugin-google-analytics for clean SPA navigation handling
- Support VITE_GA_ID env var override, default to G-RY1XJ7LR5F

Closes #214
Copilot AI review requested due to automatic review settings January 25, 2026 15:25
@github-actions
Copy link
Copy Markdown

Test Coverage Report

Overall Coverage: 94.44%

Metric Percentage
Statements 93.89%
Branches 85.51%
Functions 84.55%
Lines 94.44%

View detailed coverage report

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Google Analytics 4 tracking to the VitePress documentation site using the recommended vitepress-plugin-google-analytics plugin. The implementation supports environment variable override via VITE_GA_ID with a sensible default tracking ID.

Changes:

  • Added vitepress-plugin-google-analytics dependency
  • Integrated Google Analytics plugin in VitePress theme with configurable tracking ID

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
package.json Added vitepress-plugin-google-analytics as dev dependency
yarn.lock Updated lockfile with new plugin dependency
docs/.vitepress/theme/index.ts Integrated Google Analytics plugin in theme's enhanceApp hook with environment variable support

@polaz polaz merged commit 675ea12 into main Jan 25, 2026
22 checks passed
@polaz polaz deleted the feat/#214-featdocs-add-google-analytics-tracking-to-vitepres branch January 25, 2026 15:32
sw-release-bot bot pushed a commit that referenced this pull request Jan 25, 2026
## [6.47.0](v6.46.1...v6.47.0) (2026-01-25)

### Features

* **docs:** add Google Analytics tracking to VitePress documentation ([#216](#216)) ([675ea12](675ea12)), closes [#214](#214)
@sw-release-bot
Copy link
Copy Markdown

🎉 This PR is included in version 6.47.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(docs): Add Google Analytics tracking to VitePress documentation

2 participants