The Mixpanel integration enables you to filter session data by Mixpanel events, giving you more precise ways to segment users and trigger surveys based on user actions.
Some key use cases include:
- Segmenting users in Contentsquare using Mixpanel event names.
- Targeting surveys based on user-triggered Mixpanel events.
- Analyzing the behavior of users who triggered specific Mixpanel events.
Before you begin
- The Mixpanel object must be globally exposed in your environment.
- This integration relies on client-side Mixpanel events, not server-side events.
- Only the Mixpanel event name is used for filtering. Event properties are ignored.
Installing the Mixpanel SDK via npm
When installing Mixpanel SDK via npm, the mixpanel object is not available globally by default. You have to expose it manually to the global window object.
We collect the following data:
Key | Value | Type |
---|---|---|
MP_{EventName} | EventName | Text |
How to connect
1. On your Integrations page, find the Mixpanel integration.
2. Click Connect.
3. Toggle on Automatically send events to enable the integration.
How to use
Using Mixpanel events in segmentation
1. Open a capability, such as Session Replay.
2. Click on Add filter.
3. Select Mixpanel.
A selection window will appear where you can browse and select your events.
Triggering a survey based on a Mixpanel event
1. In the survey setup, navigate to the Targeting section.
2. Under Pages, select Specific pages.
3. In the dropdown menu, choose Event.
4. Enter the event value using the MP_ prefix.
To target a survey using a Mixpanel event, you'll need to know the name of the specific event. If an event name contains spaces, the spaces need to be replaced with dashes in the survey targeting. For example, the Mixpanel event name "My survey event" would become "MP_My-survey-event".
5. Click Save changes and ensure the status of your survey is Active.
Your survey will appear when the event you've specified is triggered on a page. When using events for surveys, your behavior rules will still be followed. For example, you can set a survey to open after 10 seconds and use an event for targeting. In this case, the survey will appear 10 seconds after the event has been triggered, not 10 seconds after the page loaded.