Zum Inhalt der Dokumentation springen

A/B testing

Show visitors different versions of a banner, compare how they answer, and read the results without over-reading them.

Zuletzt aktualisiert:

An A/B test shows different versions of one banner to different visitors. Each version is called an arm. CookieBeam records which arm each visitor saw and compares how visitors answered.

A/B testing is included in the Business plan and above.

When to use it

Use a test when you want evidence before changing a banner for everyone. Typical questions:

  • Does a different layout or color scheme change how many visitors make a choice?
  • Does a different consent model, tested in a limited region, change the outcome?

Do not use a test to find out whether a banner is lawful. A test measures visitor behaviour. It does not tell you whether a version meets your legal obligations.

What an arm can change

Each arm uses one of the banner's themes. A theme controls the banner's look. Create the themes first, in Design (see Appearance and themes). A test has exactly two arms (the baseline and one variant), and each arm picks a theme. Two arms can use the same theme if the difference is a consent-model or regional override rather than a visual change.

These settings are shared by every arm and cannot differ between arms:

  • regional rules and the fallback, unless an arm has a regional override (below),
  • copy and translations,
  • categories and cookies,
  • integrations and privacy signals.

An arm can also override the banner's consent model, on the core runtime only. The options are:

  • Inherit (regional decision): use the consent model the visitor's regional rule sets. This is the default.
  • Opt-in: nothing non-essential runs until the visitor accepts.
  • Opt-out: categories run until the visitor opts out.
  • Notice: a transparency notice with no blocking.

The baseline arm is served by your normal banner. It cannot carry a consent-model or regional override.

Overriding the consent model changes which scripts run before the visitor decides. An arm with such an override cannot start until someone with Publish permission on that banner records a legal acknowledgement. Changing the override afterwards clears the acknowledgement, so it must be given again.

An arm can also carry a regional override, on the core runtime only, which changes the regional behaviour for visitors in that arm. It needs the same legal acknowledgement.

A visitor whose browser sends a Global Privacy Control or Do Not Track signal never gets an arm's consent-model override. They get the consent model their regional rule sets.

Create and start a test

Creating, starting, pausing, stopping and viewing tests needs Admin permission for the Banners section.

  1. Open the banner and choose Insights → A/B testing.
  2. Click Create New Test.
  3. Enter a Test name and, optionally, a description of what you are testing.
  4. Under Region targeting, choose the countries or regions that enter the test. Leave it empty to include every visitor.
  5. Add a variant arm. It needs a name and a theme. A test has exactly two arms: the baseline and one variant. Traffic is split 50/50 by alternating 60-minute UTC time slots.
  6. Select the baseline arm. Results compare the variant against it.
  7. Optionally set a consent-model override on the variant arm. If you do, complete the legal acknowledgement step.
  8. Create the test. It is saved as a draft on the Drafts tab.
  9. Click Start Test.

A banner can run one active test at a time. Stop the current test before you start another.

Starting a test builds a script for each non-baseline arm from the banner's published configuration, then rebuilds the loader. Publish the banner before you start a test, so the arms use the configuration you expect.

What you can't test

Some settings are per-banner, not per-arm:

  • Categories. Every arm uses the same category structure. You can't test what happens if visitors see fewer or more categories.
  • Regional rules. The same rules apply to every arm unless you set a regional override on a specific arm.
  • Integrations. Google Consent Mode, TCF, GPP, and privacy signal settings are shared.
  • Translations. Every arm uses the same copy. If you want to test different wording, create separate banners.

This is by design: changing categories or integrations between arms would make the consent records incomparable, because the arms would be collecting consent for different things.

How visitors are assigned

Each visitor is assigned to an arm based on the current hourly time slot. All visitors in the same hour see the same arm. Each arm gets exactly 12 of the 24 hours each day, and which 12 differs per day, so over any 14 consecutive days each arm has had every hour of every weekday once. The assignment does not depend on who the visitor is, so a returning visitor may see a different arm on a later visit. A visitor outside the test's target regions sees the normal banner and is not counted.

No cookie or identifier is created for the test. The arm a visitor saw is recorded on their consent records, and you can see it as A/B variant in consent logs.

