The Mixpanel integration enables you to filter session data by Mixpanel events. To use this integration, the mixpanel object must be exposed globally as the integration makes use of Mixpanel events from the client side and not from the server side. Mixpanel event properties are also ignored and filtering is only available based on the Mixpanel event name.
Note: 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.
How to enable the Mixpanel integration
1. On your Integrations page, find the Mixpanel integration, and click 'Connect'.
2. Turn on 'Automatically send events' to enable the integration.
How to use Mixpanel events in segmentation?
You can use the 'Add filter' option in your platform capabilities to apply Mixpanel events, for example Session Replay.
Follow these steps to use Mixpanel events in Session Replay:
1. Click on 'Add filter'.
2. Select 'Mixpanel'.
A window will appear, allowing you to select your Mixpanel events.
How to trigger a survey based on a Mixpanel event
1. Visit the 'Targeting 'section in the set up of a survey.
2. Within the Pages subsection, select 'Specific pages' and choose 'Event' in the dropdown menu.
3. Enter the Event value using the MP_ prefix.
Note: You'll need to know the exact Mixpanel event name being targeted.
To target a survey using a Mixpanel event, you'll need to know the name of that specific event. This can be entered in the 'Event' field in your survey setup, adding "MP_" as the prefix.
If an event name contain 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".
4. 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).