Skip to content

A/B Test Recommendation Strategies

⏱ 20 minutes intermediate

Your first recommendation configuration is an educated guess. You chose an algorithm, set business rules, and picked a widget layout based on reasonable assumptions. But assumptions are not data. Does collaborative filtering outperform content-based matching for your audience? Do visitors engage more with a carousel or a grid? Does showing 3 items perform better than 6?

A/B testing answers these questions with visitor behavior data instead of opinions.

  1. Define what to test and how to measure success
  2. Create test variations
  3. Configure the A/B test
  4. Run the test and monitor results
  5. Apply the winning strategy

Recommendation tests fall into three categories. Pick one variable per test to get clean results.

Test categoryWhat variesExample hypothesis
AlgorithmThe recommendation model”Hybrid algorithm drives 15% more clicks than collaborative filtering”
PresentationWidget type, layout, count”A 3-item grid outperforms a 6-item carousel on mobile”
RulesBusiness rules, filters, fallback”Excluding previously viewed content increases click diversity”

Define a primary metric before starting the test:

MetricWhat it measuresBest for
Click-through rate (CTR)Percentage of visitors who click a recommendationGeneral engagement testing
Revenue per sessionRevenue attributed to recommendation clicksE-commerce optimization
Pages per sessionAverage pages viewed after recommendation clickContent engagement depth
Time on siteAdditional time spent after clickingContent quality validation
Conversion rateDownstream conversions from recommendation clicksLead generation and sales

To test algorithms, create two recommendation models with different configurations:

  1. Navigate to Content Recommendations > Models
  2. Ensure you have two models that differ only in the variable you are testing:
    • Control: Your current model (e.g., collaborative filtering, 4 items)
    • Variation: The challenger model (e.g., hybrid algorithm, 4 items)
  3. Note the model IDs for both

To test widget configurations, you will use the same model but render it differently:

Define widget variations
javascript
// Control: grid layout with 4 items
const controlConfig = {
modelId: 'MODEL_ID',
widgetType: 'grid',
options: { count: 4, showImage: true, showDescription: true },
};

// Variation: carousel layout with 6 items
const variationConfig = {
modelId: 'MODEL_ID',
widgetType: 'carousel',
options: { count: 6, showImage: true, showDescription: false },
};

Using Content Recommendations built-in testing

Section titled “Using Content Recommendations built-in testing”

Content Recommendations includes a testing feature that handles traffic splitting automatically.

  1. Navigate to Content Recommendations > Tests
  2. Click Create Test
  3. Enter a test name and description
  4. Set the control — select the current model and widget configuration
  5. Set the variation — select the challenger model or widget configuration
  6. Configure traffic split (50/50 is standard; adjust if you need to limit exposure)
  7. Set the primary metric
  8. Set the minimum sample size or test duration:
    • Sample size — How many visitors each variation needs before results are reliable (minimum 1,000 per variation recommended)
    • Duration — Minimum run time to account for day-of-week and time-of-day effects (at least 7 days recommended)
  9. Click Start Test

For more advanced test designs, use Optimizely Experimentation to control which recommendation widget renders:

Load widget variation based on experiment
javascript
// After Optimizely Experimentation assigns a variation
function renderRecommendations(variationKey) {
const configs = {
  control: {
    modelId: 'MODEL_A',
    widgetType: 'grid',
    options: { count: 4 },
  },
  variation_1: {
    modelId: 'MODEL_B',
    widgetType: 'grid',
    options: { count: 4 },
  },
};

const config = configs[variationKey] || configs.control;

window.optimizelyContentRecs = window.optimizelyContentRecs || [];
window.optimizelyContentRecs.push({
  action: 'renderWidget',
  selector: '#recommendations',
  ...config,
});
}

This approach is useful when you want to combine recommendation testing with other page experiments or use Optimizely’s statistical engine for analysis.

Once the test is live:

  1. Do not change anything during the test. Modifying models, rules, or widgets invalidates results.
  2. Monitor the test dashboard daily for anomalies (sharp drops in traffic, technical errors)
  3. Wait for the test to reach statistical significance — do not call a winner early based on small samples
  4. Check both the primary metric and guardrail metrics (metrics that should not get worse, like page load time)
IndicatorMeaning
Statistical significance > 95%The observed difference is unlikely due to chance
Lift percentageHow much better the variation performs vs control
Confidence intervalThe range of likely true improvement
Sample size metEnough visitors have been tested for reliable conclusions

When the test concludes:

  1. If the variation wins: update your production recommendation widget to use the winning configuration
  2. If the control wins: keep the current configuration and test a different variable
  3. If results are inconclusive: extend the test duration or increase traffic allocation

Document what you learned. Even losing tests provide insight into your audience’s preferences.

Recommendation optimization is ongoing. After applying a winner, plan the next test:

  • Test the winning algorithm with different business rules
  • Test the winning widget layout with different item counts
  • Test on different page types (homepage vs article page vs category page)

Each test builds a deeper understanding of what drives engagement for your specific audience and content.