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

# Mixpanel

## Connection

When you're setting up your first workflow with Mixpanel, you will need to create a [Connection](https://docs.getmesa.com/going-further/credentials) in order to connect MESA with Mixpanel.

<figure><img src="/files/DsQiUCl6yQx9gdFvWV9d" alt="Screenshot of the Mixpanel step in the MESA workflow builder prompting you to create a Connection. Spotlight the Add connection button."><figcaption></figcaption></figure>

To create a Mixpanel connection, you'll need to create a service account that has the `Owner` or `Admin` role where you can create and add your Service Account Username and Service Account Secret. You can [learn more about service accounts here](https://developer.mixpanel.com/reference/service-accounts#managing-service-accounts).

To create a Service Account, login into Mixpanel and navigate to the Organization Settings.

<figure><img src="/files/K6bnd1KvFpke48pFXhxx" alt="Screenshot of the Mixpanel dashboard after logging in. Spotlight the Organization Settings navigation."><figcaption></figcaption></figure>

Next, open the Service Accounts menu and click the Add Service Account button:

<figure><img src="/files/5s964PmU4yxgWWARfhyL" alt="Screenshot of the Mixpanel Organization Settings with the Service Accounts menu open. Spotlight the Add Service Account button."><figcaption></figcaption></figure>

Add a name for your Service Account and and be sure to set the Organizational role and Project roles to Owner or Admin. Otherwise, you will not be able to successfully connect your connection. Then click Create.

<figure><img src="/files/B1R6IAzWeQdDtjJYUU1t" alt="Screenshot of the Mixpanel Add Service Account dialog with a name entered. Spotlight the Organizational role and Project roles set to Owner or Admin, then Create."><figcaption></figcaption></figure>

Next, copy the Username and paste it in the Service Account Username field of your Mixpanel step in MESA. Additionally, copy the Secret and paste it in the Service Account Secret field of your Mixpanel step in MESA. Afterwards, click Done to complete the creation process.

<figure><img src="/files/oz9dB4VkqqfRg5bX3fhs" alt="Screenshot of the Mixpanel Service Account created dialog showing the Username and Secret. Spotlight the Username and Secret values to copy before clicking Done."><figcaption></figcaption></figure>

{% hint style="warning" %}
The Service Account Secret can only be viewed and copied during the creation process. Be sure to save it if you will need to reference it in the future.
{% endhint %}

Next, from your Mixpanel Settings, open the Project tab and copy your Project Token in the Access Keys section. Then, paste it in the Project Token field of your Mixpanel step in MESA. Then, click the Add connection button.

<figure><img src="/files/2GNXC5c9v3aJheAbBnic" alt="Screenshot of the Mixpanel connection setup in MESA with the Service Account Username, Secret, and Project Token fields filled in. Spotlight the Add connection button."><figcaption></figcaption></figure>

{% hint style="info" %}
Some actions will require your Project ID instead of the Project Token. Be sure to identify the correct one via the required fields in your step's connection setup and paste the correct value.
{% endhint %}

You should now see your new connection added to the dropdown when the step updates.

<figure><img src="/files/emxUDEvJvn6253y42ahi" alt="Screenshot of the Mixpanel step in the MESA workflow builder after adding the connection. Spotlight the connection dropdown showing the new connection."><figcaption></figcaption></figure>

## Configure

### Create an Event

#### Event Name

For the Event Name field, use the table name as the Event Name if pulling from a data warehouse.

Try to limit the amount of event names you have and use properties for details—e.g., track a single “Signup” event with an “Account Type” property set to “paid” or “free” instead of separate “Paid Signup” and “Free Signup” events.

#### Distinct ID

This value should be the unique ID of the user you're referencing—e.g., a Shopify Customer ID.

## Technical Notes

* If you have multiple Mixpanel projects, you will need to create a Mixpanel connection for each project.
* Actions that query for data have a rate limit of 60 queries per hour and a maximum of 5 concurrent queries. We recommend to run these steps on a scheduled basis ([Schedule](https://docs.getmesa.com/tools/schedule) tool) to ensure that you do not query more than 60 times an hour. Do not run a Time Travel using these steps.
* Profile steps will not error if there are issues with the information sent to Mixpanel.
* Variables for User Profile's properties will not display because they are flexible and vary. If you need help, we recommend contacting support for help with creating variables.