Pause, stop and delete

  • Pause stops new assignments and serves only the baseline. Data collected so far is kept. Start the test again to resume.
  • Stop Test ends the test and marks it completed. The loader goes back to serving the normal banner.
  • You can delete a draft or completed test. Stop an active or paused test first.

You can only edit an arm's overrides while the test is a draft or paused.

Promote a winner

When an active or paused test shows a leading arm, you can promote it. Promote winner copies the winning arm's theme and regional settings to the banner, republishes it, and completes the test. The action re-checks the statistical result before it runs, so a stale page can't promote an arm that is no longer ahead. A test that has already ended cannot be promoted.

Promotion is also refused if the banner has unpublished draft changes (publish or discard them first and retry), if the winning arm carries a binding consent-model override, or if applying its settings would weaken the banner's consent model. For the override and weakened-consent cases, apply the changes manually after reviewing the compliance implications.

The two arms and the 50/50 split are fixed when the test is created. To test a different variant, stop the test and create a new one; results from separate tests aren't comparable.

Read the results

Results appear on the Current Test tab and, after the test ends, on the History tab.

  • First decisions per arm. A first decision is a choice made when no earlier valid choice was on the device. The results count first decisions per arm per UTC day. Exposures are banner displays, counted separately from decisions.
  • Opt-in rate is based on explicit choices. On an arm with an opt-out override, a visitor who ran under that override counts as a success unless they explicitly opted out.
  • Automated traffic is excluded by default. The page shows how many automated records were excluded.

Result readiness shows two checks:

  • Sample floor. Every arm needs at least 100 exposures before a leading arm can be named. Directional confidence needs more; the page shows the target for your test.
  • Duration. The test must run at least 14 full days (one complete slot cycle), so each arm has had every hour of every weekday once.

When both checks pass and the variant is ahead of the baseline with a statistically significant difference (paired t-test over days, with Holm-Bonferroni correction), the page names it as leading. A leading arm is the current front-runner. It is not a declared winner, and more traffic can change it.

If you see Sample ratio mismatch detected, traffic did not split close to 50/50. Common causes are blocked, cached or failed arm scripts. Check your deployment before you trust the numbers.

Best practices

Test one variable at a time. If arm B has a different layout and different button colors, you can't tell which change caused the difference. Create one arm per hypothesis.

Run long enough. The 14-day minimum exists because the slot schedule needs one complete two-week cycle so each arm covers every hour of every weekday exactly once. Statistical significance may take longer than 14 days for low-traffic sites. The result readiness indicator tells you when the sample is large enough; trust it over the calendar.

Don't peek and stop early. Checking results daily and stopping the test when one arm looks ahead inflates your false-positive rate. Set up the test, let it run past the sample floor, and read the results once the page says an arm is leading. If you need to stop early for operational reasons, note that the result is inconclusive.

Keep the baseline arm unchanged. The baseline is your current banner. Changing it during a test (for example, by updating the banner's design) invalidates the comparison. Publish the banner before starting the test, then leave it alone until the test ends.

Watch for sample ratio mismatch. If the actual traffic split diverges from 50/50 (for example, you see 60/40), something is interfering: a cached loader script, an ad blocker stripping one arm, or a CDN purge failure. The page warns you. Don't trust the results until the split is clean.

Consider opt-in rate vs. engagement rate. A higher opt-in rate isn't always better. An arm that nags the visitor into accepting may produce more consent records but also more complaints and higher "accept necessary" rates. Compare the reject and decision rates across arms, not just the opt-in rate.

Troubleshooting

You need more themes. A test has exactly two arms, and each arm picks a theme. If you only have one theme and want to test a visual difference, duplicate it in Design, change its look, and try again.

Start is refused with "legal acknowledgement required". An arm has a consent-model or regional override. Someone with Publish permission on the banner must record the acknowledgement.

Start is refused because the banner already has an active test. Stop the active test first.

An arm looks out of date. Arms are built from the published configuration when the test starts. Publish the banner, then pause and start the test again.

A warning says the CDN cache purge failed. The test started, but some visitors may get the previous loader until the cache expires. If it persists, pause and start the test again.