AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

Configuring Optimizely Multi-Armed Bandit Experiments for Short-Window Marketing Campaigns

Kyle Muscato · 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

Running a traditional, fixed-split A/B test during a 48-hour flash sale, Cyber Week promotion, or holiday drop is one of the most expensive tactical mistakes a digital growth team can make. Traditional hypothesis testing requires sending equal slices of traffic to every variation until statistical significance ($p < 0.05$) is achieved. In a short promotional window, by the time an A/B test reaches statistical significance, the campaign has ended, peak customer traffic has vanished, and the business has left tens or hundreds of thousands of dollars on the table by feeding underperforming variations.

At 365Finds, our institutional stance is unequivocal: for time-sensitive marketing windows of 7 days or fewer, digital growth teams should abandon fixed-split A/B testing and default to Multi-Armed Bandit (MAB) optimization. Optimizely provides a battle-tested MAB engine across both Web Experimentation and Feature Experimentation. However, maximizing revenue requires understanding how Optimizely balances exploration and exploitation, selecting the correct metric type to trigger the appropriate reinforcement algorithm, and avoiding mid-flight operational missteps that wipe out model gains.


MAB vs. Fixed A/B: The Economics of Regret Minimization

The strategic divide between traditional A/B testing and Multi-Armed Bandits comes down to learning vs. earning:

DimensionTraditional A/B TestingMulti-Armed Bandit (MAB)
Primary ObjectiveLong-term learning; finding a statistically valid truthImmediate reward; maximizing total conversions or revenue
Traffic AllocationFixed throughout the run (e.g., 50/50 or 25/25/25/25)Dynamic and adaptive; shifts hourly toward winning variations
Statistical FrameworkFrequentist or Bayesian hypothesis testing with $p$-valuesReinforcement learning (Thompson Sampling or $\epsilon$-Greedy)
Cumulative RegretHigh; inferior variations continue to receive equal trafficMinimized; losing variations are aggressively throttled
Results BenchmarkLift over control with confidence intervalsImprovement over equal allocation / improvement over original
Best ScenarioPermanent product UX changes, core checkout architectureFlash sales, holiday banners, product launches, short promos

In experimentation theory, regret is the difference between the payoff obtained by the strategy and the payoff that would have been obtained had the best variation been served to all visitors from the start.

During an annual Black Friday promotion with 500,000 visitors over 48 hours, feeding 250,000 visitors to a sub-optimal banner with a 4% conversion rate while a winning banner converts at 7% costs the business 7,500 lost transactions. Optimizely MAB solves this by monitoring early conversion signals and continuously reallocating live traffic to the top-performing variations while the campaign is still active.


How Optimizely MAB Works Under the Hood

Optimizely’s MAB engine does not rely on a single rigid algorithm. Instead, it inspects your primary metric and automatically applies the optimal reinforcement learning procedure.

1. Thompson Sampling for Binary Metrics

When you configure a binary (Bernoulli) outcome—such as conversion rate, add-to-cart rate, or click-through rate—Optimizely implements Thompson Sampling.

This mechanism naturally balances the explore-exploit trade-off: variations with high conversion rates are exploited heavily, while variations with fewer impressions retain wider probability distributions, ensuring they still receive enough exploratory traffic to prove their viability.

2. Epsilon-Greedy for Numeric Metrics

When the primary metric is continuous or numeric—such as revenue per visitor (RPV), order value, or events per user—Optimizely switches to an Epsilon-Greedy ($\epsilon$-greedy) procedure.

3. Hourly Updates and Exponential Time-Decay

Short-window marketing campaigns frequently suffer from non-stationarity: buyer behavior at midnight on Cyber Monday differs sharply from behavior at 2:00 PM on Tuesday.

Optimizely handles time variation through two built-in mechanisms:

  1. Hourly Recalculation: The MAB model updates its traffic distribution every hour, processing fresh event logs.
  2. Exponential Decay Function: Optimizely applies exponential decay weighting to visitor observations, prioritizing recent user behavior over earlier hours. If an offer gains traction midway through the campaign due to an external social media surge or morning email blast, the model adapts swiftly rather than being paralyzed by Day 1 historical data.

Step-by-Step Configuration Guide for Digital Growth Teams

Step 1: Metric Selection and Attribution Latency

Before touching the Optimizely interface, align on the primary metric.

Step 2: Implementation in Optimizely Web Experimentation

