Integrate Convert Experiences with RudderStack
Sync Convert Data with RudderStack for Advanced Customer Insights
| Author: |
Dionysia Kontotasiou
|
THIS ARTICLE WILL HELP YOU:
- Convert-Rudderstack Integration
- Add Tracking Code Snippets
- Send Events to RudderStack
- View Convert Data in RudderStack
Convert-Rudderstack Integration
RudderStack is an open-source, warehouse-first customer data platform (CDP) that builds your CDP on your data warehouse for you. It provides a powerful transformation framework to process your event data on the fly.
For each experiment, the integration uses semantic track events to pass along the experiment name and variation name that the visitor is currently bucketed into (if any).
Add Tracking Code Snippets
Make sure the Convert tracking code and the RudderStack tracking code (rudder-analytics.js) are installed on your page. You will need your Write Key and Data Plane URL that you can find in your Rudderstack account:

Send Events to RudderStack
The example code below uses the track API call to send Convert experience and variation names to RudderStack. Add it to Project > Configuration > Global Project Javascript. It waits until Convert has evaluated the experiences on the page and RudderStack 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.rudderanalytics && rudderanalytics.track; }, function () {
rows.forEach(function (row) {
rudderanalytics.track('Convert Experiences', {
Exp_Name: row.experienceName,
Var_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 RudderStack
Using a semantic event in RudderStack, you will be able to view all of your Convert Experiences data as they associate to the values that you pass in the event.
When you log in to your RudderStack account, you should go to your Live Events. There, you can see all of the track events that you are sending through RudderStack.
