Didomi - Developers documentation
  • Introduction
  • SDKs
    • Introduction
    • Web SDK
      • Getting started
      • Tags and vendors management
        • Tags management
          • Events & Variables
            • Deprecated
            • Custom events
          • Tag managers
            • Adobe Launch/DTM
            • Eulerian
            • Google Tag Manager
              • Configure the Didomi / GTM integration
              • Didomi's GTM template
            • Tealium
            • Other tag managers
        • Custom Didomi <script> tags
        • Third-party integrations
          • Google Ad Manager / AdSense
            • GDPR via Non-Personalized Ads
              • Share consent and load/refresh ads
              • Share consent without loading or refreshing ads
            • US states laws
          • Google Consent Mode V2
          • Kameleoon
          • Piano Analytics (AT Internet)
          • Prebid
            • GDPR via IAB TCF
            • US states laws
          • Salesforce DMP (Krux)
        • IAB frameworks
        • Programmatic API
      • Configuration
        • Bots (SEO & Performance tools)
        • Configuration by URL
        • Cookies and storage
        • Custom domains for events
        • Notice
          • Behavior
          • Interactions
          • Look and feel
        • Preferences
        • Theme
      • AB tests
      • Custom domain
        • Domain delegation
        • Reverse proxy
      • Share consents between domains
      • Share consents across devices
      • Pass user choices in query string
      • Serve Didomi assets from your domain
      • Reference
        • API
          • Deprecated
        • Events
      • Performance
      • Versions
    • Mobile and TV SDKs
      • Android and Android TV
        • Setup
        • Logging
        • Reference
          • API
            • Deprecated
          • Events
        • Versions
      • iOS and tvOS
        • Setup
        • Logging
        • App Tracking Transparency (iOS 14.5+)
        • Reference
          • API
            • Deprecated
          • Events
        • Versions
      • Unity
        • Setup
        • Reference
        • Versions
        • Troubleshooting
      • React Native
        • Setup
        • Reference
          • Deprecated
        • Versions
      • Flutter
        • Setup
        • Reference
        • Versions
      • Consent notice
        • Getting started
        • Customize the notice
        • Customize the preferences popup
        • Customize the theme & UI
        • Load notice by ID
      • Third-party SDKs
      • Share consents across devices
      • Share consent with WebViews
      • Google Consent Mode v2
      • FAQ
    • AMP SDK
      • Blocking Behaviors
        • Load immediately on page load
        • Load only after consent (positive or negative)
        • Load only after positive consent
      • Consent status for vendors
    • Help & Support
  • API
    • Introduction
      • Authentication
      • Errors
      • Pagination
      • Filters
      • Caching
      • Rate limiting
      • Quotas
      • Translations
    • Data Manager
      • Regulations
      • Configuration Tree
      • Purposes
        • Purposes & Vendors Numerical IDs
      • Preferences Library
      • User Rights
    • Widgets
      • Consent notices
        • Notices
        • Configurations
        • Multi-Regulation Configurations
          • Migration of Existing Notices and API Updates
        • Deployments
        • Tutorials
          • Create and publish a consent notice
          • Create and publish a multi-regulation consent notice
      • Privacy widgets
        • Create a widget
        • Retrieve widgets
        • Edit a widget
          • Content & Design
            • Themes & Shapes
            • Components
              • auth
              • dsar_form
              • footer
              • header
              • preference
              • preference_value
              • save
              • section
              • sections
            • Options
          • Purposes & preferences
          • Settings
        • Deploy a Widget
          • Use your own subdomain
          • Use your own domain
          • Implement an embeddable widget on your website
        • Authentication
          • Manage authentication providers
          • Authenticate your end-user
        • Archive a widget
        • Headless widgets
          • Public Methods
          • Custom elements
          • Custom events
          • Event listeners
        • Tutorial
          • Launch a Preference Center from a mobile app
    • Compliance Reports
      • Properties
      • Reports
      • CSV format reference
      • Websites
    • Consents and Preferences
      • Events
        • Generate IAB TCF consent string
      • Links
      • Proofs
      • Tokens
      • Secrets
      • Users
      • Tutorial
        • Collect and operate data
    • Privacy Requests
      • Requests
      • Notes
      • Links
      • Emails
  • Integrations
    • Introduction
      • Quotas
    • Generic integrations
      • Batch export
        • Destinations
          • AWS S3 Bucket (owned by Didomi)
          • GCP Storage Bucket
        • Exported data
          • Notices consents
        • Logs
      • Webhooks
      • Batch import
      • Analytics export
        • Destinations
          • AWS S3 Bucket (owned by Didomi)
          • GCP Storage Bucket
    • Third-party apps
      • CMP integrations
        • Didomi-mParticle integration for your CMP
        • Deploy Didomi’s SDK for your Adobe Commerce website
      • Preference Management Platform integrations
        • Actito
        • Adobe Campaign Classic
        • Adobe Experience Cloud
        • Adobe Marketo Engage
        • Adobe Source Connector
        • Braze
        • Dotdigital
        • Hubspot
        • Mailchimp
        • Microsoft Dynamics 365
        • Salesforce Marketing Cloud
        • Salesforce Sales & Service Cloud
        • Selligent
        • Brevo (ex Sendinblue)
    • Tutorials
      • Configure a HTTP webhook
      • Configure a batch export
      • Configure an analytics export
    • Emailing
      • Configurations
        • Actito Email
        • Actito SMS
        • Adobe Campaign Classic
        • Adobe Campaign Standard
      • Emails
        • Templates
        • Manage your templates
