-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Integrate Google Analytics Tracking
Description
We need to integrate Google Analytics into our Docusaurus site to track user interactions and page views.
Tracking Code
- Google Analytics Measurement ID:
G-4G4NJBHVNF
Implementation Tasks
- Configure Google Analytics in
docusaurus.config.tsusing the provided tracking ID - Ensure tracking only happens in production environments
- Test that analytics events are being properly sent
Implementation Details
Docusaurus has built-in support for Google Analytics via the @docusaurus/preset-classic that's already in use. The integration requires adding the gtag configuration to the themeConfig section:
themeConfig: {
// ... existing config
gtag: {
trackingID: 'G-4G4NJBHVNF',
anonymizeIP: true, // Optional: comply with GDPR
},
}Additional Considerations
- Consider adding a cookie consent banner if the site will be accessed by users from regions with strict privacy laws (like EU/GDPR)
- Ensure that analytics are only loaded in production environments
Metadata
Metadata
Assignees
Labels
No labels