Skip to content

Web Experimentation

beginner
📜Foundationexperimentation

Marketing teams generate hypotheses constantly — that a different headline would convert better, that moving the CTA above the fold would increase clicks, that showing social proof would build trust. Testing these hypotheses should not require a development sprint.

Web Experimentation lets marketers create and run tests directly on live pages using a visual editor. Changes are applied client-side through a JavaScript snippet — no code deploy, no developer dependency, no waiting for a release cycle.

Web Experimentation operates through a JavaScript snippet added to your site’s <head> tag. When a visitor loads a page:

  1. The snippet loads the experiment configuration
  2. It evaluates whether the visitor qualifies for any active experiments
  3. If yes, it modifies the page DOM to apply the variation
  4. It tracks visitor behavior (clicks, form submissions, page views)
  5. Results are sent to the Optimizely analytics backend

The snippet is designed to load early and apply changes before the page renders visually, preventing “flicker” — the brief flash where visitors see the original content before the variation appears.

The visual editor lets you modify page elements without code:

CapabilityWhat you can do
Text changesEdit headlines, body copy, button labels
Image swapsReplace images with alternatives
Element hidingRemove elements from the page
Style changesModify colors, fonts, sizing, spacing
Element rearrangingMove elements to different positions
HTML insertionAdd new elements to the page
Redirect testsSend visitors to entirely different page URLs

For changes beyond what the visual editor supports, you can write custom JavaScript and CSS in the code editor.

The most common experiment type. You create one or more variations of a page element and split traffic between them.

Example: Test two different headlines on a landing page.

  • Control (A): “Start Your Free Trial”
  • Variation (B): “See It In Action — Free for 14 Days”

Traffic is split 50/50. After reaching statistical significance, the winning headline is identified.

Test multiple elements simultaneously to find the optimal combination.

Example: Test headline AND button color together.

  • Headline A + Green button
  • Headline A + Blue button
  • Headline B + Green button
  • Headline B + Blue button

MVT requires more traffic than A/B tests because it tests all combinations. Use MVT when you believe elements interact with each other.

Send visitors to entirely different page URLs to test completely different page designs.

Example: Test a long-form landing page vs. a minimal page.

  • Control: /pricing (current detailed page)
  • Variation: /pricing-v2 (new minimal design)

Test changes across multiple pages in a visitor’s journey. The variation is consistent across all pages in the experiment.

Example: Test a new navigation design across the entire checkout flow (cart → shipping → payment → confirmation).

You control who sees experiments using audience conditions:

Condition typeExamples
URL targetingSpecific pages, URL patterns, query parameters
BehavioralNew vs returning, pages visited, time on site
GeographicCountry, region, city
TechnologyBrowser, device type, operating system
Custom attributesData layer values, cookies, JavaScript variables
Third-partyDMP segments, Google Analytics audiences

Audiences can be combined with AND/OR logic. For example: “Returning visitors from the US on mobile devices who have visited the pricing page.”

Every experiment needs metrics to measure success:

Metric typeWhat it measuresExample
ClickClicks on a specific element”Sign Up” button clicks
PageviewVisits to a specific pageVisits to /thank-you
Custom eventJavaScript-triggered eventsForm submissions, video plays
RevenuePurchase valueCart value at checkout
EngagementTime on page, scroll depthScroll to bottom of page

Set a primary metric (the main thing you are optimizing for) and secondary metrics (additional insights). Optimizely adjusts for multiple comparisons to prevent false positives.

Web Experimentation uses Stats Engine, Optimizely’s statistical methodology that provides always-valid results.

How it differs from traditional A/B testing:

Traditional testingStats Engine
Fixed sample size required upfrontCheck results any time
Can only evaluate at the endAlways-valid confidence intervals
p-value can be misleading if checked earlyResults are accurate at every check
Manual correction for multiple metricsAutomatic false discovery rate control

Stats Engine means you do not need to pre-calculate sample sizes or resist the urge to peek at results. The confidence intervals it reports are valid regardless of when you look.

Use Web Experimentation when:

  • You want to test visual changes (copy, images, layout)
  • Marketers need to run tests without developer involvement
  • You need results from the client side (browser-level changes)
  • You want to run quick tests before a campaign launch
  • You need personalization campaigns alongside experiments
  • Your changes are on public web pages (not behind authentication)

For backend logic, API-level changes, or cross-platform experiments, use Feature Experimentation instead.