Integrate ABlyftIntegrations

Usercentrics

A/B test Usercentrics consent banner variants and track banner events as goals.

You can test variants of your Usercentrics banner with ABlyft. The variants are designed in Usercentrics. ABlyft decides which variant a visitor gets and measures the result.

Place the ABlyft script in the <head> before the Usercentrics script.

Experiment and variations

  1. Create an experiment with a variation of the type Code.
  2. In the variation, set a global variable: window.UC_AB_VARIANT = "variant1";
  3. In the original, set the same variable to "variant0".

Goals

Usercentrics reports these events:

EventMeaning
CMP_SHOWNThe banner appeared
ACCEPT_ALLAccept all was clicked
DENY_ALLDeny all was clicked
SAVESave was clicked
MORE_INFORMATION_LINKMore information was clicked
IMPRINT_LINKImprint link was clicked
PRIVACY_POLICY_LINKPrivacy policy link was clicked

Create one Custom goal for each event you want to measure. The API name is usercentrics_ plus the event name, for example usercentrics_ACCEPT_ALL.

Forward the events

Add this to Project JavaScript in the project settings:

window.addEventListener('UC_UI_CMP_EVENT', function (data) {
  window['ablyft'] = window['ablyft'] || [];
  window['ablyft'].push({
    eventType: 'custom',
    eventName: 'usercentrics_' + data.detail.type,
  });
});

More about custom goals: Custom goals.

On this page