Mixpanel Integration

Product Fruits can be integrated with Mixpanel in two ways. We can send events to Mixpanel or we can receive cohorts information from Mixpanel.

Sending events to Mixpanel

To send events to Mixpanel, go to Integrations (plug icon) on the left side of your administration page and select Mixpanel to activate the integration.

The Mixpanel integrations page of the Product Fruits administration

The integration detects Mixpanel SDK in your application and it uses the window.mixpanel.track() method.

Please note, if you bundled the Mixpanel SDK via their NPM package, you must make the Mixpanel object visible in the window object. We cannot see the Mixpanel SDK in your application otherwise.

Receiving cohort information from Mixpanel

This integration is a part of the Boost plan. 

You can get cohort information to Product Fruits via the Mixpanel webhooks integration. This integration will create the mixpanel_cohorts custom user property. This property is an array of Mixpanel cohort IDs. 

Before you use this integration, consider the following:

  • Mixpanel sends webhook updates only once per 30 minutes (this is one of Mixpanel's limitations). That means you cannot use this integration for real-time content triggering.
  • Emails must be passed into Mixpanel and Product Fruits - we match users based on the Mixpanel $email field (the $ is important as it's a built-in Mixpanel user property). Without emails, we cannot assign cohort data to PF users. 

Setup

To activate the integration, go to Integrations -> Mixpanel and click on Activate.

An example of a Webhook URL Username and Password for setting up the Mixpanel integration in the Product Fruits administration

Then decide whether you want to allow importing users who haven't been tracked in Product Fruits before. If you enable this option, we will create new users using the Mixpanel $email field as the Product Fruits username field.

Now copy the Webhook URL, Username, and Password. Then go to the Mixpanel Custom webhook integration section and create a new webhook connection.

The Integrations page within the Mixpanel platform

The last thing you need to do is to mark individual cohorts to export. Go to Cohorts in Mixpanel, select the cohorts you want to export, and enable the recurring export.

An exampl of the cohorts screen in the Mixpanel platform
An example of an Export to Custom Webhook sync in the Mixpanel platform

This will start the sync. The sync is done by Mixpanel in 30-minute intervals (despite the label in the dialog saying 15 minutes). This means you won't see the data immediately.

Was this article helpful?