Skip to main content
Track how users interact with your documentation by connecting to third-party analytics platforms. Mintlify sends engagement events to your configured analytics providers automatically.

How it works

When you add analytics integrations to your documentation site, Mintlify tracks user interactions like page views, search queries, API playground requests, and feedback submissions. You can connect multiple analytics providers by adding your API keys to the docs.json file.

Supported platforms

Mintlify integrates with the following analytics platforms:

Google Analytics 4

Track visitor behavior with GA4 measurement ID

Mixpanel

Product analytics and user behavior tracking

PostHog

Product analytics with session recordings

Amplitude

User behavior and product analytics

Clarity

Microsoft Clarity session recordings and heatmaps

Segment

Customer data platform integration

Plausible

Privacy-focused analytics

Fathom

Privacy-first website analytics

Heap

Automatic event tracking

Hotjar

Heatmaps and user feedback

LogRocket

Session replay and error tracking

Hightouch

Reverse ETL and data activation

Configuration

Add your analytics provider credentials to the integrations object in docs.json. Only include the platforms you want to use.
Analytics integrations only require public API keys, which are accessible to anyone viewing your documentation site. Never include private API keys in your docs.json.

Google Analytics 4

Track visitor behavior with Google Analytics 4.
docs.json
"integrations": {
  "ga4": {
    "measurementId": "G-XXXXXXXXXX"
  }
}
Setup steps:
  1. Create a GA4 property in Google Analytics
  2. Create a web stream with your docs URL
  3. Copy the Measurement ID (format: G-XXXXXXX)
  4. Add it to your docs.json
Google Analytics takes 2-3 days to show data. Preview links have analytics disabled.

Mixpanel

Track product analytics and user behavior.
docs.json
"integrations": {
  "mixpanel": {
    "projectToken": "YOUR_MIXPANEL_PROJECT_TOKEN"
  }
}
Find your project token in Mixpanel project settings.

PostHog

Product analytics with session recordings and feature flags.
docs.json
"integrations": {
  "posthog": {
    "apiKey": "phc_xxxxxxxxxxxxx",
    "apiHost": "https://app.posthog.com",
    "sessionRecording": true
  }
}
apiKey
string
required
Your PostHog project API key (starts with phc_)
apiHost
string
PostHog instance URL. Only required for self-hosted. Defaults to https://app.posthog.com
sessionRecording
boolean
default:"true"
Enable or disable session recordings

Amplitude

User behavior and documentation analytics.
docs.json
"integrations": {
  "amplitude": {
    "apiKey": "76bb138bf3fbf58186XXX00000"
  }
}

Clarity

Microsoft Clarity session recordings and heatmaps.
docs.json
"integrations": {
  "clarity": {
    "projectId": "abc123xyz"
  }
}
Getting your project ID:
  1. Create a Clarity account
  2. Click Get tracking code
  3. Copy your project ID

Segment

Customer data platform for routing events to multiple destinations.
docs.json
"integrations": {
  "segment": {
    "key": "YOUR_SEGMENT_WRITE_KEY"
  }
}

Plausible

Privacy-focused analytics platform.
docs.json
"integrations": {
  "plausible": {
    "domain": "docs.yoursite.com"
  }
}

Fathom

Privacy-first website analytics.
docs.json
"integrations": {
  "fathom": {
    "siteId": "YOUR_SITE_ID"
  }
}

Heap

Automatic event tracking for user interactions.
docs.json
"integrations": {
  "heap": {
    "appId": "YOUR_HEAP_APP_ID"
  }
}

Hotjar

Heatmaps, session recordings, and user feedback.
docs.json
"integrations": {
  "hotjar": {
    "hjid": "YOUR_HOTJAR_ID",
    "hjsv": "6"
  }
}

LogRocket

Session replay and error tracking.
docs.json
"integrations": {
  "logrocket": {
    "appId": "your-app/your-project"
  }
}

Hightouch

Reverse ETL and data activation platform.
docs.json
"integrations": {
  "hightouch": {
    "apiKey": "YOUR_API_KEY",
    "apiHost": "https://api.hightouch.com"
  }
}

Google Tag Manager

Manage multiple tracking tags.
docs.json
"integrations": {
  "gtm": {
    "tagId": "GTM-XXXXXXX"
  }
}

Other platforms

Mintlify also supports:
  • Adobe Analytics - Enterprise analytics platform
  • Clearbit - B2B data enrichment
  • Pirsch - Privacy-friendly analytics
See the analytics overview documentation for the complete list.

Tracked events

All events use the docs. prefix.

Page views and navigation

EventDescription
docs.content.viewUser views a page
docs.navitem.clickUser clicks a navigation item
docs.navitem.cta_clickUser clicks a CTA button
EventDescription
docs.search.queryUser performs a search
docs.search.result_clickUser clicks a search result

Code and API playground

EventDescription
docs.code_block.copyUser copies code
docs.api_playground.requestUser makes an API request

AI Assistant

EventDescription
docs.assistant.enterUser opens AI assistant
docs.assistant.completedChat session completes
docs.assistant.thumbs_upPositive feedback
docs.assistant.thumbs_downNegative feedback

Interactive components

EventDescription
docs.accordion.openUser opens accordion
docs.expandable.openUser opens expandable

Example configuration

Connect multiple analytics providers:
docs.json
{
  "integrations": {
    "ga4": {
      "measurementId": "G-XXXXXXXXXX"
    },
    "posthog": {
      "apiKey": "phc_xxxxxxxxxxxxx",
      "apiHost": "https://app.posthog.com"
    },
    "mixpanel": {
      "projectToken": "xxxxxxxxxxxxx"
    },
    "segment": {
      "key": "xxxxxxxxxxxxx"
    }
  }
}

Troubleshooting

  • Verify your API key is correct
  • Check that no content security policies are blocking the analytics script
  • Ensure you’re not viewing a preview link (analytics are disabled on previews)
  • Some platforms take 24-48 hours to show data
  • Add your docs URL to the platform’s authorized domains list
  • For PostHog, check that sessionRecording is not set to false
  • Verify your browser allows third-party scripts
  • Mintlify supports multiple analytics providers simultaneously
  • Each platform receives the same events independently
  • No special configuration needed for multiple providers

Build docs developers (and LLMs) love