Theme tests
Compare a whole alternate theme against your live theme to see which one converts and earns more.
What a theme test is
A theme test measures your live theme against a second, complete theme that already exists in your store. It is the widest test type: instead of changing one page or one template, you are comparing two full storefronts — layout, sections, settings, and code — end to end. AB Test assigns each visitor to one theme or the other, keeps that assignment stable for their visit, and records views, conversions, and revenue for each so you can tell which theme performs better across the whole shopping journey.
You prepare the challenger theme yourself. AB Test never creates, edits, duplicates, or publishes theme files — it only serves the theme you point it at. Typically you duplicate your live theme in Online Store > Themes, make your changes on the copy, and leave it unpublished. That unpublished copy becomes the challenger in the test.
Your live (published) theme stays live for everyone. Visitors assigned to the challenger see it through a temporary preview, not because it was published.
How it works
Every theme in a Shopify store has a numeric theme ID. AB Test serves the challenger by appending Shopify's ?preview_theme_id=<id> parameter to storefront URLs for visitors assigned to that variant. The control variant sees your normal published theme. Because assignment is stable, a visitor stays on the same theme for the duration of their visit rather than flipping between the two.
Revenue and conversions are attributed the same way as every other test type: the storefront app embed stamps an anonymous visitor id (_ab_vid) that rides through to the order, so a sale is credited to the theme the visitor was actually assigned — even when checkout happens on Shop Pay or a third-party checkout. See Revenue attribution for details.
Enable the app embed on both themes
This is the one requirement that is easy to miss. Tracking only works on a theme where the AB Test app embed (the theme app extension) is enabled. Your live theme already has it from setup — but a duplicated theme does not automatically carry an enabled embed into the state you need. Enable it on the challenger theme as well, or visitors assigned to it will be served the theme but will not be tracked.
If the app embed is off on the challenger theme, that variant records no views, conversions, or revenue and your results will be skewed toward the control. Enable it on both themes before you launch.
To enable the embed on a theme:
- Go to Online Store > Themes.
- Find the theme you want, then open Customize (use the theme's action menu to customize a specific unpublished theme).
- Open App embeds in the left sidebar.
- Turn on the AB Test embed, then save.
- Repeat for the other theme so both the live and challenger themes have it enabled.
When to use a theme test vs a template test
Theme tests and template tests both serve an alternate experience without redirecting to a new URL, but they operate at different scopes. Choose based on how much you are changing.
| Theme test | Template test | |
|---|---|---|
| Scope | An entire alternate theme | One alternate template on your live theme |
| What you prepare | A duplicate or alternate theme, edited by you | An existing template suffix you already have |
| How it is served | ?preview_theme_id | ?view=<suffix> |
| Best for | Redesigns, global layout, header/footer, theme settings | A single page type — one product, collection, or landing layout |
Use a theme test when your change spans the whole store or you are evaluating a redesign as a package. Use a template test when the change is contained to one page type and you would rather not maintain a second full theme. In both cases AB Test only serves what already exists — it never creates or modifies theme files for you.
Set up a theme test
- In Online Store > Themes, duplicate your live theme (or start from another existing theme) and make your changes on the copy. Leave it unpublished.
- Enable the AB Test app embed on both your live theme and the challenger theme, as described above.
- In AB Test, create a new experiment and choose Theme as the test type.
- Set your control to the live theme and select the challenger theme for the variant.
- Optionally add audience targeting rules so the test runs only for the visitors you want.
- Set a schedule. Experiments auto-end at their scheduled end date.
- Launch, then watch Results and apply the winner when you are confident.
Keep the challenger theme identical to your live theme except for what you are testing. If two things change at once, the result can't tell you which one moved the numbers.
Reading and applying results
AB Test reports each theme's conversion rate, revenue, and probability to be best using Bayesian statistics, with breakdowns by device, new vs returning, country, UTM, referrer, and cookie. When the challenger theme is the clear winner, you can apply it — then publish that theme in Shopify to make it live for everyone. Because the app never publishes themes on its own, promoting the winning theme to live is always your explicit action in the Shopify admin.
Requirements and limits
- The challenger must be an existing theme in your store that you prepared — AB Test does not build it for you.
- The app embed must be enabled on both the live and challenger themes.
- Keep the Web Pixel enabled so conversions and revenue are captured.
- Theme tests are available on the Premium and Enterprise plans. The Base plan includes any two test types; confirm Theme is one of yours before you build the challenger.
Still deciding which test type fits your change? See What to test, or compare with URL redirect tests and JavaScript API tests.