Support Center

How can I integrate Optimizely with Mixpanel?

Last Updated: Dec 05, 2012 08:52AM PST
Mixpanel users now have the option of including an Optimizely experiment and variation names directly into Mixpanel reports. Optimizely will automatically populate a Mixpanel super property to all events triggered for that user. 
 
To setup integration with Mixpanel you need to install the Mixpanel javascipt snippet** AFTER the Optimizely snippet on your page. This will allow Optimizely to properly set the Mixpanel super properties before any Mixpanel events are sent.
 
To enable Mixpanel intergration for an experiment within the editor, click on Options (top right corner) and select Analytics Integration. Then click "Enable" next to "Mixpanel Integration". Now you can segment your existing funnels and metrics by your Optimizely experiments. The name of the property is the name of the experiment prefixed with "Optimizely " and the values are your variation names. (i.e. "Optimizely {{Experiment Name}}": "{{Variation Name}}")



**Note that there has been a recent update to the Mixpanel javascript snippet required for Optimizely integration. The new version of the snippet has an additional parameter for passing in an existing mixpanel array. Make sure to change 'YOUR_TOKEN' to the project token from your Mixpanel dashboard.
<script type="text/javascript">
    (function(d,c){var a,b,g,e;a=d.createElement("script");a.type="text/javascript";
    a.async=!0;a.src=("https:"===d.location.protocol?"https:":"http:")+
    '//api.mixpanel.com/site_media/js/api/mixpanel.2.js';b=d.getElementsByTagName("script")[0];
    b.parentNode.insertBefore(a,b);c._i=[];c.init=function(a,d,f){var b=c;
    "undefined"!==typeof f?b=c[f]=[]:f="mixpanel";g=['disable','track','track_pageview',
    'track_links','track_forms','register','register_once','unregister','identify',
    'name_tag','set_config'];
    for(e=0;e<g.length;e++)(function(a){b[a]=function(){b.push([a].concat(
    Array.prototype.slice.call(arguments,0)))}})(g[e]);c._i.push([a,d,f])};window.mixpanel=c}
    )(document,window.mixpanel||[]);
    mixpanel.init("YOUR_TOKEN");
</script>

Once you start your experiment, the data should be available to mixpanel within minutes. Below is an an example of using mixpanel to evaluate the funnel performance of two distinct variations.

desksupport@optimizely.com
http://assets2.desk.com/r1046ffeaa2233e531563a32d7edef6677d8a78b5/javascripts/
false
@Optimizely
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/portal/articles/autocomplete