Integrating Convert Experiences with Triple Whale Analytics allows you to track experiments and variations directly within Triple Whale.
This integration enables you to analyze user behavior specific to each variation of your experiments, enhancing your conversion rate optimization efforts.
For each experiment, the integration uses custom events to pass along the experiment name and variation name that the visitor is currently bucketed into.
If you haven’t already, sign up for a Triple Whale Analytics account:
To start tracking user interactions, you need to add both the Convert Experiences tracking code and the Triple Whale Pixel to your website.
Ensure the Convert tracking code is installed on all pages where your experiments run:
Add the Triple Whale Pixel to your website to enable analytics tracking:
To send experiment and variation data from Convert to Triple Whale, add the following code to your website. This code sends custom events containing the experiment and variation names to Triple Whale Analytics.
Add the code below to your website right after the Convert and Triple Whale tracking codes.
This is the code you need to insert in your Convert Project Configuration Global Project JavaScript:
// Function to handle the data sending to Triple Whale function sendDataToPlatform(data) { if (typeof triple === "function") { data.forEach(item => { triple('track', 'Convert Experiment Viewed', { experimentName: item.expName, variationName: item.varName }); console.log("Sent data to Triple Whale: experimentName =", item.expName, "variationName =", item.varName); }); } else { console.error("Triple Whale function is not available."); } } // Function to check if a library (e.g., Triple Whale) is loaded, with a timeout function whenAvailable(name, callback) { const maxTime = 150 * 1000; // Maximum time to wait in milliseconds (2.5 minutes) const interval = 100; // Poll every 100 milliseconds let elapsedTime = 0; // Track the elapsed time var intervalId = setInterval(function() { if (window[name]) { clearInterval(intervalId); callback(); } else if (elapsedTime > maxTime) { clearInterval(intervalId); console.error(name + " library did not load in time."); } elapsedTime += interval; }, interval); } // Convert snippet lifecycle hook for experiences evaluated window._conv_q = window._conv_q || []; window._conv_q.push({ what: 'addListener', params: { event: 'snippet.experiences_evaluated', handler: () => { console.log("All experiments have been evaluated"); // Prepare the data for each experiment and variation const allData = Object.keys(convert.currentData.experiences).map(expId => { const expData = convert.currentData.experiences[expId]; const variation = expData.variation; let experimentName = convert.data.experiences.find(exp => exp.id === expId)?.name || 'Unknown Experiment'; return { expName: experimentName, varName: variation.name }; }); // Wait for the Triple Whale library to be available whenAvailable('triple', function() { // Once Triple Whale is available, process and send data sendDataToPlatform(allData); }); } } });
Explanation of the Code:
Steps to Implement:
After setting up the integration, you can monitor the experiment data within Triple Whale Analytics.
View details such as experimentName and variationName to analyze how users interact with different experiments.