For growth teams optimizing front-end landing pages, hero banners, and promotional discount ribbons:

  1. Navigate to Experiments and select Create New... > Multi-Armed Bandit.
  2. Name the experiment, provide target URL matching rules, and establish campaign audience targeting.
  3. In the Visual Editor, configure your variations. Keep variants focused on high-contrast hypotheses (e.g., percentage discount vs. dollar-off coupon vs. tiered threshold rewards).
  4. Click Metrics and designate your single Primary Metric.
  5. QA the variations using preview links, confirm event tracking in network calls, and click Start Multi-Armed Bandit.

Step 3: Implementation in Optimizely Feature Experimentation (Server-Side)

For backend teams gating features, checkout algorithms, or dynamic discount structures:

  1. Create a feature flag within your Feature Experimentation project workspace.
  2. In the flag's ruleset, click Add Rule and choose Multi-Armed Bandit.
  3. Alternatively, deploy via the Feature Experimentation REST API:
    curl --request PATCH \
      --url https://api.optimizely.com/flags/v1/projects/{PROJECT_ID}/flags/{FLAG_KEY}/environments/{ENVIRONMENT_KEY}/ruleset \
      --header 'accept: application/json' \
      --header 'authorization: Bearer {API_TOKEN}' \
      --header 'content-type: application/json-patch+json' \
      --data '[
        {
          "op": "add",
          "path": "/rules/flash_sale_bandit",
          "value": {
            "key": "flash_sale_bandit",
            "name": "Flash Sale Dynamic Promo",
            "type": "multi_armed_bandit",
            "percentage_included": 10000,
            "metrics": [
              {
                "event_id": 12345678,
                "scope": "visitor",
                "aggregator": "unique",
                "winning_direction": "increasing"
              }
            ],
            "variations": {
              "control": { "key": "control", "percentage_included": 3333 },
              "tier_a": { "key": "tier_a", "percentage_included": 3333 },
              "tier_b": { "key": "tier_b", "percentage_included": 3334 }
            }
          }
        }
      ]'
    
  4. In your application codebase, evaluate user assignment through the SDK's decide method:
    # Python SDK Example
    user_context = optimizely_client.create_user_context(user_id, {"is_vip": True})
    decision = user_context.decide("flash_sale_bandit")
    active_variation = decision.variation_key
    

Step 4: Enforce Sticky Bucketing with a User Profile Service

Because Optimizely updates MAB traffic splits hourly, a returning customer whose session lapses could be assigned to a different variation on their next visit if sticky bucketing is absent.

In Web Experimentation, client-side cookies preserve sticky bucketing by default. However, in server-side Feature Experimentation, your engineering team must implement a User Profile Service (UPS). The UPS acts as an external cache (e.g., Redis or DynamoDB) that stores {user_id, experiment_bucket} pairs. When decide() executes, the SDK queries the UPS first; if a record exists, the user receives their originally assigned variation regardless of how dramatically the bandit's hourly weights have shifted. This prevents jarring price or UX fluctuations for repeat shoppers.


Critical Guardrails: Operational Rules for Short Windows

To ensure bandit campaigns yield maximum lift without technical catastrophe, adhere to four 365Finds operational rules:

1. The "Hands-Off" Law: Never Alter Running Variations

In standard A/B testing, pausing a failing variation reallocates traffic evenly among survivors. In Optimizely MAB, stopping, pausing, or adding a variation mid-experiment destroys the active bandit model.

When an arm is removed, Optimizely resets the posterior distribution and restarts the reinforcement model from scratch. In a 48-hour campaign, discarding 24 hours of accumulated learning to start over at equal splits negates the entire commercial advantage of MAB. Finalize all variations, copy, and legal approvals before launch.

2. Limit Variations to 3 to 5 Arms

While multi-armed bandits manage multi-variant scenarios better than fixed-split testing, testing 15 micro-copy variations in a 48-hour flash sale spreads initial exploration traffic too thinly. During the opening hours, the algorithm requires sufficient conversion events to establish distinct Beta distributions. Stick to 3 to 5 distinct, high-impact variations.

3. Read the Dashboard Correctly: No $p$-values

Do not look for statistical significance or confidence intervals on the Optimizely MAB results dashboard. They do not exist.

Instead, evaluate Improvement Over Equal Allocation (or Improvement Over Original). Optimizely calculates this metric by tracking cumulative average conversions per visitor across variations, comparing the observed conversion volume against a hypothetical baseline where all traffic was served the original control. If the bandit routed 80% of traffic to a winning variant, this metric quantifies the net additional transactions captured.

4. Know When to Pivot Back to A/B Testing

MAB is built for commercial harvesting, not scientific discovery. Because bandit algorithms skew traffic rapidly, they do not collect enough negative data on losing variations to explain why they failed. Once the marketing window closes and you return to evergreen UX optimization, checkout redesigns, or core infrastructure features, shift back to Optimizely's standard Stats Engine A/B testing.


References