> ## Documentation Index
> Fetch the complete documentation index at: https://product-guide-starter-replace-template-content.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect an analytics provider

> Supported analytics platforms and how to configure them in docs.json.

Mintlify integrates with most major analytics platforms. Add your provider's credentials to `docs.json` and Mintlify injects the tracking script on every page automatically.

## Supported providers

<Tabs>
  <Tab title="Product analytics">
    * PostHog
    * Mixpanel
    * Amplitude
    * Heap
    * Segment (as a source for any downstream destination)
  </Tab>

  <Tab title="Web analytics">
    * Google Analytics 4
    * Google Tag Manager
    * Plausible
    * Fathom
    * Pirsch
    * Microsoft Clarity
  </Tab>

  <Tab title="Session recording">
    * Hotjar
    * LogRocket
    * Microsoft Clarity
  </Tab>
</Tabs>

## Configuration

All providers are configured inside the `integrations` object in `docs.json`. Each entry uses the provider's name as the key:

```json theme={null}
"integrations": {
  "ga4": {
    "measurementId": "G-XXXXXXXXXX"
  },
  "posthog": {
    "apiKey": "phc_your_key_here"
  }
}
```

<Info>
  You can configure multiple providers simultaneously. Mintlify loads all of them on every page.
</Info>

## Provider-specific fields

| Provider           | Key in docs.json | Required field  |
| ------------------ | ---------------- | --------------- |
| Google Analytics 4 | `ga4`            | `measurementId` |
| Google Tag Manager | `gtm`            | `tagId`         |
| PostHog            | `posthog`        | `apiKey`        |
| Mixpanel           | `mixpanel`       | `projectToken`  |
| Plausible          | `plausible`      | `domain`        |
| Fathom             | `fathom`         | `siteId`        |
| Hotjar             | `hotjar`         | `hjid`, `hjsv`  |
| Segment            | `segment`        | `writeKey`      |
| Amplitude          | `amplitude`      | `apiKey`        |

## What Mintlify sends to your provider

Mintlify fires these events to connected providers:

* **Page view** — Triggered on every page load, with the current URL.
* **Search** — Triggered when a reader uses the search bar, including the query string.
* **Feedback** — Triggered when a reader clicks the thumbs up/down on a page.
* **API playground request** — Triggered when a reader sends a request from an API playground page.
