Mouseflow Help & Support

Optimizely Integration

Follow

With Mouseflow, it's easy to integrate with Optimizely. This lets you filter the recording list, heatmap list, funnels, and form analytics reports.

Just add the snippet below to the relevant pages:

<script type="text/javascript">
if (window["optimizely"]) {
	var optimizelyData = optimizely.get('data');
    var optimizelyState = optimizely.get('state');
    var activeExperiments = optimizelyState.getActiveExperimentIds();
    var variationMap = optimizelyState.getVariationMap();
    var variationNames = "";
    window._mfq = window._mfq || [];
    for (var i = 0; i < activeExperiments.length; i++) {
        var experimentId = activeExperiments[i];
        var variationName = variationMap[experimentId]['name'];
        var experimentName = optimizelyData.experiments[experimentId].name;
        variationNames += (variationNames != "" ? "/" : "") + 
            experimentName + ":" + variationName;
        window._mfq.push(["setVariable", "optimizely_" + experimentName, variationName]);
    }

    if (variationNames)
        window.mouseflowPath = window.location.pathname + "/" + variationNames;
}
</script>

This sets the variable "mouseflowPath" to the actual name of the page,  plus the Optimizely Experiment Name and Variation Name. It also tags each recording with this information.

Please note: Optimizely's redirect experiments aren't supported in this integration.

Tags:integrate optimizely a/b testing multiple versions

Have more questions? Submit a request

Comments

Powered by Zendesk