The Mixpanel integration is available on Observe or
plans.
The mixpanel object must be exposed globally
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.
The Mixpanel integration enables you to filter session data in Hotjar 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.
- How to enable the Mixpanel integration
- How to filter session data by Mixpanel events
- How to trigger a Hotjar survey or feedback widget based on a Mixpanel event
How to enable the Mixpanel integration
Admin or Account Owner permissions are required
Only an Admin in your Hotjar Organization, or the Account Owner of your Hotjar account can enable the integration. Find out who the Admins and Account Owner are from your Team page.
Visit your Integrations page and select the site that will receive the integration. Then click Connect for Mixpanel.
Turn on Automatically send events to Hotjar to enable the integration.
How to filter session data by Mixpanel events
Before filtering, the Mixpanel integration must be enabled with at least one session captured in Hotjar
This integration first needs to be enabled inside Hotjar to apply Hotjar filters based on Mixpanel events. You will only see Mixpanel events appear in your Hotjar filter dropdown after Hotjar has captured at least one session that contains the Mixpanel event.
Mixpanel events can be used to filter Hotjar session data. Hotjar tools that use session data include Heatmaps, Recordings, Funnels, and the Dashboard and Trends pages. It doesn't include Feedback widgets or Surveys.
Inside a Hotjar tool that uses session data, click Add filter and select Event.
Start typing MP_ followed by the Mixpanel event name to find the relevant event.
All Mixpanel events will appear in Hotjar with the MP_ prefix.
Why can't I see any events listed?
Hotjar will only receive Mixpanel events when at least one session has been captured containing the event. If this is taking longer than expected, ensure that Session Capture is enabled and that any targeting settings will capture your Mixpanel events.
Select the Mixpanel event to filter by, then click Apply.
You'll now see only those sessions from users associated with the selected Mixpanel event.
How to trigger a Hotjar survey or feedback widget based on a Mixpanel event
The Mixpanel integration is available on Observe or
plans.
Visit the Targeting section in the set up of a survey or feedback widget.
If you're creating a new survey or feedback widget, see our How to Set Up Feedback and How to Create a Survey guides for further help.
Within the Pages subsection, select Specific pages and choose Event in the dropdown menu.
Enter the Event value using the MP_ prefix.
You'll need to know the exact Mixpanel event name that you're targeting.
To target a feedback widget or survey based on a Mixpanel event, you'll need to know the exact name for the Mixpanel event. This event name can be entered in the Event field in your survey or feedback setup, adding MP_ as the prefix.
Click Save changes and ensure the status of your survey or feedback widget is Active.
Your survey or feedback widget 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).