1. Experiments in Observe
An experiment assignment is a pair of an experiment key and a variant, for examplelogin-layout with variant-a. Observe creates the experiment and its variants automatically when the first journeys carrying them are processed. No setup is needed before you send data.
Experiments and tags both add context to journeys, but serve different purposes:
Experiments are stored separately from tags and do not count toward the tag limits.
2. Capture assignments in the browser
By default, Autocapture picks up experiment assignments automatically wherever your page already receives them, for example from the responses of your A/B testing tool. Corbado configures this together with the capture rules for your login, so your application does not need to change. Share which experiments you run and where your page receives their assignments. Only if Autocapture cannot detect an assignment on its own, hand it over from your page. Both options can be combined.Assignments known at page load
Assignments known at page load
Add Observe reads the configuration once when it starts. See Configure the script tag for the other configuration options.
experiments to window.corbadoObserveConfig in an inline script before the Autocapture script tag:Assignments decided later
Assignments decided later
Call Call it as early as possible, before the visitor starts to log in, so the whole journey is attributed to the variant.
setExperiments() when your application knows the assignment, and again when it changes:3. Pass assignments from your backend
Send assignments from your backend only if they are not available in the browser, for example for an experiment that only changes backend behavior, such as a different risk rule or retry limit. Use backend enrichment: addexperiments to a flow_enriched event and identify the browser session with sessionID, which your page reads with window.CorbadoObserve.getSessionId() and passes to your backend:
_ and - for experiment keys, with at most 128 characters. Variants are strings with at most 255 characters.
4. How journeys get their variant
Observe attributes each journey to the variant that is active while it runs:- Assignments stay active: once passed, an assignment applies to all following journeys of the session until you pass a new variant for the same experiment. Events without an assignment do not change it.
- Changes during a journey: if the variant changes while a journey runs, the latest variant within that journey applies. Each journey counts for exactly one variant per experiment.
- Nested journeys: a journey started inside another one, for example a sign-up inside a login, gets the same variant as the surrounding journey.
- Sessions and devices: assignments apply within one browser session. Journeys on other devices are not linked to them, so assign the variant per visitor and pass it on every device the visitor uses.
5. Set up and analyze an experiment
5.1 Check the incoming data
Open Experiments → Manage. Experiments and their variants appear here once the first journeys carrying them have been processed. Use Explore exposure to confirm that each variant receives traffic and that the split is roughly as planned.5.2 Create a run
A run is a named, time-boxed evaluation of one experiment. Select New run and fill in:
After you create a run, Observe reprocesses the selected flows. Depending on the amount of data, the comparison can take up to 60 minutes to become available.
5.3 Analyze the results
Open Experiments → Analysis and select the run. The analysis compares the journeys of each variant during the run’s window against the control:- Completion rate: how many journeys ended successfully
- Error rate: how many journeys ran into errors, and which errors differ between variants
- Completion time: how long successful journeys took
- Flow allocation: whether each variant received its planned share of journeys
6. Test your setup
- Open a test page that runs Autocapture with a test project and has the experiment active.
- Complete a login with each variant.
- Open Experiments → Manage and check that the experiment and its variants appear.
- Use Explore exposure to check that your test logins are counted for the expected variants.
7. Next steps
- Continue with Tags to segment journeys by business context.
- Continue with Backend enrichment to send assignments and other facts from your backend.
- See Analytics for the other analysis views.