AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Configure Multi-Armed Bandit Testing Instead of Standard A/B Testing in Optimizely

Daly Zaloom · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Standard A/B testing is built for statistical certainty. You split traffic evenly, hold your breath through weeks of variance, and protect the integrity of a null hypothesis until a p-value clears 0.05. It is disciplined, cautious, and sometimes commercially reckless. When you are running a 72-hour flash sale, launching a limited-time promotional banner, or testing ten creative variations ahead of Black Friday, bleeding 50% of your visitors into an obviously inferior variant is an unnecessary tax on revenue.

That is why Multi-Armed Bandit (MAB) testing exists. Instead of freezing traffic splits in concrete, Optimizely dynamically shifts visitors toward the winning variation in real time. At 365Finds, we see product and growth teams make a recurring error: they treat MAB as a faster, magical version of an A/B test. It is not. An A/B test is a research tool built to answer why and confirm causality. A multi-armed bandit is an exploitation engine built to maximize yield. Once you accept that fundamental difference—and the fact that Optimizely strips out standard statistical significance from the bandit dashboard—configuring it takes only minutes.

Here is how to configure a multi-armed bandit rule inside Optimizely, how the underlying mathematics treat your metrics, and where 365Finds recommends drawing the line between bandit optimization and classical experimentation.


1. Prerequisites Before You Configure

Before toggling an experiment rule from standard A/B to a bandit, confirm three technical prerequisites in your Optimizely project:

  1. Feature Flag Created: A defined feature flag in Optimizely Feature Experimentation (or Web Experimentation) with the variations and variables you intend to expose to users.
  2. SDK Decision Point Implemented: Your application code must already evaluate the flag using optimizelyClient.decide() (or the equivalent SDK client method) and send back downstream conversion events via optimizelyClient.track().
  3. User Profile Service (UPS) for Server-Side Implementations: This is non-negotiable for server-side architectures. Because bandit algorithms continuously adjust traffic allocation percentages based on hourly performance, a returning user might be routed to Variation A at 10:00 AM and Variation B at 2:00 PM if bucketing is calculated freshly on each request. A persistent User Profile Service guarantees sticky bucketing across sessions.

2. Step-by-Step Configuration in Optimizely UI

To set up dynamic allocation instead of a static 50/50 split, configure an MAB rule directly on your target environment.

Step 1: Access Your Feature Flag

Log in to Optimizely, navigate to Flags, and select the flag you want to optimize. Pick your target environment (such as Production or a staging environment for validation).

Step 2: Add a Multi-Armed Bandit Rule

Under the Rules section:

  1. Click Add Rule.
  2. By default, Optimizely suggests an A/B Test rule. Do not select that.
  3. Choose Multi-Armed Bandit (or Contextual Multi-Armed Bandit if you are feeding structured user context into Optimizely's machine learning personalization layer).
  4. Enter a descriptive Rule Name and Rule Key.

Step 3: Configure Variations

Select the variations you want to test (a minimum of two). Assign the corresponding variable values for each arm. Unlike standard A/B tests where you manually set traffic distribution percentages (e.g., 50% / 50% or 33% / 33% / 33%), the bandit rule assigns equal distribution only at initialization. The algorithm assumes control of these shares as soon as conversions begin tracking.

Step 4: Define the Primary Metric

The bandit algorithm requires a single compass. In the Metrics section, select your Primary Metric.

Optimizely routes traffic differently depending on the data type of this primary metric:

Crucial Constraint: You cannot change the primary metric after launching an MAB rule. If you select the wrong event or decide midway that revenue matters more than clicks, you must terminate the rule and create a new one.

Step 5: Set Total Traffic Exposure and Audiences

Define the percentage of overall flag traffic exposed to this rule. If you want 100% of eligible visitors to hit the bandit, set the slider to 100%. If you only want this optimization applied to specific segments (such as mobile visitors or paid traffic), attach an Audience definition.

Step 6: Save and Enable

Save the rule. We always recommend enabling the rule in a staging environment first, triggering test events, and confirming that decisions resolve without latency before flipping the rule to active in production.


3. Alternative: Configuring MAB via Optimizely REST API

For engineering teams automating rollouts via CI/CD pipelines, MAB rules can be configured directly through Optimizely's REST API.

Send a PATCH request to update the ruleset for your flag environment:

PATCH https://api.optimizely.com/flags/v1/projects/{project_id}/flags/{flag_key}/environments/{environment_key}/ruleset
Authorization: Bearer <YOUR_API_TOKEN>
Content-Type: application/json

Payload structure:

{
  "rules": [
    {
      "key": "promo_bandit_banner",
      "name": "Promotional Banner Bandit",
      "type": "multi_armed_bandit",
      "variations": [
        { "key": "control", "percentage_included": 5000 },
        { "key": "variant_a", "percentage_included": 5000 }
      ],
      "primary_metric": {
        "event_key": "completed_order"
      }
    }
  ]
}

Note from 365Finds: Always execute a GET request on the ruleset endpoint before issuing a PATCH. Optimizely's ruleset endpoint updates whole arrays; failing to merge against existing rules can inadvertently wipe out targeting rules or existing experiments on that flag.


4. Reading the Results: How to Interpret MAB Dashboards

When you open an active MAB results page in Optimizely, the interface looks starkly different from a standard A/B test report:


5. 365Finds Comparison: Standard A/B vs. Multi-Armed Bandit

To choose the right mechanism, compare their commercial and operational trade-offs:

Evaluation DimensionStandard A/B TestingMulti-Armed Bandit (MAB)
Core ObjectiveKnowledge acquisition (identifying true causal winners)Immediate yield optimization (minimizing lost conversions)
Traffic AllocationStatic split (e.g., 50/50) maintained throughout the testDynamic split updated in real time by reinforcement learning
Statistical OutputStatistical significance, p-values, confidence intervalsWin ratios, dynamic traffic weights, cumulative lift over baseline
Opportunity CostHigh: 50% of traffic remains on losing variants until completionLow: losing variants are progressively starved of incoming visitors
Handling Many VariantsExpensive: requires massive sample sizes to test 5+ variationsEfficient: quickly prunes clear underperformers without manual pauses
Vulnerability to Novelty EffectsLow: steady baseline absorbs short-term novelty spikesModerate to High: early novelty spikes can prematurely pull traffic
Secondary GuardrailsRobust: tracks multiple guardrail metrics simultaneouslyFragile: optimizes strictly for the single primary metric

6. The 365Finds Verdict: When to Use and When to Avoid

At 365Finds, our stance is direct: Multi-Armed Bandit testing is an exceptional financial tool, but an unreliable strategic advisor.

We strongly recommend configuring MAB for:

We advise sticking with standard A/B testing for:

When configured on short-lived, high-velocity assets with a single indisputable conversion goal, Optimizely's multi-armed bandit eliminates the regret inherent in static testing. For enduring product decisions, keep the 50/50 split and wait for the p-value.


References