# Push analytics data to Mixpanel

Connect a Mixpanel project in Brand Control Center with a service account so engagement events sync to it on a schedule.

Brand Control Center authenticates to Mixpanel with a service account: a username and secret created in Mixpanel's organization settings, plus the id of the project to write to. The sync runs daily, weekly, or monthly. For a warehouse or file export instead, see [Receive zero-party data in BigQuery](https://begenuin.com/developers/developer-resources/api/connect-bigquery-to-the-brand-control-center-to-receive-zero-party-data) and [Push analytics data to Amazon S3](https://begenuin.com/developers/developer-resources/api/how-do-i-integrate-amazon-s3-bucket-with-brand-control-center-to-push-analytics-data).

## Before you begin

- **Owner or Admin access in Mixpanel**, which creating a service account requires. Mixpanel's own reference is [Service accounts](https://developer.mixpanel.com/reference/service-accounts).
- **Create or Edit permission on Data Sources** in Brand Control Center. A role with view-only access sees the form disabled. See [Invite your team and assign roles](https://begenuin.com/developers/get-started/any-business/how-do-you-add-admins-to-maintain-quality-and-governance-in-your-community).

## Step 1: Create a service account in Mixpanel

1. In Mixpanel, open **Settings** and select the **Org** tab.
2. Select **Service Accounts**, then **Add Service Account**. Give it a role that can write to the project you'll connect.
   ![Mixpanel's Settings panel on the Org tab, with Service Accounts selected in the list that also shows Overview, Plan Details & Billing, Users & Teams, and Projects.](https://cdn.sanity.io/images/lnrtvsvr/development/2e24a688359752adff7d50d00b889505fec5eeb8-321x427.jpg)
   *Service accounts live under the organization settings, not the project settings.*

## Step 2: Copy the username and secret

1. In the **Add Service Account** dialog, copy the **Username** and the **Secret**.
2. Store the secret now. Mixpanel shows it once and can't show it again.
3. Select **Done**.
   ![Mixpanel's Add Service Account dialog with a Username and a masked Secret, each with a Copy button, and the warning that the secret can't be accessed again.](https://cdn.sanity.io/images/lnrtvsvr/development/69edbc39285654606856ef00c1463be1c8573988-598x328.jpg)
   *The secret is shown only in this dialog.*

## Step 3: Find the project ID

1. Still in Mixpanel's Settings, select the **Project** tab.
2. Open **Overview** and note the **Project ID**, a number such as `1234567`.
   ![Mixpanel's Settings panel on the Project tab, listing Overview, Project Users, Alerts, Data Governance, Data Views, Data Deletion, Service Accounts, and more.](https://cdn.sanity.io/images/lnrtvsvr/development/a3b59d91be003a75509f487fd4f956229b201f20-321x588.jpg)
   *The project settings hold the project ID that Brand Control Center writes to.*

## Step 4: Connect in Brand Control Center

1. Open **Settings** > **Data Sources** and expand **Mix Panel**.
2. Fill in the fields:

| Field | What to enter |
| --- | --- |
| Username | The service account's username, such as genuin.2af666.mp-service-account. Required. |
| Secret | The service account's secret. The eye icon shows or hides it. Required. |
| Project ID | The project's numeric id from step 3. Required. |
| Data Sync Frequency | Daily, Weekly, or Monthly. Required. |

3. Select **Connect and Save**. The notification **Successfully connected!** confirms the details are saved, and the first sync runs on the schedule you chose.
   ![The Data Sources page with the Mix Panel panel expanded: a note linking to Mixpanel's service account document, and the Username, Secret, Project ID, and Data Sync Frequency fields above the Connect and Save button.](https://cdn.sanity.io/images/lnrtvsvr/development/4172acb9554d35a44d833a1cd5572c0ea4068b2f-1918x951.jpg)
   *The Mix Panel panel with the service account fields filled in.*

**Connect and Save** stays disabled until every field has a value, and a field made only of spaces is rejected. If the notification reads **Oops, something went wrong!**, a field failed validation on the server; check that all four are present and try again.

> **Note** Saving stores the credentials; it doesn't call Mixpanel. A wrong username, secret, or project ID shows up as a failed sync rather than a failed save, so copy the three values straight from Mixpanel.

## Change the connection

Edit any field and select **Connect and Save** again. The new values replace the old ones, and later syncs use them. To stop the sync, delete the service account in Mixpanel; its credentials then fail and no data is written.

## Limits

| Item | Limit |
| --- | --- |
| Connections | One Mixpanel project per brand |
| Authentication | Service account username and secret |
| Schedule | Daily, Weekly, or Monthly |

## Limitations

- **Batch delivery only**: Events arrive on the chosen schedule, not in real time.
- **No disconnect control**: Removing the service account in Mixpanel is the way to stop the sync.
- **Credentials are stored as entered**: Create a service account for Genuin alone, with access to the one project, and rotate it from Mixpanel.

## See also

- [Receive zero-party data in BigQuery](https://begenuin.com/developers/developer-resources/api/connect-bigquery-to-the-brand-control-center-to-receive-zero-party-data)
- [Push analytics data to Amazon S3](https://begenuin.com/developers/developer-resources/api/how-do-i-integrate-amazon-s3-bucket-with-brand-control-center-to-push-analytics-data)
- [Query Genuin event data in BigQuery](https://begenuin.com/developers/developer-resources/api/integrate-google-bigquery-with-brand-control-center)
