Revenue attribution

AB Test credits each order to the variant its visitor saw — including orders that finish checkout on a separate host or through a third-party checkout that never fires the storefront pixel.

The problem: some checkouts bypass the pixel

The Web Pixel that AB Test installs runs on your storefront. It records purchase events well when checkout stays on the storefront, but a growing share of orders complete somewhere the pixel cannot see:

If attribution relied on the pixel alone, these sales would go uncounted — and they are often a large fraction of revenue. Under-counting conversions on one variant quietly biases your results, so AB Test uses a second, checkout-independent path to book revenue.

The solution: a cart attribute that rides to the order

AB Test attaches an anonymous visitor id to the cart itself, so the assignment travels with the order no matter where checkout finishes. The chain looks like this:

  1. When a visitor is assigned to a variant, the storefront app embed stamps their anonymous visitor id (_ab_vid) as a Shopify cart attribute.
  2. Because it lives on the cart, that value is carried into the order as an entry in note_attributes — regardless of which checkout host or third-party provider completes the sale.
  3. Shopify fires an orders/create webhook to AB Test. The app reads note_attributes._ab_vid, looks up which variant that visitor was assigned to, and books the order's revenue to that variant.

The cart attribute travels with the cart, not with the browser session. That is what lets AB Test attribute a purchase even when the final checkout step happens on a different host or inside a third-party checkout.

What AB Test reads from an order

The orders/create webhook payload contains a lot of customer information. AB Test deliberately reads only the few fields it needs to attribute and total revenue:

FieldWhy it is read
Order idTo record the sale once and dedupe against pixel events.
TotalTo sum revenue per variant.
CurrencyTo report revenue in the store's currency.
note_attributes._ab_vidTo map the order back to the assigned variant.

AB Test never reads customer name, email, phone, or address. No personally identifiable information (Protected Customer Data Level 1) is stored, and the visitor id is pseudonymous.

Requirements for attribution to work

For an order to be credited to a variant, two things must be true:

After launching a test, place a real test order and check the order's note_attributes in the Shopify admin for an _ab_vid entry. If it is present, revenue attribution is wired up correctly for that checkout path.

Deduplication with the pixel

When checkout stays on the storefront, the same purchase can be seen twice: once by the Web Pixel and once by the orders/create webhook. AB Test deduplicates on the order id, so each order is counted at most once toward a variant's revenue and conversions. The webhook path is what fills the gap for checkouts the pixel cannot observe; the two paths together avoid both under- and double-counting.

Where attributed revenue appears

Booked revenue flows into your test's results: per-variant revenue and conversion rate, Bayesian probability-to-be-best, and the segment breakdowns (device, new vs returning, country, UTM, referrer, cookie). See Results for how to read those numbers and apply a winner.

Privacy

Revenue attribution is built to stay within Protected Customer Data Level 1: only order id, total, currency, and AB Test's own note_attributes._ab_vid are read — never customer name, email, phone, or address. Visitors are pseudonymous, opt-out consent is honored through the Shopify Customer Privacy API (which auto-detects OneTrust and Cookiebot), and attribution data is retained about 180 days before it is purged. For the full picture, see Privacy.