Mixpanel

Last updated on May 30, 2023

Mixpanel is an analytics tool that allows you to understand how users interact with your product, enabling you to identify behavioral trends and take informed decisions, such as identifying accounts for upselling, monitoring the health of an account, or customizing features, to drive product engagement and retain customers.

You can configure Mixpanel as a Target in Activate to curate the raw user data from your data warehouse and analyze it, allowing you to take actions such as releasing experimental product features to a niche group of users or sending targeted messages to accounts that are at risk to churn.


Prerequisites

  • A user with an Owner or Admin role to log in to your Mixpanel account. Read Organization Roles and Permissions to know more about the privileges assigned to each role.

  • A service account username created with an Owner or Admin role in the Mixpanel project with which you want to synchronize your Warehouse data. Read Managing Service Accounts if you need to create a service account.

  • The service account username and secret are available to Hevo. Mixpanel requires this information to authenticate any app connecting via its Ingestion APIs.


Configuring Mixpanel as a Target

Perform the following steps to configure Mixpanel as the Target in your Activation:

  1. Click Activate in the Navigation Bar.

  2. Do one of the following:

    • Select the TARGETS tab in the Targets List View, and click + CREATE TARGET.

      Create Target

    • Select the ACTIVATIONS tab in the Activations List View, and click + CREATE ACTIVATION.

      Create Activation

      1. In the Select Warehouse page, select your Activate Warehouse or click + ADD WAREHOUSE to add a new warehouse. Read Activate Warehouses to configure the selected Warehouse type.

      2. In the Select a Target page, click + ADD TARGET.

        Select a Target

  3. In the Select a Target Type page, click on Mixpanel.

    Select Mixpanel as a Target

  4. In the Configure your Mixpanel Target page, specify the following:

    Configure your Mixpanel Target

    • Target Name: A unique name for your Target.

    • Project ID: The ID of the Mixpanel project with which you want to synchronize data.

    • Project Token: The unique alphanumeric value created by Mixpanel for the selected project ID.

    • Service Account Username: The username of a Mixpanel user with Admin or Owner access to your Mixpanel project.

    • Service Account Secret: The secret value associated with the selected service account username that acts as a password.

  5. Click TEST & CONTINUE.

    You can view the new Target in the Targets List View. If you are creating an Activation, you return to the Select Data to Synchronize page. Refer to the section, Mapping Fields in Mixpanel to know how to map the Warehouse fields to your selected Target object.

    Created Mixpanel Target


Mapping Fields in Mixpanel

An Activation uses the SQL query you provide in the Select the Data to Synchronize page to identify the data from your Warehouse. You must then map the query Warehouse fields to the selected Target fields to complete creating your Activation. Read Map Warehouse fields to Target fields for the steps to do this.


Obtaining the Project ID and Project Token

Perform the following steps to retrieve the ID and token of the Mixpanel project with which you want to synchronize data:

  1. Log in to your Mixpanel account as a user with an Admin or Owner role.

  2. Select your project from the drop-down list in the top right corner of the Mixpanel user interface.

    Select your Project

  3. Click the Settings ( ) icon, and select Project Settings from the drop-down.

    Open your Mixpanel Project Settings

  4. In the Project Settings page, Overview tab, do the following:

    Retrieve the Project ID and Token

    • Copy the Project ID from the Project Details section.

    • Scroll down to the Access Keys section, and copy the Project Token.

You must provide these values while creating the Mixpanel Target.


Data Replication

Activate supports the following synchronization behaviors for Mixpanel:

  • Insert New and Update Existing Records (Upsert)

  • Add New Records (Insert)

Refer to the Data Model section for the synchronization behavior that applies to each supported object.

Data is synchronized with the supported Mixpanel objects using the batch update and the import Ingestion API endpoints. While the batch update API endpoints require a project token for authentication, the import API endpoints are authenticated using the project’s service account.

Activate uses the following identifiers while synchronizing the data:

Unique Identifier Description
distinct_id A unique value to identify a user.
group_id A unique value that identifies users grouped based on an alternative identifier, such as a company ID or an account ID.

You can also synchronize data with any custom fields already existing in your Mixpanel object or the new ones added to the selected object while creating an Activation. Read this section for the steps to add a custom field to your Mixpanel object.


Data Model

The following table lists the objects supported by Activate and their unique identifiers and synchronization behavior(s):

Object Unique Identifiers Synchronization Behavior(s) Description
Events There are no unique identifiers, only mandatory fields. Insert Stores details about all the interactions between a user and your product. For example, a music service app may track the number of users listening to a particular song as an event.
User Profiles distinct_id Upsert Stores details about the properties that describe a user and the events they performed. A user profile provides the most recent information about a user.

The distinct ID connects the events performed by the user to their profile.
Group Profiles group_id Upsert Stores details about the properties and event history specific to users grouped by a property other than distinct ID.

For the following Mixpanel objects, you must map a query field to the mandatory Target field:

Object Field Name Description
Events    
  event_name The name for the event that you want to track. For example, an event named SignUp.
  time The time at which the event occurred, in seconds or milliseconds, since Jan 01, 1970 (Unix epoch time).
  distinct_id A unique value to identify the user performing the event.
  $insert_id A unique alphanumeric string of up to 36 characters to identify events and deduplicate them.
Group Profiles    
  group_key A unique name for the group ID of the group profile. For example, if your group ID is the company_id property, your group key can be named, Company.

Target Considerations

  • Mixpanel does not allow certain values in the properties, distinct_id and $insert_id of the Events object and throws an error if it encounters such data. In the case of such an error, Activate fails the records and marks them as not loaded.

  • Mixpanel imposes a limit on the number of API requests and the payload size, and this differs based on the object. As Activate uses these APIs to synchronize the data, it is subject to these limits.

    Refer to the following table for the applicable rate limits and payload sizes:

    Object Rate Limit Payload Size
    Events NA 2 GB of uncompressed JSON/minute or ~30K events/second, measured on a rolling 1-minute basis.
    User Profiles 2000 profile updates/request Each individual update not to exceed 1 MB/request.
    Group Profiles 200 profile updates/request Each individual update not to exceed 1 MB/request.



Revision History

Refer to the following table for the list of key updates made to this page:

Date Release Description of Change
Aug-10-2022 1.92 New document.

Tell us what went wrong