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

# Mixpanel

> Query Mixpanel events, saved funnels and retention live from Explore and AI agents

The Mixpanel [live data source](https://docs.lightdash.com/integrations/live-data-sources) reads one Mixpanel project. Lightdash turns each query into a Query API report, and Mixpanel computes the event counts, unique users, funnels and retention itself. Event data stays in Mixpanel. It's a [level 3](https://docs.lightdash.com/integrations/live-data-sources#integration-levels) integration: its API runs reports from a fixed menu.

## Before you start

* **Live data sources enabled** for your organization. See [Live data sources](https://docs.lightdash.com/integrations/live-data-sources).
* **Admin role** in the Lightdash project.
* **A Mixpanel plan with the Query API**, Growth or Enterprise.
* **A service account with access to the project.** In Mixpanel, open **Organization settings** → **Service accounts**, create one, give it access to the project, and copy its username and secret. Mixpanel shows the secret only when it creates the account.
* **The project ID**, the number after `/project/` in the project's URL, or under **Project settings** → **Overview**.
* **The project's data region**: US, EU or India. Projects you open at `eu.mixpanel.com` are in the EU, and at `in.mixpanel.com` in India.

## Connect Mixpanel

1. On the nav bar, click **Browse** → **Semantic Layer**.
2. In the sidebar, select **Live data sources**, then click **Add**.
3. Select **Mixpanel**.
4. Choose the **Data region**, enter the **Project ID**, the **Service account** username and its **Secret**, then click **Test**. A working account shows how many events the project tracked in the last 31 days.
5. Under **Details**, check the **Name** and **Explore prefix**. People see the name in Explore and agents use it to refer to the source. The prefix is filled in from the name and can't be changed later. See [Explore prefix](https://docs.lightdash.com/integrations/live-data-sources#explore-prefix).
6. Click **Add source**.

Lightdash adds **Top events today**, **Events**, **Funnel** and **Retention** tables to Explore, grouped under the source's name. To use another service account or project, delete the source and add it again; you can [reattach](https://docs.lightdash.com/integrations/live-data-sources#explore-prefix) the deleted source so its charts keep working.

## Tables

| Table | Dimensions | Metrics |
| - | - | - |
| Top events today | Event | Event count today, Change from yesterday |
| Events | Date, Date month, Event, and one event property | Event count, Unique users, Events per user |
| Funnel | Step number, Step event | Users, Conversion from first step, Conversion from previous step, Average time to step (seconds) |
| Retention | Cohort, Cohort week, Cohort month, Days after start, Weeks after start, Months after start | Retained users, Cohort users, Retention rate |

* **Top events today** lists the project's most common events so far today.
* **Events** needs an **Event** filter with 1 to 3 event names; Mixpanel counts one event per call. It can be filtered and grouped by these event properties, grouped by one at a time: **Country**, **Region**, **City**, **Browser**, **OS**, **Device**, **Library**, **Referring domain**, **UTM source**, **UTM medium** and **UTM campaign**.
* **Funnel** reads a funnel saved in Mixpanel. Filter **Funnel ID** to the number in the funnel report's URL. Its steps and conversion window come from the saved funnel, and it covers the whole date range.
* **Retention** needs a cohort dimension and the matching **Days**, **Weeks** or **Months after start**. Filter **Start event** to put users in a cohort the first time they did it; without it, a cohort is everyone who did the return event in that period. Filter **Return event** to choose what counts as coming back; without it, any event counts. Period 0 is the cohort's own day, week or month, where every user counts, and a query reads at most 90 days, 52 weeks or 24 months after start.

Unique users and rates are counted once per row. Choose a coarser date grain instead of adding rows together.

## Supported features

| Feature | Available |
| - | - |
| Filters on event properties | Yes, `is` and `is not`, on **Events** |
| OR filters and nested filter groups | No |
| Filters on metrics | No |
| Table calculations, custom metrics and custom dimensions | No |
| Pivots, date zoom and period-over-period comparisons | No |

## Limits

| Limit | Value |
| - | - |
| Default date range | Last 30 days, when the query has no date filter |
| Most rows per query | 5,000 |
| Calls per query | 6, one per event and metric |
| Timeout | 60 seconds |
| Calls at once | 1 per source |
| Calls per hour | 40 per source |

Mixpanel allows 60 Query API calls an hour and 5 at once per project, shared with every other tool that reads the project. Lightdash uses at most 40 of them an hour to leave room for those tools, and caches results for an hour, so repeated queries don't count again.

Custom event and user properties, user profiles, sums and averages of numeric properties, saved Insights reports, sessions and user paths aren't available from the Mixpanel source.

## Example questions

* *"Daily `Sign Up` events over the last 30 days."*
* *"Monthly unique users of `Export Report` this year, by country."*
* *"Step-by-step conversion of saved funnel 1234567 this month."*
* *"Weekly retention of users who signed up in the last quarter."*

## Troubleshooting

**Mixpanel rejected the service account.** Copy the username and secret again. A deleted or expired service account stops working.

**Mixpanel denied access.** Check that the service account was added to the project, and that the **Project ID** and **Data region** match it.

**Mixpanel rate limit reached.** The project has used its 60 calls this hour, possibly through other tools. Wait, or use cached results.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.