Track how users interact with your documentation by connecting to third-party analytics platforms. Mintlify sends engagement events to your configured analytics providers.
How analytic integrations work
When you add analytics integrations to your documentation site, Mintlify tracks user interactions like page views, search queries, API playground requests, and feedback submissions and sends them 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.
Setup
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. Your private API keys, which pair with the public keys on the analytics providers’ end, must remain private. Do not include private API keys in your docs.json.
"integrations": {
"amplitude": {
"apiKey": "required"
},
"clarity": {
"projectId": "required"
},
"clearbit": {
"publicApiKey": "required"
},
"cookies": {
"key": "required",
"value": "required"
},
"fathom": {
"siteId": "required"
},
"ga4": {
"measurementId": "required"
},
"gtm": {
"tagId": "required"
},
"hightouch": {
"apiKey": "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"
},
"telemetry": {
"enabled": "boolean"
}
}
Example configuration
{
"integrations": {
"ga4": {
"measurementId": "G-XXXXXXXXXX"
},
"posthog": {
"apiKey": "phc_xxxxxxxxxxxxx",
"apiHost": "https://app.posthog.com"
},
"mixpanel": {
"projectToken": "xxxxxxxxxxxxx"
}
}
}
Tracked events
All tracked events use the docs. prefix.
Navigation and page views
| 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. |
Search
| 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. |
Code and API playground
| 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. |
Interactive components
| 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. |
Assistant and agent
| 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 no documentation update is needed. |
| 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.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. |