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

# Mixpanel

> Connect Mixpanel to Rocket and track feature adoption, analyze funnels, and segment users: all wired up from chat.

export const LlmsDirective = () => <blockquote className="llms-directive">
    For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
    For a lightweight markdown version of this page, append .md to the URL.
  </blockquote>;

<LlmsDirective />

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

<Note>
  This connector is only available for **Next.js TypeScript** web build tasks.
</Note>

<Divider />

## 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

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="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/0zaGfAm7lFodp7hM/images/build-docs/connectors/mixpanel/web-browser/mixpanel-create-service-account-light.webp?fit=max&auto=format&n=0zaGfAm7lFodp7hM&q=85&s=75810c5e6570419c3968d405bb3045ae" alt="Mixpanel Create Service Account dialog with Name, Organization Role, Projects, Project Role, and Expires fields." className="theme-image light-image" width="952" height="219" data-path="images/build-docs/connectors/mixpanel/web-browser/mixpanel-create-service-account-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/0zaGfAm7lFodp7hM/images/build-docs/connectors/mixpanel/web-browser/mixpanel-create-service-account-dark.webp?fit=max&auto=format&n=0zaGfAm7lFodp7hM&q=85&s=76cad87462c613bd661a045d1ecce688" alt="Mixpanel Create Service Account dialog with Name, Organization Role, Projects, Project Role, and Expires fields." className="theme-image dark-image" width="948" height="209" data-path="images/build-docs/connectors/mixpanel/web-browser/mixpanel-create-service-account-dark.webp" />
    </Frame>
  </Step>
</Steps>

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

<Divider />

## 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="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/PMhgGqf0Gxy-8x42/images/build-docs/connectors/mixpanel/web-browser/mixpanel-chat-light.webp?fit=max&auto=format&n=PMhgGqf0Gxy-8x42&q=85&s=d2de8085d3b5bbf8ee1f030ef2007d99" alt="Rocket chat panel showing a Connect prompt for Mixpanel." className="theme-image light-image" width="2880" height="1624" data-path="images/build-docs/connectors/mixpanel/web-browser/mixpanel-chat-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/PMhgGqf0Gxy-8x42/images/build-docs/connectors/mixpanel/web-browser/mixpanel-chat-dark.webp?fit=max&auto=format&n=PMhgGqf0Gxy-8x42&q=85&s=d4e1f53d6dda20a386177e74fb432641" alt="Rocket chat panel showing a Connect prompt for Mixpanel." className="theme-image dark-image" width="2880" height="1624" data-path="images/build-docs/connectors/mixpanel/web-browser/mixpanel-chat-dark.webp" />
    </Frame>

    **Option 2: From the Connectors tab**

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

    <Frame caption="Open Connectors from the toolbar">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/2lqYWidv_xVHKfL6/images/build-docs/connectors/shared/connectors-tab-open-light.webp?fit=max&auto=format&n=2lqYWidv_xVHKfL6&q=85&s=7bd785a0e878564054e08328b2aa3d6b" alt="Toolbar dropdown with Connectors option highlighted." className="theme-image light-image" width="2880" height="1624" data-path="images/build-docs/connectors/shared/connectors-tab-open-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/2lqYWidv_xVHKfL6/images/build-docs/connectors/shared/connectors-tab-open-dark.webp?fit=max&auto=format&n=2lqYWidv_xVHKfL6&q=85&s=d047040372d776cb47e4e483de8eeb8d" alt="Toolbar dropdown with Connectors option highlighted." className="theme-image dark-image" width="2880" height="1624" data-path="images/build-docs/connectors/shared/connectors-tab-open-dark.webp" />
    </Frame>

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

    <Frame caption="Mixpanel card in the Connectors panel">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/PMhgGqf0Gxy-8x42/images/build-docs/connectors/mixpanel/web-browser/mixpanel-connectors-tab-light.webp?fit=max&auto=format&n=PMhgGqf0Gxy-8x42&q=85&s=06ef1dafa2b57e22081444b7ccbddc9a" alt="Connectors panel showing the Mixpanel card with a Connect button." className="theme-image light-image" width="1815" height="505" data-path="images/build-docs/connectors/mixpanel/web-browser/mixpanel-connectors-tab-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/PMhgGqf0Gxy-8x42/images/build-docs/connectors/mixpanel/web-browser/mixpanel-connectors-tab-dark.webp?fit=max&auto=format&n=PMhgGqf0Gxy-8x42&q=85&s=ee9738f8df097599d5d01e0893d1ba41" alt="Connectors panel showing the Mixpanel card with a Connect button." className="theme-image dark-image" width="1818" height="529" data-path="images/build-docs/connectors/mixpanel/web-browser/mixpanel-connectors-tab-dark.webp" />
    </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="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/PMhgGqf0Gxy-8x42/images/build-docs/connectors/mixpanel/web-browser/mixpanel-popup-light.webp?fit=max&auto=format&n=PMhgGqf0Gxy-8x42&q=85&s=4da291beaaa74f0ce4d3ccc328816784" alt="Connect Mixpanel popup with Account username, Account secret, and Region fields." className="theme-image light-image" width="834" height="784" data-path="images/build-docs/connectors/mixpanel/web-browser/mixpanel-popup-light.webp" />

          <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/PMhgGqf0Gxy-8x42/images/build-docs/connectors/mixpanel/web-browser/mixpanel-popup-dark.webp?fit=max&auto=format&n=PMhgGqf0Gxy-8x42&q=85&s=5adacb49d3ded1cbf60cba8670d0cee8" alt="Connect Mixpanel popup with Account username, Account secret, and Region fields." className="theme-image dark-image" width="834" height="784" data-path="images/build-docs/connectors/mixpanel/web-browser/mixpanel-popup-dark.webp" />
        </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="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/PMhgGqf0Gxy-8x42/images/build-docs/connectors/mixpanel/web-browser/mixpanel-disconnect-light.webp?fit=max&auto=format&n=PMhgGqf0Gxy-8x42&q=85&s=dcf9d57aaf8ceb8382e507f08fe89dac" alt="Mixpanel card showing Edit and Disconnect buttons." className="theme-image light-image" width="1815" height="516" data-path="images/build-docs/connectors/mixpanel/web-browser/mixpanel-disconnect-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/PMhgGqf0Gxy-8x42/images/build-docs/connectors/mixpanel/web-browser/mixpanel-disconnect-dark.webp?fit=max&auto=format&n=PMhgGqf0Gxy-8x42&q=85&s=6bffb17ef23714ee6820517886378e0e" alt="Mixpanel card showing Edit and Disconnect buttons." className="theme-image dark-image" width="1814" height="523" data-path="images/build-docs/connectors/mixpanel/web-browser/mixpanel-disconnect-dark.webp" />
    </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

| 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

* **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 />

## What's next?

<CardGroup cols={2}>
  <Card title="Supabase" icon="database" href="./supabase/overview">
    Link Mixpanel events to authenticated users with Supabase user management.
  </Card>

  <Card title="Stripe" icon="credit-card" href="./stripe">
    Track payment events and revenue alongside user behavior in Mixpanel.
  </Card>

  <Card title="Twilio" icon="comments" href="./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>
