Run Your First A/B Test
What you will do
Section titled “What you will do”By the end of this tutorial, you will have:
- Created a hypothesis for your test
- Built a variation using the visual editor
- Defined a goal to measure success
- Set audience targeting
- Launched the experiment
- Understood how to read the results
No coding is required. This tutorial uses Web Experimentation’s visual editor.
Before you start
Section titled “Before you start”Ensure you have:
- Optimizely Web Experimentation access — Your admin should have invited you
- The snippet installed — The Optimizely JavaScript snippet must be on your website. Ask your developer if unsure.
- A test page — Pick a page with enough traffic (at least 1,000 visitors per week) to get results in a reasonable time
Step 1: Form your hypothesis
Section titled “Step 1: Form your hypothesis”Before touching the tool, write down your hypothesis. A good hypothesis has three parts:
- What you will change — The specific element you are modifying
- What you expect to happen — The metric you expect to improve
- Why you expect it — The reasoning behind your prediction
Example:
“Changing the CTA button text from ‘Learn More’ to ‘Start Free Trial’ will increase button clicks by 10% because direct action language creates urgency and clarity.”
Write your hypothesis down. You will refer back to it when setting up the experiment and interpreting results.
Step 2: Create a new experiment
Section titled “Step 2: Create a new experiment”- Log into Optimizely at app.optimizely.com
- Navigate to Experiments in the left sidebar
- Click “Create New” → “A/B Test”
- Name your experiment descriptively (e.g., “Homepage CTA Button Text Test — March 2026”)
- Enter the URL of the page you want to test
- Click “Create Experiment”
The visual editor opens, showing your live page.
Step 3: Create your variation
Section titled “Step 3: Create your variation”You are now in the visual editor. The page you see is the Original (Control). You need to create a variation.
- In the variation list at the top, click “Create Variation”
- Name it (e.g., “Direct CTA”)
- You are now editing the variation — changes you make here only affect visitors who see this variation
To change text:
- Click on the text element you want to change (e.g., the CTA button)
- A toolbar appears — click “Edit Text”
- Type your new text (e.g., “Start Free Trial”)
- Click outside the element to confirm
To change an image:
- Click on the image
- Click “Change Image” in the toolbar
- Enter the URL of your new image or upload one
To change styles:
-
Click on any element
-
Click “Edit Styles”
-
Modify colors, fonts, sizes, or spacing
-
When done, click “Save” in the top right
Step 4: Set your goal (metric)
Section titled “Step 4: Set your goal (metric)”A goal defines what you are measuring. For your first test, keep it simple — one primary goal.
- In the experiment editor, click “Metrics” in the left panel
- Click “Add Metric”
- Choose a metric type:
- Click — Track clicks on a specific element (best for CTA tests)
- Pageview — Track visits to a specific page (best for conversion funnels)
- Custom event — Track a JavaScript event (ask your developer to set this up)
- Configure the metric:
- For a click goal: click the element you want to track, or enter a CSS selector
- For a pageview goal: enter the URL of the success page (e.g.,
/thank-you)
- Name the metric (e.g., “CTA Button Clicks”)
- Mark it as the primary metric
Step 5: Target your audience
Section titled “Step 5: Target your audience”Decide who should see the experiment. For your first test, start broad.
- Click “Audiences” in the left panel
- Choose targeting:
- Everyone — All visitors see the experiment (simplest)
- Custom audience — Target specific visitors (e.g., returning visitors, US only)
- If using a custom audience, add conditions:
- Example: “Country is United States AND Device is Desktop”
Tip: Start with “Everyone” for your first test. Narrower audiences require more traffic to reach significance.
Step 6: Set traffic allocation
Section titled “Step 6: Set traffic allocation”Traffic allocation controls what percentage of qualifying visitors enter the experiment.
- Click “Traffic Allocation” in the left panel
- Set the percentage of visitors who should be in the experiment (default: 100%)
- The traffic is split evenly between your variations (e.g., 50% Original, 50% Variation)
Tip: For your first test, keep 100% allocation with a 50/50 split. This gets you results fastest.
Step 7: Launch the experiment
Section titled “Step 7: Launch the experiment”Before launching, review your setup:
- ✅ Variation created with a clear, testable change
- ✅ Primary metric defined
- ✅ Audience targeting set
- ✅ Traffic allocation configured
When ready:
- Click “Start Experiment”
- Confirm in the dialog
- The experiment is now live — visitors start being split between Original and Variation
Important: Once launched, do not change the variations. Modifying a running experiment invalidates the results. If you need to make changes, pause the experiment first.
Step 8: Read your results
Section titled “Step 8: Read your results”Give the experiment time to collect data. Optimizely’s Stats Engine will tell you when results are statistically significant — do not declare a winner prematurely.
- Navigate to “Results” in the experiment
- You will see:
- Improvement — The percentage difference between Original and Variation
- Statistical significance — Whether the result is likely real (not random chance)
- Confidence interval — The range of possible true improvement values
How to interpret:
| What you see | What it means | What to do |
|---|---|---|
| Positive improvement, significant | The variation is winning | Consider implementing the change permanently |
| Positive improvement, not yet significant | Too early to tell | Keep the experiment running |
| Negative improvement, significant | The variation is losing | Stop the experiment, keep the original |
| Near-zero improvement | No meaningful difference | Stop the experiment, try a bolder change |
When to stop:
- Stats Engine shows “significant” for your primary metric
- OR the experiment has run for at least 2 weeks with no trend
- OR business needs require a decision
What to do next
Section titled “What to do next”Congratulations — you have run your first A/B test! Here is how to build on this:
- Run another test — Use the losing variation’s insights to form a new hypothesis
- Try multivariate testing — Test multiple elements simultaneously
- Add personalization — Deliver the winning variation only to specific audiences
- Connect to ODP — Target experiments to behavioral segments for higher impact