# Activate events in Mixpanel ## Learn how to send events in real time to Mixpanel. ## Before you begin Before proceeding, make sure you have already configured at least one [event source](https://www.krenalis.com/docs/collect-events.md) in Krenalis. Mixpanel activation requires an existing source, since events must originate from a connected source before they can be routed to this destination. ## Steps ### 1. Get your Mixpanel project ready To start, you'll need the **Project ID** and **Project Token** of the Mixpanel project you want to link. Choose one of the options below: #### Create a new Mixpanel project 1. Log in to your [Mixpanel](https://mixpanel.com/) account and click **Create project** from the top-left menu. 2. Enter a name, select the data storage location, timezone, and organization, then click **Create**. 3. *(Optional)* Go to **⚙ Settings → Project Settings → Identity Merge** and switch to the **Simplified ID Merge API** if it's not already enabled. 4. Open **Overview** and copy both the **Project ID** and **Project Token** from the **Project Details** and **Access Keys** sections. #### Use an existing Mixpanel project 1. Log in to [Mixpanel](https://mixpanel.com/) and select the project you want to connect to Krenalis. 2. Go to **⚙ Settings → Project Settings**. 3. *(Recommended)* Verify that **Simplified ID Merge API** is enabled under **Identity Merge**. 4. From **Overview**, copy the **Project ID** and **Project Token**. At this point, make sure you have your **Project ID** and **Project Token** copied — you'll need them in the next step. ### 2. Connect Krenalis with Mixpanel Next, connect Krenalis to your Mixpanel project. 1. In your Krenalis workspace, open the **Destinations** page. 2. Click **Add a new destination ⊕**, then select the **Mixpanel** card. 3. Click **Add destination...**. 4. (Optional) In **Name**, enter a label to identify the connection later. 5. Fill in the following fields and click **Add** to complete the connection: | Field | Description | |---------------------|-----------------------------------------------------------------| | Project ID | Project ID of your Mixpanel project. You copied this in Step 1. | | Project Token | Project Token. You copied this in Step 1. | | Data Residency | Choose the data residency of your project. | ### 3. Link an event source Events received from an event source are delivered to Mixpanel in real time. Click **Link event source…** and select one or more sources to define where events should originate from. [Link event source](https://www.krenalis.com/docs/activate-events/images/link-event-source.png)! If no event sources are available, you can continue with the setup and link a source later. Keep in mind that event delivery cannot be tested until at least one source is connected. ### 4. Define a pipeline for each event Krenalis lets you send different types of events to Mixpanel by creating a dedicated pipeline for each one. Each pipeline specifies how a particular event is delivered — for example, a "Purchase Completed" event or an "Order Shipped" event. Select an event from the list and click **Add pipeline…** to link it with Mixpanel. To configure more events, click **Add new pipeline ⊕** and select another event from the list. Repeat this process to define all the events you want to send to Mixpanel. [Add pipeline](https://www.krenalis.com/docs/activate-events/images/add-mixpanel-pipeline.png)! ### 5. Set event conditions Based on the event selected in the previous step, set a filter that defines the conditions the incoming event must meet. Filters let you control exactly when an event should be sent to Mixpanel — for example, only when specific properties or user pipelines occur. [Filter events](https://www.krenalis.com/docs/activate-events/images/filter-events.png)! For example, the filter above can be used to send an "Order Completed" event. In this case, Krenalis sends the event only when both conditions are true: the event type is **track** and the event name is **Order Completed**. This ensures that only relevant events are sent to Mixpanel, avoiding duplicates and keeping your analytics data clean. ### 6. Set event parameters Next, define how the event data is sent to Mixpanel by mapping your event fields to the parameters expected by Mixpanel. Each parameter you configure determines how Krenalis transforms and delivers the event payload. [Event parameters](https://www.krenalis.com/docs/activate-events/images/transform-mixpanel-event.png)! For example, you can map the properties of the incoming event so that the event name and attributes follow Mixpanel's expected structure. In the example shown, the string **"Order Completed"** is mapped to the event name, and several fields from **properties** are mapped to the corresponding keys in **properties** (such as order_id, revenue, and currency). This ensures that each event sent to Mixpanel includes all the necessary details for accurate tracking and analysis. ### 7. Save your changes When everything looks good, click **Add** (or **Save** if you're editing an existing pipeline). The new pipeline will appear in the Mixpanel connection page. To send additional events to Mixpanel, repeat the process starting from the [Define a pipeline for each event](#4-define-a-pipeline-for-each-event) step. ## Pipelines Once saved, the new pipeline appears in the pipelines list for Mixpanel. From here, you can monitor deliveries, adjust filters, and event parameters. Each pipeline defines how and when events flow from sources to Mixpanel. With a single Mixpanel connection, you can create multiple event pipelines, each dedicated to a specific event type you want to send. [Pipeline to export user data](https://www.krenalis.com/docs/activate-events/images/pipelines.mixpanel.png)! | Column | Description | |--------------|---------------------------------------------------------------------------------------| | **Pipeline** | Name and description of the pipeline. | | **Filters** | Conditions used to select which events are sent. If not set, all events are included. | | **Enable** | Switch to activate or deactivate the pipeline. When disabled, no events are sent. | | **Manage** | Edit settings such as filter and transformation. | | **⋮ (More)** | Additional options, such as deleting the pipeline. |