Powered by GitBook
On this page
  • Run AB tests with Didomi
  • Configuration
  • Run AB tests with your preferred vendor
  • Test complex cases
  • Measure and analyze your test results
  1. SDKs
  2. Web SDK

AB tests

PreviousThemeNextCustom domain

Last updated 4 years ago

The Didomi SDK allows you to run AB tests to compare the consent rates and other metrics of two groups of populations. We support running AB tests through your preferred vendor or through the Didomi platform.

AB tests cannot be run with standard texts at the moment. Standard texts will not be displayed in your test version.

Run AB tests with Didomi

The Didomi SDK allows you to test the performance of a variant of your configuration (notice format, content, etc.). To do so, our SDK will separate your users into two groups:

  • Control group (A): control users will be shown your normal consent notices and the current configuration of your SDK will be applied.

  • Test group (B): test users will be shown the variant of your SDK configuration that you want to test.

To validate whether the outcome of your AB test is positive or negative, you will observe the metrics (consent rate, bounce rate, etc.) of your test group and compare them with the metrics of your control group. If your test group performs better than your control group then your AB test will be positive and indicate that the configuration applied to your test group is more efficient than the one applied to your control group.

How about multivariate tests?

Multivariate tests allow you to create multiple test groups to analyze the performance of multiple variants at once. Didomi does not support multivariate tests at the moment. You can use AB testing vendors like (a free solution) to create this type of tests.

Configuration

To setup your AB test, you need to add an experiment property in your didomiConfig variable. Keep in mind that all properties outside of that experiment property will be applied to your control group as usual. That is the baseline that you will be comparing your test group results against.

The experiment property allows you to configure three variables of your test:

Property

Description

Example

id

A unique ID for your test. That will be used to distinguish the results between multiple tests that you would be running over time. Use a lowercase string with no spaces and only - (dash) as a special character ([a-z-]).

first-test, test-variation-1

size

The size of your test group as a percentage between 0 and 1. Your control group size will be 1 - size. We recommend keeping this value between 0.1 (10%) and 0.5 (50%) so that you control group will include 50% to 90% of your users.

0.2 for a test group that includes 20% of your users

config

The extra configuration parameters to apply to the test group users. The configuration parameters will be merged into your regular configuration (the one applied to your control group) to allow you to only test a small number of variables at once. Any configuration parameter that is valid for the SDK can be used here.

See below

startDate

Start date of the test as an ISO 8601 string. When provided, only users that are asked for consent after that start date will be included in the test.

While this is not required, it is strongly recommended to include a start date to make sure that your test and control groups only include new users that have not seen the consent UI yet.

2019-03-06T23:38:50Z

Keep your test focused

It is important to not test too many variations at once as you will not be able to attribute the performance results of your test group to a specific variable.

For instance, if you change both the notice content and format of your test group (compared to your control group) and see a consent rate increase of 10% in your test group, you will not be able to determine if the consent rate increase comes from the different notice content or format. You will only be able to conclude that changing both the notice content and format had a joint positive effect.

Example - Test a different format for your consent notice (banner vs pop-in)

<script type="text/javascript">
window.didomiConfig = {
  app: {
    apiKey: '<Your API Key>',
    name: 'My website',
    vendors: {      
      iab: {
        all: true
      }  
    }
  },
  notice: {
    // Users in your control group will see the consent banner at the bottom of their screen
    position: 'bottom'
  },
  experiment: {
    id: 'test-notice-format', // Unique ID for your test
    size: 0.2, // Test group will include 20% of your users
    startDate: '2019-03-06T23:38:50Z',
    config: {
      // Every property in this config object will be merged into window.didomiConfig for users in your test group
      notice: {
        // Users in your test group will see the consent popup instead of the banner
        position: 'popup'
      }
    }
  }
};
</script>

Keep in mind that users in your test group will see the default configuration for your tag PLUS the specific configuration for them (that will replace the default configuration for properties that appear in both) For instance, they will see all the IAB vendors and the pop-in consent notice. Users in your control group will see all the IAB vendors and the banner consent notice.

Run AB tests with your preferred vendor

If you already work with an AB testing solution, you can use it to deploy different variants of the Didomi tag configuration and automatically measure the difference in consent rates.

You create, configure and analyze your AB test entirely in your AB testing solution. You will create the variants that you want to test using the standard process of your vendor and will use your testing solution to collect and analyze the result of your tests.

Example for comparing two different messages in your consent notice:

  • Create an AB test with two groups: control and test

  • Configure the test group to show a different notice message

  • Add an event to count the number of clicks on the "I agree" button of the consent notice

  • Use the event counter as your AB test objective

Test complex cases

Some variants might be complicated to create with your AB testing solution. For instance, comparing notice formats (banner vs pop-in) can be complex to configure.

In that case, you can use your AB testing solution to serve two different versions of the didomiConfig configuration object: one specific to your control group and another one specific to your test group. With that setup, you can create variations of any option supported by the Didomi SDK without being limited by your testing solution.

Measure and analyze your test results

You need to define and measure the metric(s) that you will use to analyze your tests results and compare the performance of your test groups. Your AB testing solution should allow you to define what metric(s) you want to use (number of clicks on the "I agree" button, number of page views with consent, etc.) and measure them for you, potentially with the help of your analytics solution.

If that is not possible or if you want to be able to have access to all the analytics provided by Didomi for your AB tests, we can setup a custom dashboard to help you track the results of your tests. Reach out to for more information.

Google Optimize
support@didomi.io