> For the complete documentation index, see [llms.txt](https://docs.zellify.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zellify.app/platform-introduction/integrations/mixpanel.md).

# Mixpanel

Send funnel behavior, answers, and payment lifecycle events to Mixpanel, then analyze them with Zellify's agent.

The Mixpanel integration connects each Zellify link to the Mixpanel project that should receive its traffic. It covers browser behavior, funnel answers, payment outcomes, user identity, optional session replay, and agent-assisted analysis.

You can use it to answer questions such as:

* Where do visitors leave the funnel?
* Which answers correlate with checkout or payment?
* Which users reached checkout?
* Did browser payment signals match provider-confirmed payments?
* Are duplicate deliveries being collapsed into one logical event?

***

## Two separate connections

Mixpanel uses one connection for tracking and another for agent access. They serve different purposes and do not share credentials.

| Connection                    | What it does                                                                                                                                                | Who configures it                                                 |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| **Mixpanel project**          | Sends browser events to a selected Mixpanel project. Optional server delivery adds retryable funnel events and provider-confirmed billing events.           | An organization member in **Dashboard → Integrations → Mixpanel** |
| **Personal Mixpanel account** | Lets Zellify's agent analyze the Mixpanel projects the signed-in person can access. It can also manage Mixpanel resources when that person explicitly asks. | Each Zellify user who wants agent access                          |

{% hint style="warning" %}
A personal Mixpanel connection does not configure tracking. A Mixpanel project must still be added in Zellify and assigned to the relevant link.
{% endhint %}

***

## Before you start

For browser tracking, collect these values from Mixpanel:

* **Project Token** from **Project settings → Access keys**
* The project's **data region**: US, EU, or India

For optional server delivery, also collect:

* The numeric **Project ID** from Mixpanel project settings
* A service-account username and one-time secret with access to that project

For agent access:

* Mixpanel MCP must be enabled for your organization
* Your Mixpanel user must have access to the projects you want to analyze
* You must choose the same Mixpanel account region during OAuth

See [Mixpanel's MCP documentation](https://docs.mixpanel.com/docs/mcp) for the provider-side prerequisites.

***

## Add a Mixpanel project

1. Open [**Dashboard → Integrations → Mixpanel**](https://dash.zellify.app/integrations/mixpanel).
2. Select **Add project**.
3. Enter a name that identifies the Mixpanel project inside Zellify.
4. Paste the Mixpanel **Project Token**.
5. Select the matching **Data region**: US, EU, or India.
6. Choose the browser tracking options described below.
7. Optional: enable **Server delivery** and enter its required credentials.
8. Save the project.

### Browser tracking options

| Setting            | Default                | Behavior                                                             |
| ------------------ | ---------------------- | -------------------------------------------------------------------- |
| **Autocapture**    | On                     | Tracks supported clicks, form submissions, and page views.           |
| **Session replay** | Off                    | Records a sample of browser sessions for playback in Mixpanel.       |
| **Sample rate**    | 0% while replay is off | When replay is enabled, choose the percentage of sessions to record. |

Zellify does not enable console capture or network recording for Mixpanel.

{% hint style="info" %}
Mixpanel autocapture may create `$mp_web_page_view`. Zellify also sends `z:page_view`. Choose one page-view definition in your reports instead of adding both together.
{% endhint %}

### Optional server delivery

Server delivery adds two capabilities:

* A retryable copy of the same Zellify funnel events sent by the browser
* Provider-confirmed payment and subscription lifecycle events, including renewals, refunds, past-due subscriptions, and cancellations

Browser tracking remains active when server delivery is off.

When server delivery is enabled, enter the numeric **Project ID**, the **service-account username**, and the **service-account secret**. Zellify encrypts these credentials and does not return the saved secret to the dashboard or agent.

When editing an existing project:

* Leave both service-account fields blank to keep the saved credentials.
* Enter both fields to rotate the credentials.
* Do not enter only one field.

#### Create a Mixpanel service account

Mixpanel calls this credential a **service account**, not a system user. Zellify uses it only for server delivery through Mixpanel's `/import` API. Agent access uses the separate personal OAuth connection.

1. In Mixpanel, open the project that should receive Zellify events.
2. Open **Project settings → Service Accounts**, then select **Create service account**.
3. Give the service account **Owner** or **Admin** access to this project. Mixpanel requires one of these roles for `/import`. Do not grant access to unrelated projects.
4. Copy the username and secret when Mixpanel shows them. The secret cannot be viewed again.
5. In Zellify, enable **Server delivery**, then enter the numeric **Project ID**, username, and secret.

Your Mixpanel user needs **Owner** or **Admin** permission to create or manage the service account. See Mixpanel's [service-account documentation](https://docs.mixpanel.com/reference/service-accounts) and [Import Events API](https://docs.mixpanel.com/reference/import-events).

***

## Assign the project to a link

Mixpanel delivery is selected per link. This prevents traffic from one link being sent to the wrong Mixpanel project.

When creating or editing a link:

1. Open the analytics and tracking destinations.
2. Find **Mixpanel**.
3. Select the Mixpanel project that should receive that link's traffic.
4. Keep the Mixpanel row enabled.
5. Save the link.

New links automatically select the first configured product analytics source. Review the selection when your organization has more than one Mixpanel project. Existing links must be edited if they were created before the Mixpanel project was added.

{% hint style="warning" %}
Adding a Mixpanel project does not retroactively send events from every link. The active link selection is the source of truth.
{% endhint %}

***

## Connect Mixpanel to Zellify's agent

The personal connection is optional. Tracking works without it.

1. Open [**Dashboard → Integrations → Mixpanel**](https://dash.zellify.app/integrations/mixpanel).
2. In **Connections**, select **Connect Mixpanel account**.
3. Choose the region used by your Mixpanel account.
4. Continue to Mixpanel and review the requested access.
5. Authorize Zellify.
6. Start a new Zellify agent chat so the connection is available in that session.

The personal connection is read and write. Mixpanel's consent page grants access to event and user-profile data, reports, dashboards, cohorts, metrics, data definitions, saved reports, and business context. Your existing Mixpanel project roles still apply.

Zellify's agent reads data when you ask an analytics question. It uses write operations only when you explicitly ask it to create or change a Mixpanel resource.

Example requests:

* "Compare the last 30 days of page views, email captures, and checkouts."
* "Show funnel answers by captured email."
* "Build a dashboard for journey drop-off, answer distributions, payment outcomes, and delivery health."
* "Create a cohort of users who reached checkout but did not complete payment."
* "Explain whether browser payment events match provider-confirmed payments."

{% hint style="info" %}
Connecting or reconnecting Mixpanel during an active agent chat does not add the connection to that chat. Start a new chat after authorization.
{% endhint %}

***

## Funnel events

Zellify sends these browser events with the `z:` prefix:

| Event                    | Meaning                                                                                                 |
| ------------------------ | ------------------------------------------------------------------------------------------------------- |
| `z:page_view`            | A visitor viewed a funnel page.                                                                         |
| `z:lead`                 | The funnel recorded a lead milestone.                                                                   |
| `z:page_completed`       | A visitor completed a page. Includes the time spent on the page and answer data available at that step. |
| `z:email_captured`       | A visitor submitted an email. Includes the email and the cumulative answer snapshot.                    |
| `z:checkout_presented`   | Checkout was shown to the visitor.                                                                      |
| `z:payment_method_added` | Checkout accepted the visitor's payment method.                                                         |
| `z:payment_succeeded`    | The browser observed a successful checkout.                                                             |
| `z:payment_failed`       | The browser observed a failed payment.                                                                  |
| `z:trial_started`        | The browser observed a trial start.                                                                     |
| `z:subscription_started` | The browser observed a subscription start.                                                              |
| `z:experiment_assigned`  | The visitor was assigned to an experiment variant.                                                      |

### Common funnel properties

Every Zellify funnel event includes a stable event time and insert ID. Available context includes:

* Identity: `$insert_id`, `$device_id`, `$user_id`, and `distinct_id`
* Funnel: organization, funnel, funnel version, link, experiment, page slug, and destination slug where available
* Page: URL, title, hostname, referrer, screen, and language
* Visitor context: country, region, city, browser, operating system, and device where available
* Attribution: ad network, campaign, ad group, ad, UTM values, and supported click identifiers where available
* Event-specific data such as answers, payment details, or experiment assignment

***

## Billing lifecycle events

When server delivery is enabled, payment-provider notifications send these provider-confirmed events:

| Event                             | Meaning                                           |
| --------------------------------- | ------------------------------------------------- |
| `z:billing.payment_success`       | A provider confirmed a completed payment.         |
| `z:billing.payment_failed`        | A provider confirmed a failed payment.            |
| `z:billing.payment_refunded`      | A provider confirmed a refund.                    |
| `z:billing.payment_voided`        | A provider confirmed a voided transaction.        |
| `z:billing.trial_started`         | A provider confirmed a trial start.               |
| `z:billing.subscription_started`  | A provider confirmed a subscription start.        |
| `z:billing.subscription_updated`  | A provider confirmed a subscription change.       |
| `z:billing.subscription_past_due` | A provider reported a past-due subscription.      |
| `z:billing.subscription_canceled` | A provider confirmed a subscription cancellation. |

Billing events can include:

* Major-unit `amount` and uppercase `currency`
* `provider` and `sandbox`
* `payment_kind`: `one_time`, `initial`, `renewal`, or `update`
* Provider customer, event, transaction, subscription, product, and price IDs
* Subscription and transaction status, reason, and origin
* Recovered link, funnel, experiment, session, and ad attribution where available
* `event_origin=payment_webhook`

### Browser success and billing success are different

`z:payment_succeeded` means the funnel page observed checkout success. `z:billing.payment_success` means the payment provider confirmed the transaction. They are separate events and should not be combined as duplicates.

Use `payment_kind` on `z:billing.payment_success` to separate:

* Initial subscriptions: `initial`
* Recurring subscription cycles: `renewal`
* One-time purchases: `one_time`
* Subscription changes: `update`

For payment completion and revenue reporting, treat the `z:billing.*` events as the authoritative source when server delivery is enabled.

***

## Identity and funnel answers

Before email capture, Zellify groups the journey under the funnel session as an anonymous Mixpanel user.

When `z:email_captured` fires:

* The captured email becomes the identified user ID.
* The event connects the previous anonymous session with the identified user.
* `$email` and the latest funnel answers are written to the Mixpanel user profile.
* Later page completions continue updating the profile with the latest answers.

A visitor who never submits an email still has a complete anonymous event history. They can appear in funnel, flow, retention, and behavioral cohort analyses, but no identified user profile is created.

Funnel answer values use stable analytics identifiers where available. Display labels can change when funnel copy changes, so Zellify does not rewrite historical values. Ask the agent to create readable report labels or dashboards from the funnel's answer choices.

{% hint style="info" %}
Tracking identity is not marketing consent. An email address on a Mixpanel profile does not mean the visitor agreed to promotional email.
{% endhint %}

***

## Browser and server deduplication

With server delivery enabled, Zellify sends a retryable copy of each funnel event without suppressing the browser event. Both deliveries use the same event name, time, identity, and `$insert_id`, so Mixpanel reports them as one logical event.

Mixpanel Raw Export can retain both ingested rows. If you analyze Raw Export data, deduplicate using this tuple:

* Event name
* Identity
* Event time
* `$insert_id`

Do not assume the raw row count equals the logical event count. Mixpanel does not publicly guarantee that duplicate raw ingestion is excluded from every usage or billing meter.

***

## Consent and privacy

Mixpanel follows the tracking consent configured for the funnel:

* Tracking, autocapture, and replay do not start when consent is missing, invalid, pending, or denied.
* Email capture and user identification do not replace tracking consent.
* Marketing permission must come from a separate, clearly defined funnel field.
* Session replay is off by default and follows its configured sample rate.
* Console capture and network recording remain disabled.

Zellify encrypts saved service-account credentials and keeps personal OAuth tokens out of funnel code and agent messages.

***

## Troubleshooting

### No Zellify events appear

Check the following:

1. The correct Mixpanel project is assigned to the link.
2. The Project Token belongs to the selected region.
3. The visitor granted tracking consent.
4. The report uses Zellify's `z:` event names.
5. The report time range includes the test session.

### Browser events appear, but billing events do not

Billing lifecycle events require server delivery. Confirm that:

* Server delivery is enabled.
* The Project ID is correct.
* The service account can import events into the project.
* The payment reached a provider-confirmed state.
* The payment can be attributed to the link using that Mixpanel project.

### The agent cannot use Mixpanel

Check that:

1. Your personal Mixpanel account is connected in Zellify.
2. The OAuth region matches your Mixpanel account.
3. Mixpanel MCP is enabled for your organization.
4. Your Mixpanel role can access the intended project.
5. You started a new agent chat after connecting or reconnecting.

If Mixpanel reports a missing permission, reconnect once and review the new consent page. Do not repeat the same reconnect flow if the requested permission is not listed.

### Page-view counts look too high

Do not add Mixpanel's autocaptured `$mp_web_page_view` to Zellify's `z:page_view`. Choose one page-view definition for the report.

### Raw Export contains duplicate rows

Raw Export can show both browser and server ingestion. Deduplicate on event name, identity, event time, and `$insert_id`.

### Session replay is empty

Confirm that replay is enabled, its sample rate is above zero, and the visitor granted tracking consent.

### A dashboard cannot save more reports

Mixpanel plan limits apply. Mixpanel Free currently limits each user to five saved reports. Consolidate related metrics into five reports or use a Mixpanel plan with a higher limit. See [Mixpanel's report limits](https://docs.mixpanel.com/docs/reports).

***

## Related Mixpanel documentation

* [Mixpanel MCP server](https://docs.mixpanel.com/docs/mcp)
* [Mixpanel user identification](https://docs.mixpanel.com/docs/tracking-methods/id-management/identifying-users-simplified)
* [Mixpanel user profiles](https://docs.mixpanel.com/docs/data-structure/user-profiles)
* [Mixpanel cohorts](https://docs.mixpanel.com/docs/users/cohorts)
* [Mixpanel reports](https://docs.mixpanel.com/docs/reports)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zellify.app/platform-introduction/integrations/mixpanel.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
