Skip to main content

Overview

A/B testing (also called split testing) lets you compare multiple prompt versions to see which performs better. Switchport provides deterministic routing so users get a consistent experience.

How It Works

  1. Create multiple versions of a prompt in the dashboard
  2. Set up a traffic config to distribute users across versions
  3. Execute prompts with user identification to get deterministic version assignment
  4. Record metrics to measure performance
  5. Analyze results in the dashboard to identify winners

Creating Multiple Versions

In the Switchport dashboard:
1

Navigate to your prompt

Go to Prompts and select the prompt you want to test
2

Create first version

  • Click Add Version
  • Name: v1 or formal-tone
  • Set model and prompt template
  • Click Save and Publish
3

Create second version

  • Click Add Version again
  • Name: v2 or casual-tone
  • Use different wording or approach
  • Click Save and Publish
4

Create traffic config

  • Click Traffic Config
  • Set distribution (e.g., 50% v1, 50% v2)
  • Click Activate

Executing Prompts with A/B Testing

The key to A/B testing is using context for deterministic routing:
The same user always returns the same version. This ensures users have a consistent experience across sessions.

Recording Metrics for A/B Tests

To compare versions, record metrics with the same subject:
Switchport automatically:
  • Links the metric to the version that user saw
  • Aggregates metrics per version
  • Calculates averages, success rates, and distributions

Traffic Distribution

You can distribute traffic in various ways:

50/50 Split (Classic A/B)

Multivariate Testing (A/B/C)

Gradual Rollout

Start with a small percentage on the new version:
If metrics look good, increase the new version:
Finally, roll out completely:

Complete Example: Email A/B Test

Analyzing Results

In the Switchport dashboard, you can view:
  • Metric averages per version: See which version has higher satisfaction scores
  • Conversion rates: Compare success rates for boolean metrics
  • Sample sizes: Ensure statistical significance
  • Confidence intervals: Understand the reliability of results

Best Practices

Always use the same subject (e.g., user ID) for a given subject across all prompt executions and metric recordings.
For initial A/B tests, use even splits to gather data faster.
Ensure you have enough data for statistical significance before declaring a winner.
Change only one variable between versions to understand what drives performance differences.
For new versions, start with a small percentage to minimize risk.
Decide what metrics matter before running the test to avoid cherry-picking results.
Watch for unexpected drops in other metrics when optimizing for one specific metric.

Common Use Cases

Email Marketing

Test subject lines, tone, call-to-action wording:
Metrics: open rate, click rate, conversion rate

Customer Support Chatbot

Test different conversation styles:
Metrics: resolution rate, satisfaction score, escalation rate

Product Descriptions

Test different description styles:
Metrics: conversion rate, time on page, add-to-cart rate

Next Steps

Examples

See complete A/B testing examples

Metrics Reference

Learn more about recording metrics