# Mixpanel (/build/connectors/mixpanel)

<LlmsDirective />

Describe the analytics you want in chat and Rocket generates the complete tracking logic: event calls, funnel visualizations, retention charts, and user segmentation.

<Divider />

## What you can do [#what-you-can-do]

<CardGroup cols={2}>
  <Card title="Feature adoption tracking" icon="chart-line">
    Measure which features users engage with and how often, so you can prioritize what to build next.
  </Card>
  <Card title="Conversion funnel analysis" icon="filter">
    Visualize how users move through multi-step flows like signups, onboarding, or checkout.
  </Card>
  <Card title="A/B testing dashboards" icon="flask">
    Compare metrics across experiment variants to see which version performs better.
  </Card>
  <Card title="User segmentation" icon="users">
    Group users by behavior, plan type, or demographics to understand how different audiences use your app.
  </Card>
  <Card title="Retention tracking" icon="arrow-rotate-left">
    Measure how many users return to your app over time and which actions drive long-term engagement.
  </Card>
</CardGroup>

<Divider />

## Before you connect [#before-you-connect]

You need three values from [Mixpanel Settings](https://mixpanel.com/settings/org):

- **Account username:** your Mixpanel service account username
- **Account secret:** your Mixpanel service account secret
- **Region:** `US` or `EU`, depending on where your Mixpanel project data is hosted

<Card icon="arrow-up-right-from-square" horizontal href="https://developer.mixpanel.com/reference/service-accounts" arrow="true">
  **Create a Mixpanel service account** from the Mixpanel documentation.
</Card>

**How to create a service account:**

<Steps>
  <Step title="Open Service Accounts settings">
    Open [Mixpanel Settings](https://mixpanel.com/settings/org) and go to **Organization Settings > Service Accounts**.
  </Step>
  <Step title="Add a service account">
    Click **Add Service Account** to open the Create Service Account dialog.
  </Step>
  <Step title="Configure account details">
    Enter a **Name**, set **Organization Role** and **Project Role**, and choose the **Projects** this account can access. Leave **Expires** as **Never** unless your organization requires rotation.
  </Step>
  <Step title="Copy credentials">
    Click **Create**, then copy the **username** and **secret** immediately. Mixpanel shows the secret only once.

    <Frame caption="Create Service Account dialog in Mixpanel">
      <img src="/images/build/connectors/mixpanel/web-browser/mixpanel-create-service-account-light.webp" alt="Mixpanel Create Service Account dialog with Name, Organization Role, Projects, Project Role, and Expires fields." className="theme-image light-image" />
      <img src="/images/build/connectors/mixpanel/web-browser/mixpanel-create-service-account-dark.webp" alt="Mixpanel Create Service Account dialog with Name, Organization Role, Projects, Project Role, and Expires fields." className="theme-image dark-image" />
    </Frame>
  </Step>
</Steps>

<Note>
  Mixpanel is a **task-level** connector. Each Rocket task connects to its own Mixpanel credentials independently.
</Note>

<Divider />

## Connect Mixpanel [#connect-mixpanel]

<Tabs>
  <Tab title="Web Browser">

    You can connect from two places. Both do the same thing.

    **Option 1: From chat**

    Type a prompt that mentions Mixpanel, for example `Connect Mixpanel and track when users click the Sign Up button`. Rocket detects the intent and shows a **Connect** button inline. Click it to open the credentials popup.

    <Frame caption="Mixpanel connection prompt in chat">
      <img src="/images/build/connectors/mixpanel/web-browser/mixpanel-chat-light.webp" alt="Rocket chat panel showing a Connect prompt for Mixpanel." className="theme-image light-image" />
      <img src="/images/build/connectors/mixpanel/web-browser/mixpanel-chat-dark.webp" alt="Rocket chat panel showing a Connect prompt for Mixpanel." className="theme-image dark-image" />
    </Frame>

    **Option 2: From the Connectors tab**

    Click the **`...`** button in the preview toolbar, then select **Connectors**.

    <ConnectorsToolbarFrame />

    Click the **Mixpanel** card, then click **Connect**.

    <Frame caption="Mixpanel card in the Connectors panel">
      <img src="/images/build/connectors/mixpanel/web-browser/mixpanel-connectors-tab-light.webp" alt="Connectors panel showing the Mixpanel card with a Connect button." className="theme-image light-image" />
      <img src="/images/build/connectors/mixpanel/web-browser/mixpanel-connectors-tab-dark.webp" alt="Connectors panel showing the Mixpanel card with a Connect button." className="theme-image dark-image" />
    </Frame>

    **After clicking Connect**

    <Steps>
      <Step title="Enter credentials">
        A popup opens. Enter your **Account username**, **Account secret**, and **Region**.

        <Frame caption="Connect Mixpanel popup">
          <img src="/images/build/connectors/mixpanel/web-browser/mixpanel-popup-light.webp" alt="Connect Mixpanel popup with Account username, Account secret, and Region fields." className="theme-image light-image" />
          <img src="/images/build/connectors/mixpanel/web-browser/mixpanel-popup-dark.webp" alt="Connect Mixpanel popup with Account username, Account secret, and Region fields." className="theme-image dark-image" />
        </Frame>
      </Step>
      <Step title="Confirm connection">
        Click **Connect**. A green dot appears next to Mixpanel when the connection is active.
      </Step>
    </Steps>

    **Update or disconnect**

    Open [**Connectors > Mixpanel**](#connect-mixpanel) and click the card. Click **Edit** to update your credentials or **Disconnect** to remove the integration from this task.

    <Frame caption="Edit and Disconnect options on a connected Mixpanel card">
      <img src="/images/build/connectors/mixpanel/web-browser/mixpanel-disconnect-light.webp" alt="Mixpanel card showing Edit and Disconnect buttons." className="theme-image light-image" />
      <img src="/images/build/connectors/mixpanel/web-browser/mixpanel-disconnect-dark.webp" alt="Mixpanel card showing Edit and Disconnect buttons." className="theme-image dark-image" />
    </Frame>

  </Tab>

  <Tab title="Mobile App">

    You can connect from two places. Both do the same thing.

    **Option 1: From chat**

    Type a prompt that mentions Mixpanel. Rocket detects the intent and shows a **Connect** button inline. Tap it to open the credentials screen.

    **Option 2: From the Connectors tab**

    <Steps>
      <Step title="Open the More menu">
        Tap the **More** button in the header.
      </Step>
      <Step title="Go to Integrations">
        Tap **Integrations**.
      </Step>
      <Step title="Connect Mixpanel">
        Tap the **Mixpanel** card, then tap **Connect**.
      </Step>
    </Steps>

    **After tapping Connect**

    A popup opens. Enter your **Account username**, **Account secret**, and **Region**, then tap **Done**.

    A green dot appears next to Mixpanel when the connection is active.

    **Update or disconnect**

    Go back to the **Mixpanel** card in Integrations. Tap **Edit** to update credentials or **Disconnect** to remove it from this task.

  </Tab>
</Tabs>

<Divider />

## Example prompts [#example-prompts]

| What you want | Prompt to use |
|:--------------|:--------------|
| Button tracking | `Track clicks on the Sign Up and Subscribe buttons and send events to Mixpanel.` |
| Page views | `Track page views for every route in my app and send them to Mixpanel with the page name.` |
| Signup funnel | `Track a signup funnel: Visit > Click Sign Up > Complete Form > Verify Email. Show drop-off rates.` |
| Feature usage | `Track usage of the search, filter, and export features. Show a daily usage chart for the last 30 days.` |
| User properties | `Set Mixpanel user properties for plan type, signup date, and company name on login.` |
| Retention chart | `Show a weekly retention chart for users who completed onboarding in the last 8 weeks.` |
| A/B test | `Track an A/B test on the pricing page. Compare conversion rates for monthly vs. annual pricing.` |
| Revenue tracking | `Send a Purchase Completed event to Mixpanel with the order total and product name.` |
| Error tracking | `Track JavaScript errors as Mixpanel events with the error message and stack trace.` |
| Session duration | `Track session start and end times. Show average session duration per day on a line chart.` |

<Divider />

## Tips [#tips]

- **Data region matters.** Choose `US` or `EU` to match where your Mixpanel project data is hosted.

  <Warning>
    Using the wrong region causes events to fail silently - they appear to send but never appear in your Mixpanel dashboard.
  </Warning>
- **Events appear with a short delay.** Mixpanel typically processes events within a few seconds, but dashboard aggregations may take a few minutes to update.
- **Some analytics features depend on your Mixpanel plan.** Advanced features like signal reports and data pipelines may require a paid plan.
- **One Mixpanel account per task.** Each Rocket task connects to one set of Mixpanel credentials. Use different tasks for different Mixpanel accounts.
- **Credentials are stored securely.** Rocket encrypts them at rest and never exposes them in client-side code.

<Divider />

## Revoke or rotate your service account [#revoke-or-rotate-your-service-account]

Disconnecting in Rocket only stops using the credentials in this task. To invalidate them, delete the service account in Mixpanel (the secret cannot be rotated on its own).

1. Open [Mixpanel Service Accounts](https://mixpanel.com/settings/org/service-accounts) (Organization Settings → Service Accounts).
2. Find the service account you connected to Rocket.
3. **Delete** the service account. Access is revoked immediately across projects.
4. If you still need Mixpanel in Rocket, create a new service account, copy the username and secret, and update them with **Edit** on the connector card.

<Card title="Manage service accounts in Mixpanel" icon="arrow-up-right-from-square" href="https://mixpanel.com/settings/org/service-accounts" horizontal arrow="true">
  Delete the service account in Mixpanel organization settings.
</Card>

<Warning>
  After you delete the service account, any Rocket task still using those credentials will fail until you connect a new one.
</Warning>

<Divider />

## What's next? [#whats-next]

<CardGroup cols={2}>
  <Card title="Supabase" icon="database" href="/build/connectors/supabase/overview">
    Link Mixpanel events to authenticated users with Supabase user management.
  </Card>
  <Card title="Stripe" icon="credit-card" href="/build/connectors/stripe">
    Track payment events and revenue alongside user behavior in Mixpanel.
  </Card>
  <Card title="Twilio" icon="comments" href="/build/connectors/twilio">
    Combine SMS notifications with analytics for a complete user communication picture.
  </Card>
  <Card title="All connectors" icon="plug" href="/build/connectors/overview">
    Browse every available integration.
  </Card>
</CardGroup>
