Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideProduct feedbackGitHubNuGetDev CommunitySubmit a ticketLog In

Integrate Mixpanel

Integrate Optimizely Web Experimentation with Mixpanel to read data from and see reporting on Optimizely Web experiments in Mixpanel.

If you use Mixpanel to monitor your site’s traffic, you can view Optimizely experiment results alongside the rest of the data you collect through Mixpanel. The integration lets you see how your Optimizely experiments affect how users interact with your site or app in Mixpanel.

Optimizely Web Experimentation automatically populates a Mixpanel super property that includes campaign or experiment bucketing information for all events triggered for visitors. Then, Optimizely sends a decision event to Mixpanel to ensure that all visitors are tracked.

Here are a few more reasons to set up this integration:

  • Get a direct view of how Optimizely experiments affect the metrics you track in Mixpanel.
  • See Mixpanel data for each variation in your experiment (or experience in your campaign).
  • Filter Mixpanel reporting to include visitors who were successfully included in an Optimizely experiment and exclude visitors who were not.

Set up the integration

The Mixpanel JavaScript snippet must be installed on the pages of your site where you'd like to track visitor behaviors as events. You can arrange the Optimizely Web Experimentation and Mixpanel snippets in any order -- you don't have to place the Optimizely snippet first. Alternatively, you can install the Mixpanel SDK onto your application. 

View Optimizely Web Experimentation data in Mixpanel

In order to enable Mixpanel for your Optimizely experiment, you must enable it for your project and then add it to your specific experiment. Instructions on how to do so follow.

Steps to enable Mixpanel for the entire project:

  1. In Settings on the Optimizely Web Experimentation App, click the Integrations tab. 
  2. Select Mixpanel from the list of Integrations.
  3. Enable Mixpanel by toggling it On.
  4. Select Accept on the Turn on Integration window.
  5. Optionally, check Enable the Mixpanel integration by default for all new experiments
  6. Select Save to complete the process.

Steps to enable Mixpanel for an individual experiment:

  1. In the Campaign or Experiment Overview, click the Integrations tab.
  2. Enable the Mixpanel integration for the campaign/experiment by toggling on the checkbox labeled Tracked.
  3. Click Save.
  4. Publish the campaign/experiment to start tracking with Mixpanel.

📘

Note

Your Optimizely experiment or campaign must be running for the Mixpanel integration to work.

After you start your campaign or experiment, you can expect the data to be available to Mixpanel within minutes.

You can segment your existing funnels and metrics by your Optimizely campaigns and experiments and format the Optimizely super property follows:

For a Personalization Campaign:

{  
   '\<campaign\_name> (\<campaign\_id>)': '\<experience\_name> (\<experience\_id>)',  
   '\<experience\_name> (\<experience\_id>)': '\<variation\_name> (\<variation\_id>)',  
   'HB \[\<campaign\_name> (\<campaign\_id>)\]': false,  
}

📘

Note

'HB' means holdback. This property signifies whether a visitor was kept in the campaign holdback.

For an A/B Test:

{  
   '\<experiment\_name> (\<experiment\_id>)': '\<variation\_name> (\<variation\_id>)'  
}

After Optimizely Web Experimentation sets the super property, it sends an event to mark that a campaign or experiment decision has been made. This event is formatted like this:

For a Personalization Campaign:

Campaign Decided: \<campaign\_name> (\<campaign\_id>)

For an A/B Test:

Experiment Decided: \<experiment\_name> (\<experiment\_id>)

Here is an example of using Mixpanel to evaluate how two different variations in an experiment affect a funnel:

Troubleshoot issues

I am not seeing any Optimizely data in Mixpanel. What's going on?

Your Optimizely Web campaign or experiment must be running for the Mixpanel integration to work. Use theMixpanel Log or Mixpanel Tools Chrome extensions to confirm whether the Optimizely decision event is being sent when your experiment is loaded.