Skip to main content
Mintlify

Search documentation

Type to search this documentation.

On this pageOverview

Analytics integrations

Connect your Mintlify documentation to analytics platforms like Google Analytics, Mixpanel, PostHog, and more to track visitor engagement.

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

When you add analytics integrations to your documentation site, Mintlify tracks user interactions like page views, search queries, API playground requests, and feedback submissions. Mintlify then sends these events to your analytics providers. You can connect any number of supported analytics providers by adding your API keys to the docs.json file. Analytics events flow to your providers as soon as you add them to your configuration with no further configuration required.

Add your analytics provider credentials to the integrations object in docs.json. Only include the platforms you want to use.

docs.json
"integrations": {
    "adobe": {
        "launchUrl": "required"
    },
    "amplitude": {
        "apiKey": "required"
    },
    "clarity": {
        "projectId": "required"
    },
    "clearbit": {
        "publicApiKey": "required"
    },
    "cookies": {
      "key": "required",
      "value": "required"
    },
    "fathom": {
        "siteId": "required"
    },
    "ga4": {
        "measurementId": "required"
    },
    "gtm": {
        "tagId": "required"
    },
    "heap": {
        "appId": "required"
    },
    "hightouch": {
        "writeKey": "required",
        "apiHost": "optional"
    },
    "hotjar": {
        "hjid": "required",
        "hjsv": "required"
    },
    "logrocket": {
        "appId": "required"
    },
    "mixpanel": {
        "projectToken": "required"
    },
    "pirsch": {
        "id": "required"
    },
    "plausible": {
        "domain": "required"
    },
    "posthog": {
        "apiKey": "required",
        "apiHost": "optional"
    },
    "segment": {
      "key": "required",
      "cdnUrl": "optional"
    },
    "telemetry": {
      "enabled": "boolean"
    }
}
docs.json
{
  "integrations": {
    "ga4": {
      "measurementId": "G-XXXXXXXXXX"
    },
    "posthog": {
      "apiKey": "phc_xxxxxxxxxxxxx"
    },
    "mixpanel": {
      "projectToken": "xxxxxxxxxxxxx"
    }
  }
}

After you deploy your updated docs.json, load a page on your live site and confirm events are flowing in your provider's real-time or debug view. If events do not appear, check that:

  • You are using the public key or ID from the provider, not a private or server key.
  • The property name in docs.json matches the one documented for your provider.
  • The value is not wrapped in extra quotes or whitespace.

All tracked events use the docs. prefix.

Event name Description
docs.content.view User views a page. Only sent to providers that don't track page views by default.
docs.content.md.view User views Markdown version of a page.
docs.navitem.click User clicks a header navigation item.
docs.navitem.cta_click User clicks a call to action button.
docs.footer.powered_by_mintlify_click User clicks the "Powered by Mintlify" link.
Event name Description
docs.search.query User performs a search query.
docs.search.close User closes the search bar.
docs.search.result_click User clicks a search result.
Event name Description
docs.code_block.copy User copies code from a code block.
docs.code_block.ask_ai User asks the assistant to explain a code block.
docs.api_playground.request User makes an API request in the API playground.
Event name Description
docs.accordion.open User opens an accordion.
docs.accordion.close User closes an accordion.
docs.expandable.open User opens an expandable.
docs.expandable.close User closes an expandable.
Event name Description
docs.assistant.enter User opens the AI assistant.
docs.assistant.completed Chat session completes.
docs.assistant.source_click User clicks a citation in a chat response.
docs.assistant.suggestion_click User clicks a suggested question.
docs.assistant.ask_ai_on_text_selection User selects text and clicks "Ask AI."
docs.assistant.shared User shares a chat conversation.
docs.assistant.thumbs_up User clicks the positive feedback button on an assistant response.
docs.assistant.thumbs_down User clicks the negative feedback button on an assistant response.
docs.assistant.spam_detected The assistant detects spam in a user message.
docs.autopilot.suggestion.created The agent creates a documentation suggestion.
docs.autopilot.suggestion.no_suggestion The agent determines the documentation does not need updating.
Event name Description
docs.context_menu.copy_page User copies the current page as Markdown.
docs.context_menu.copy_mcp_link User copies the hosted MCP server link.
docs.context_menu.copy_add_mcp_command User copies the npx add-mcp command to install the MCP server.
docs.context_menu.ai_provider_click User clicks an AI provider to create a conversation with the current page as context.
docs.context_menu.install_mcp_server User installs the hosted MCP server on code editors.
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu