Conversation
…d links - Add GA4EventTracker Vue component for consent-aware event tracking - Track VitePress search queries (debounced) as GA4 search events - Track .mcpb file downloads as GA4 file_download events - Track external link clicks as GA4 outbound click events - Upgrade vue-privacy from ^1.2.3 to ^1.6.1 - Update @modelcontextprotocol/sdk from ^1.25.3 to ^1.26.0 - Update picomatch from ^4.0.0 to ^4.0.3 - Update undici from ^7.19.2 to ^7.20.0 - Update @cloudflare/workers-types from ^4.20260131.0 to ^4.20260203.0 - Update @types/node from ^24.10.9 to ^24.10.10 All tracking respects user consent - events silently dropped when analytics consent is denied. Closes #282
Test Coverage ReportOverall Coverage: 95.58%
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR adds GA4 event tracking capabilities to the VitePress documentation site and updates several dependencies. The implementation respects user consent through the vue-privacy library.
Changes:
- Implements GA4 event tracking for search queries, file downloads (.mcpb files), and outbound link clicks
- Upgrades vue-privacy from v1.2.3 to v1.6.1 to support enhanced tracking features
- Updates six other dependencies to their latest versions
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updates dependency versions for vue-privacy, MCP SDK, and other packages |
| yarn.lock | Reflects the updated dependency versions with new checksums and transitive dependencies |
| docs/.vitepress/theme/index.ts | Integrates the new GA4EventTracker component into the VitePress theme layout |
| docs/.vitepress/theme/composables/useGA4Tracking.ts | New composable providing consent-aware GA4 event tracking functions |
| docs/.vitepress/theme/components/GA4EventTracker.vue | New invisible component that hooks into DOM events for tracking |
- Add gtag.d.ts type declaration for window.gtag function
- Fix URL parsing in trackFileDownload to handle relative paths
- Move duplicate search check inside setTimeout callback
- Use pathname.endsWith('.mcpb') instead of includes for downloads
- Use bubbling phase for click handler to reduce capture overhead
- Add JSDoc comments explaining vue-privacy VitePress usage pattern
…mount - Extend gtag type to support 'event', 'config', 'set' commands per GA docs - Make params optional in gtag signature - Reset lastTrackedSearch on component unmount to allow re-tracking
|
🎉 This PR is included in version 6.54.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
GA4 Event Tracking
searchevent withsearch_termparameterfile_downloadevent withfile_name,file_extension,link_urlclickevent withlink_url,link_domain,outbound: trueNew Files
docs/.vitepress/theme/composables/useGA4Tracking.ts- Consent-aware GA4 tracking composabledocs/.vitepress/theme/components/GA4EventTracker.vue- Invisible component that hooks into DOM eventsDependencies Updated
@structured-world/vue-privacy@modelcontextprotocol/sdkpicomatchundici@cloudflare/workers-types@types/nodePrivacy & Consent
All tracking respects user consent - events are silently dropped when analytics consent is denied. Uses the
useConsent()composable from vue-privacy to check consent status before sending any events.Test Plan
yarn lintpassesyarn test(unit tests) passesyarn test:all(unit + integration) passesyarn buildcompletesCloses #282