Integrate Convert Experiences with Mixpanel
Track Convert Experiments in Mixpanel for Deeper Analytics Insights
| Author: |
Dionysia Kontotasiou
|
THIS ARTICLE WILL HELP YOU:
- Convert-Mixpanel Integration
- Add Tracking Code Snippets
- Enable the built-in integration
- View Convert data in Mixpanel Live View
- Add Convert Experiments to a Mixpanel Implementation
- View Convert data in Mixpanel Experiments
Convert-Mixpanel Integration
Integrating Convert Experiences with Mixpanel will let you view the reports inside Mixpanel filtered by a certain Experiment - Variation pair allowing to see how specific variation performs for different of your metrics set up inside Mixpanel.
Add Tracking Code Snippets
Make sure the Convert tracking code is installed on your page.
Then, create a Mixpanel account. On every page that you want to install Mixpanel, paste the code snippet.
Enable the built-in integration
After setting up the experiment variations go to Experiment Summary by editing the experiment. In there, inside the Settings area, you will see if the integration is enabled or not.

View Convert data in Mixpanel Live View
After experiment is running and Mixpanel integration is activated, you will start seeing in your Mixpanel Live View, for every visitor that participated in an experiment, a new property named like "Convert - [Experiment name here]" and which has as value the variation name presented to that visitor.

Add Convert Experiments to a Mixpanel Implementation
Once you have the two tracking codes in your website, you could also add this extra code to track custom experiment events (one for experiment name and one for variation name of the Convert experiments you are running).
Add it to Project > Configuration > Global Project Javascript. It waits until Convert has evaluated the experiences on the page and Mixpanel has loaded, then sends one event for each experience the visitor is in. When data anonymization is on in your project, it sends the experience and variation IDs instead of the names.
This code works with the current Convert tracking script. If your project still uses the Legacy tracking script, move to the current script first. For more on the window.convert object, see The window.convert Object in the developer docs.
window._conv_q = window._conv_q || [];
window._conv_q.push({
what: 'addListener',
params: {
event: 'snippet.goals_evaluated',
handler: function () {
var rows = getConvertData();
whenReady(function () { return window.mixpanel && mixpanel.track; }, function () {
rows.forEach(function (row) {
mixpanel.track('Convert_Experiences', {
'Experiment name': row.experienceName,
'Variant name': row.variationName
});
});
});
}
}
});
// Returns the experiences the visitor is in on this page, with their variation.
// With data anonymization on, it uses IDs instead of names.
function getConvertData() {
var rows = [];
var current = convert.currentData.experiences || {};
var configured = convert.data.experiences || [];
var settings = convert.data.project && convert.data.project.settings;
var anonymize = !!(settings && settings.data_anonymization);
for (var experienceId in current) {
if (!current.hasOwnProperty(experienceId)) continue;
var variation = current[experienceId].variation || {};
var experience = configured.filter(function (e) {
return String(e.id) === String(experienceId);
})[0];
rows.push({
experienceId: experienceId,
variationId: String(variation.id),
experienceName: anonymize ? experienceId : (experience ? experience.name : experienceId),
variationName: anonymize ? String(variation.id) : variation.name
});
}
return rows;
}
// Waits up to 10 seconds for the tool's code to load, then sends the data.
function whenReady(isReady, send) {
var tries = 0;
(function check() {
if (isReady()) return send();
if (tries++ < 50) setTimeout(check, 200);
})();
}
View Convert data in Mixpanel Experiments
Once you add the manual code from above you will be able to see your Convert data to the Mixpanel Experiments:

We hope you enjoy the new Mixpanel integration!
Note: when you turn on data anonymization, the names of variations and experiments will be replaced by their IDs.
