Generic A/B Testing

Generic A/B testing allows you to differentiate for URLs sharing the same URL but with different layouts/views and then configure the different layouts as variations. This can be used for various split testing tools that are not included in DXA's standard integrations.

Note: This data connector doesn't work retroactively as it requires DXA to collect and aggregate the variations each time the script is fired.

Enabling the generic A/B testing data connector

  1. On the navigation bar, go to Connect > Data Connectors > Configure Data Connectors > Split Testing > Generic A/B Testing.Generic A/B testing data connector

  2. Under Generic A/B Testing, select Generic A/B Testing Enabled.

    The generic A/B testing data connector settings appear.

  3. Click Save.

Generic A/B testing data connector is enabled. See the sections below to implement generic A/B testing.

Implementing generic A/B testing

Option 1

The first option for implementing DXA's generic A/B testing integration is to add the DXA API call individually to each variation you want to track. This code must be implemented after the initial DXA tracking script. For example:
if (window.decibelInsight) {
   decibelInsight('ready', function () {
      decibelInsight('sendIntegrationData', 'GenericIntegration', {id: 12345, name: 'Variation 1'});
   });
}
You will need to replace the ID and name above with relevant information, and each different variation will require a unique ID and name to enable DXA to recognize these as different variations. This includes different variations of the same split test. So, if you were running a split test called "New Homepage" and wanted to track the original and variation of this, you would need the following code on the original:
if (window.decibelInsight) {
   decibelInsight('ready', function () {
      decibelInsight('sendIntegrationData', 'GenericIntegration', {id: 12345, name: 'New Homepage Original'});
   });
}
While the following code would need to be added to the variation:
if (window.decibelInsight) {
   decibelInsight('ready', function () {
      decibelInsight('sendIntegrationData', 'GenericIntegration', {id: 12346, name: 'New Homepage Variation'});
   });
}

This will then allow DXA to collect these variations independently and recognize these as different variations.

Option 2

The second option is to add JavaScript code to the text box, which can be found in the generic A/B testing data connector settings. This will add the JavaScript code to the DXA script and will need to be customized to only fire on pages that have variations, while it will also need to collect the ID and name of the variation from the respective tool using an on page variable. For example:
if (conditionName === true) {
   decibelInsight('sendIntegrationData', 'GenericIntegration', {id: 12345, name: 'Variation 1'});
}

The "if" statement would be replaced to only fire on pages with a variation, while "id" and "name" will need to collect the information from a variable, otherwise DXA will collect every variation as the same ID and name.

Trigger Variation Javascript

The Trigger Variation Javascript box allows you to input JavaScript that will trigger the particular variation in heatmaps, if this is available with your selected A/B testing provider. Simply input the required JavaScript here that allows for variations to be triggered when visiting the particular page. This will then "force" the particular variation that you are segmenting by in heatmaps.

If you have this JavaScript added, you can simply create a segment with the selected variation as a filter, then in heatmaps browse to the page that contains the variation. You can then filter this page by the segment that contains the respective variation and this will trigger the variation to display on that page.

Using generic A/B testing variations

Upon collecting generic A/B testing variations, you can begin to use these by creating segments based on them.

When adding filters to a segment, go to Integrations > Generic A/B testing variation and use the Please select ... box to search for a variation.Generic AB testing segment filters

Note:

You can then use the segment to filter sessions, heatmaps, forms, and other DXA features based on visitors who have viewed that particular variation.