Skip to content

Integrate Google Analytics Tracking #17

@bhouston

Description

@bhouston

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.ts using 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions