AnalyticsGoogle Analytics
Analytics

Google Analytics

Track page views and events on your documentation site with Google Analytics 4.

Google Analytics 4 (GA4) tracks page views, user engagement, and custom events across your documentation site. Enable the integration to start collecting data with your existing GA4 property.

Prerequisites

  • A Google Analytics account with a GA4 property

  • Your GA4 measurement ID (starts with G-)

  • Publishing access to your documentation project

Configure from the Editor

Open Site Config

In the Editor, click Site Config in the top toolbar.

Navigate to Integrations

Select Integrations from the left sidebar.

Enable Google Analytics

Select Google Analytics and enter your GA4 measurement ID.

Publish

Click Publish to deploy the integration to your live site.

Configure via documentation.json

Add the ga key under integrations in your documentation.json:

{
  "integrations": {
    "ga": {
      "measurementId": "G-XXXXXXXXXX"
    }
  }
}
PropertyTypeRequiredDescription
measurementIdstringYesYour GA4 measurement ID (for example, G-XXXXXXXXXX)

Where to find your measurement ID

  1. Sign in to Google Analytics.

  2. Go to AdminData Streams → select your web stream.

  3. Copy the measurement ID displayed at the top (format: G-XXXXXXXXXX).

What's next