> ## Documentation Index
> Fetch the complete documentation index at: https://adapt.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Mixpanel

> Connect Mixpanel to Adapt to analyze events, funnels, retention, and segmentation

Connect Mixpanel to Adapt so it can read your product analytics. Reading data through Mixpanel's Query API requires a service account and your project ID.

## Set up credentials

<Steps>
  <Step title="Find your project token">
    In Mixpanel, open the settings gear and go to **Project Settings > Access
    Keys**. Copy the **Project Token**. Note that the token is used for data
    ingestion, not for reading data.
  </Step>

  <Step title="Find your project ID">
    Go to **Organization Settings > Projects**, open your project, and copy the
    **Project ID**.
  </Step>

  <Step title="Create a service account">
    With Owner or Admin permissions, go to **Organization Settings > Service
    Accounts** and create a new service account. Assign it a role with access to
    your project.
  </Step>

  <Step title="Copy the username and secret">
    Copy the service account **username** and **secret** now. Mixpanel shows the
    secret only once, so store it securely.
  </Step>
</Steps>

<Note>
  To read analytics data (events, funnels, retention, segmentation), Adapt uses
  Mixpanel's Query API, which requires the **service account username and
  secret** plus the **project ID**. The project token on its own is for
  ingestion and cannot query data, so provide the service account and project ID
  even though they are listed as optional below.
</Note>

## Connect to Adapt

<Steps>
  <Step title="Open Integrations">
    In Adapt, go to **Settings > Integrations**.
  </Step>

  <Step title="Find Mixpanel">
    Search for **Mixpanel** and select it from the catalog.
  </Step>

  <Step title="Start the connection">
    Click **Connect** to open the connection form.
  </Step>

  <Step title="Add your credentials">
    Enter the values you gathered above, then click **Add connection**:

    | Secret Name                         | Value                               |
    | ----------------------------------- | ----------------------------------- |
    | `MIXPANEL_TOKEN`                    | Your project token                  |
    | `MIXPANEL_PROJECT_ID`               | Your project ID (optional)          |
    | `MIXPANEL_SERVICE_ACCOUNT_USERNAME` | Service account username (optional) |
    | `MIXPANEL_SERVICE_ACCOUNT_SECRET`   | Service account secret (optional)   |

    You can rename the connection and choose whether it is shared with your
    organization or kept personal to you.
  </Step>

  <Step title="Test the connection">
    Ask Adapt about your top events over the last 7 days.
  </Step>
</Steps>

### Security

* Credentials are encrypted at rest with AES-256
* Give the service account only the project access and role it needs
* Optionally set an expiration on the service account to support credential rotation
* The service account secret is shown only once; store it securely and delete the account to revoke access
* Never share your credentials or commit them to source control

## Capabilities

Adapt can read and analyze your Mixpanel product analytics through the Query API.
Ask questions about events, funnels, retention, and segmentation in natural
language.

### Examples

```
What were my top events last week?
```

```
Build a funnel from signup to purchase
```

```
Show 30-day retention for new users
```

```
Segment active users by country this month
```
