Integrations
Table of contents
In short
We have put together code snippets for common tools that you can use to easily integrate your experiments with the corresponding tool.
Tool integrations
MS Clarity
Send experiments with Google Tag Manager to MS Clarity
If you use the Google Tag Manager on your website, we recommend that you send the experiment information to MS Clarity via a user-defined HTML tag. This has the advantage that experiments are automatically sent to MS Clarity once the tag has been created.
- Create a custom HTML tag
- Insert the following JavaScript code
- Use the existing trigger "Varify event" as the trigger.
To do this, create a new custom HTML tag and insert the following JavaScript code:
NoteIf you have not created the "VA - Short" variable for tracking, but use the variables "VA - Experiment" and "VA - Variation", use this code instead:
Send experiments to MS Clarity without Google Tag Manager
To be able to segment by experiment participants in MS Clarity, you must insert a code snippet in Add JavaScript of the corresponding variant.
The following JavaScript code can be used to send Experiment ID and Variant ID to MS Clarity.
Important: Exchange the Experiment ID and Varaition ID according to the experiment (line 1 and 2).
var experimentId = 1234;
var variationId = 4567;
// Tagging a session in MS Clarity with experiment and variation IDs
if (typeof window.clarity === 'function') {
window.clarity("set", "Experiment-ID:" + experimentId, "Variation-ID:" + variationId);
} else {
console.log("Clarity is not available.");
}
Mouseflow
To have the possibility to segment by experiment participants in Mouseflow, you have to insert a code snippet in Add JavaScript of the corresponding variant.
The following JavaScript code can be used to send the experiment ID to Mouseflow.
Important: Replace the experiment ID according to the experiment (line 1).
var experimentId = 1234;
// Tagging a session in Mouseflow with experiment ID
window._mfq = window._mfq || [];
window._mfq.push(["tag", "Experiment-ID : " + experimentId]);
Hotjar (BETA)
To be able to segment by experiment participant in Hotjar, you must insert a code snippet in Add JavaScript of the corresponding variant.
The following JavaScript code can be used to send Experiment ID and Variant ID to Hotjar.
Important: Exchange the Experiment ID and Varaition ID according to the experiment (line 1 and 2).
var experimentId = 1234;
var variationId = 4567;
// Tagging a session in Hotjar with experiment and variation IDs
window.hj = window.hj || function() { (hj.q = hj.q || []).push(arguments); };
hj('tagRecording', ["Experiment-ID : " + experimentId, "Variation-ID : " + variationId]);
Contentsquare
To be able to segment by experiment participants in Contentsquare, you must insert a code snippet in Add JavaScript of the corresponding variant.
The following JavaScript code can be used to send Experiment ID and Variant ID to Clarity.
Important: Exchange the Experiment ID and Varaition ID according to the experiment (line 1 and 2).
var experimentId = 1234;
var variationId = 4567;
// Tagging a session in Contentsquare with experiment and variation IDs
window._uxa = window._uxa || [];
window._uxa.push(["trackDynamicVariable", {key: "Experiment-ID : " + experimentId, value: "Variation-ID : " + variationId}]);