Jamdesk Documentation logo

Google Analytics Integration

Add Google Analytics 4 to your documentation site with a measurement ID to track visitors and see which content they read.

Add Google Analytics 4 to your documentation site to see how readers use your content.

The integration takes GA4 (Google Analytics 4) measurement IDs that start with G-.

Getting Your Measurement ID

  1. Go to Google Analytics
  2. Select your property (or create one)
  3. Go to Admin → Data Streams
  4. Select your web stream (or create one)
  5. Copy the Measurement ID (starts with G-)

Adding GA4 to Your Docs

Add the measurement ID to your docs.json:

docs.json
{
  "name": "My Docs",
  "integrations": {
    "ga4": {
      "measurementId": "G-XXXXXXXXXX"
    }
  }
}

Replace G-XXXXXXXXXX with your measurement ID.

Viewing Your Data

Check that data arrives:

  1. Trigger a rebuild of your docs
  2. Visit your live documentation site
  3. In Google Analytics, go to Reports → Real-time
  4. Your visit appears within 30 seconds

It can take 24-48 hours for data to appear in standard reports. Use Real-time reports for immediate verification.

Using with Google Tag Manager

If you already use Google Tag Manager, configure GA4 through GTM instead of adding it directly. See Google Tag Manager Integration for details.

Set up cookie consent banners yourself for any tags you load through Google Tag Manager. Jamdesk loads your GTM container for all visitors without a consent gate. See Cookie Consent to gate analytics until visitors opt in.

Don't add the same GA4 property directly in docs.json and through Google Tag Manager. That causes duplicate tracking.

Privacy Considerations

Google Analytics collects visitor data. Consider:

  • Adding a cookie consent banner if GDPR/CCPA applies. Jamdesk loads GA4 for every visitor by default. Cookie Consent gates it until they opt in.
  • Updating your privacy policy to mention analytics
  • Using IP anonymization if needed

Troubleshooting

  1. Verify your measurement ID: it must start with G-
  2. Check for ad blockers: they may block analytics scripts
  3. Wait for rebuild: changes require a new build to take effect
  4. Use Real-time reports: standard reports have a 24-48 hour delay

The ID must:

  • Start with G-
  • Contain only letters and numbers after G-
  • Be copied exactly from Google Analytics (no extra spaces)
Google Tag Manager

Load GA4 and other tags through GTM

Plausible Analytics

Privacy-focused alternative to GA4

Project Analytics

View built-in Jamdesk analytics