Loading…

Integration

Experiments & A/B gating

getExperimentVariant and isExperimentEnabled.

Experiments assign visitors to variants server-side. Use the same experimentKey as in the dashboard test creator.

Read assignment

javascript
if (window.Tracuto?.isReady?.()) { const assignment = window.Tracuto.getExperimentVariant('checkout-header-v2'); if (assignment) { console.log(assignment.variantId, assignment.variantName, assignment.isControl); } if (window.Tracuto.isExperimentEnabled('checkout-header-v2', 'non-control')) { // Treatment UI } else if (window.Tracuto.isExperimentEnabled('checkout-header-v2', 'control')) { // Control / baseline UI } }

isExperimentEnabled modes

ModeReturns true when
any-assignment (default)Visitor is in the experiment (control or treatment)
non-controlAssigned to a non-control variant—use for new experience UI
controlAssigned to control—use for baseline UI

We ask before enabling optional analytics (including our own Tracuto script) or marketing cookies. Essential cookies are always used to run the service securely. See our Privacy Policy.