Mouseflow Help & Support

Optimizely Integration


With Mouseflow, it's easy to integrate with Optimizely to get recordings and heat maps of A/B test variations.

Simply add the snippet below to the relevant pages:

<script type="text/javascript">
if (window["optimizely"] && window["optimizely"]["data"]) { var optimizely = window["optimizely"]; var optimizelyData =; optimizely.push({ type: 'integration', OAuthClientId: '5402630847' }); var activeExperiments = optimizelyData.state.activeExperiments; var variationNames = ""; window._mfq = window._mfq || []; for (var i = 0; i < activeExperiments.length; i++) { var experimentId = activeExperiments[i]; var variationName = optimizelyData.state.variationNamesMap[experimentId]; 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; }


Note that you need to replace the 'OAuthClientId' in the above example, to match the Client ID from your Optimizely App.

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.

With this in place, data will be bucketed into separate heat maps based on your test variations. You can also filter the recording list based on the experiment and value names.

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


If you have questions or need help, feel free to open a ticket or call us at +1 (855) 668-7335.

Tags: integrate optimizely a/b testing multiple version

Have more questions? Submit a request


Powered by Zendesk