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

Integrate Convert Experiences with Plausible

Privacy-Friendly Convert Experiment Tracking with Plausible Analytics

Author:
Dionysia Kontotasiou

THIS ARTICLE WILL HELP YOU:



Introduction

Plausible.io is a privacy-friendly analytics service that is an attractive alternative to Google Analytics. It only stores data that enables a simple analysis of visits to your website. In doing so, Plausible does not track the user across multiple websites (does not store cross-site cookies).

With the Convert-Plausible integration, unique visitors to your experiments’ variations will be passed into Plausible using custom event goals.

Read more about how you can use Plausible as an alternative to GA.

Add Tracking Codes

To set up the integration, you should install the Plausible tracking code according to their instructions. It looks like this:

 

You should also install the Convert tracking code (instructions can be found here).

Custom Event Goals

Create a Plausible custom event goal

Example of the data we send to Plausible:
current Experiment Name*, current Variation*

* Depends on whether you have chosen data anonymization or not (more information on this can be found here)

Enable the Integration Manually

This example code can send Experiment and Variation names to your Plausible goal:

var configData = window['convert']['data']['experiments'] || window['convert']['data']['experiences'] || {};
var isArray = Array.isArray(configData);

// Get current experiments/experiences
var currentExperiments = window['convert']['currentData']['experiments'] ||
window['convert']['currentData']['experiences'] || {};

// Helper function to find experience in config
function getExperienceFromConfig(id) {
if (isArray) {
// Latest: Array of objects - need to find by id
return configData.find(function(exp) {
return String(exp.id) === String(id);
}) || null;
} else {
// Legacy: Object keyed by id
return configData[id] || null;
}
}

for (var key in currentExperiments) {
if (!currentExperiments.hasOwnProperty(key)) {
continue;
}

var currentExperiment = currentExperiments[key];
var configExperience = getExperienceFromConfig(key);

// Get experiment name
// Legacy: .n or .test_name | Latest: .name
var curExperimentName = "unknown experiment name";
if (configExperience) {
curExperimentName = configExperience.n || configExperience.name || configExperience.test_name || curExperimentName;
}
curExperimentName = curExperimentName.replace("Test #", "Test ");

// Get variant name
// Legacy: variation_name | Latest: variation.name
var curVariant = "unknown variant";
if (currentExperiment['variation_name']) {
curVariant = currentExperiment['variation_name'];
} else if (currentExperiment.variation && currentExperiment.variation.name) {
curVariant = currentExperiment.variation.name;
}
curVariant = curVariant.replace("Var #", "Variation ");

plausible('Convert', {props: {Experiment: curExperimentName}});
plausible('Convert', {props: {Variation: curVariant}});
}

View Convert Data in Plausible

Once you enable the integration you can view Experiment ID, Variation ID in Plausible dashboard: