Skip to content
  • There are no suggestions because the search field is empty.

Integrate Convert Experiences with Roistat

 Connect Convert with Roistat for Advanced Analytics & Marketing Attribution

THIS ARTICLE WILL HELP YOU:



Convert-Roistat Integration

Integration of Roistat with Convert Experiences will help you to import Convert data into your Roistat reports and dashboards. 

For each experiment, the integration can pass along the experiment name and variation name that the visitor is currently bucketed into.

Add Tracking Code Snippets

Make sure the Convert tracking code is installed on your page.

Then, create a Roistat account. On every page that you want to install Roistat, paste the code snippet inside the HTML <body> tag. 

Send Custom Events

You should then create through the Developments menu the custom event you want to send. The code below sends an event with the ID convert_experience, with the experience name and variation name that the website visitor is bucketed into.

Add this code to Project > Configuration > Global Project Javascript. It waits until Convert has evaluated the experiences on the page and Roistat 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.roistat && roistat.event && roistat.event.send; }, function () {
rows.forEach(function (row) {
roistat.event.send('convert_experience', {
'Experiment Name': row.experienceName,
'Variation 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 Roistat

The Custom Events will now be included in every Roistat visit.