Skip to content

A/B Testing

A/B Testing

Show two different add-on groups to different visitors on the same product, compare how each performs, and roll out the one you want to keep.

Plan requirement: A/B testing is a Pro feature (ab_testing), included on Pro, Agency, and Enterprise licences. On a plan without it, Smart Add-Ons → A/B Tests shows an upgrade notice instead of the builder. See Licensing.

What a test does

A test pairs two existing add-on groups: variant A and variant B. While the test is active, each visitor to a product covered by the test sees exactly one of the two groups — the other is removed from the page for that visitor, so nobody sees both.

The groups themselves are unchanged. Their fields, pricing, conditional logic, and assignments all behave exactly as configured; the test only decides which of the two is shown.

Before you create a test

  • Build both variants as normal add-on groups first — a test compares two groups, it does not create them.
  • Assign both groups to the same products. A visitor placed in a variant whose group is not assigned to the product they are viewing simply sees no add-on group there.
  • Change one thing at a time — pricing, wording, or field order — so the result tells you something.
  • Keep both groups active. A group hidden by status, role, or group-level conditions stays hidden inside a test.

Creating a test

  1. Go to Smart Add-Ons → A/B Tests.
  2. Under Create new test, enter a Test name you will recognise later.
  3. Set Traffic to variant A (%). It accepts 1–99 and defaults to 50; the remainder goes to variant B.
  4. Pick the add-on group for Variant A and the one for Variant B.
  5. Click Create test. New tests start active straight away — there is no separate publish step.

How traffic is split

The first time a visitor loads a product covered by an active test, the plugin assigns them a variant and stores it in their WooCommerce session under saue_ab_{test id}. Every later page view in that session reuses the stored value, so a visitor does not flip between variants while they shop.

The assignment is derived from the visitor’s WooCommerce session identifier combined with the test ID, mapped onto a 0–99 bucket and compared against your traffic split — deterministic for a given session rather than re-rolled on each page load. Visitors with no WooCommerce session yet are assigned from a fresh value.

Assignments live in the WooCommerce session, so they last as long as that session does. Clearing cookies or switching browser puts the same person back through assignment.

Measuring a test

Analytics events store the group_id of the group that was actually shown, so views, selections, and add-on orders for each variant accumulate separately under that variant’s group ID. That data is the basis for comparing the two.

The A/B Tests screen itself is a list, not a report: it shows each test’s name, status, the two group IDs, and the split. It does not calculate conversion rates, revenue per variant, or statistical confidence, and it never selects a winner on its own — reading the result and making the call is up to you. See Analytics for what is recorded and how to query it.

Declaring a winner

On an active test, use Declare A winner or Declare B winner. That records the winning group on the test and marks the test completed.

From then on the losing group is removed from the product page for every visitor and all traffic sees the winner, regardless of any variant they were previously assigned. The test row stays in the list so you keep a record of what was run.

To stop a test without picking a winner, move its status away from active through the API below. Only active tests are applied on the storefront; the admin screen has no pause button.

What a test stores

Each test is one row in wp_saue_ab_tests:

ColumnContents
nameThe label you gave the test.
group_a_id, group_b_idThe two add-on groups being compared.
traffic_splitPercentage of traffic sent to variant A, between 1 and 99.
statusOnly tests marked active are applied on the storefront.
winner_group_idEmpty until a winner is declared; afterwards, the group everyone sees.

API: create a test and declare a winner

Both routes require a user who can manage WooCommerce. traffic_split is clamped to 1–99.

POST /wp-json/saue/v1/ab-tests
Content-Type: application/json

{
  "name": "Gift wrap wording",
  "group_a_id": 7,
  "group_b_id": 9,
  "traffic_split": 50
}

PUT /wp-json/saue/v1/ab-tests/3
Content-Type: application/json

{
  "winner_group_id": 9,
  "status": "completed"
}