Variants

Template Tests

Test an alternate Shopify template against the default for products, collections, pages or blog posts, and make the winner permanent.

Intermediate6 min read

A template test shows the visitors assigned to a variant an alternate template for a page type — a different product page layout, say — while the control keeps the default template. It works on all your products (or collections, pages, blog posts) at once, or only on the ones you pick.

This is a Shopify-only test type. On an HTML site the Template test row does not appear. To test a whole theme instead, see Theme Tests.

Create the Alternate Template First

An alternate template is a second template for a page type in your live theme, such as product.alternate.json next to the default product.json. Create it in Shopify either way:

  • Theme editor — in Online Store → Themes → Customize on your live theme, open the template picker at the top, choose the page type (for example Products), click Create template, name it and build its sections.
  • Code editor — in Online Store → Themes → ⋯ → Edit code, add a new template under templates/ (for example product.alternate.json).

The part after the page type — alternate in product.alternate.json — is the template’s suffix. Split Test Pro lists the alternate templates of your live theme, so the template must exist there; it does not need to be assigned to anything.

Setting Up a Template Test

On the experiment’s Variants step, open the variant’s card and tick Template test. The panel has:

  • Page type — Products, Collections, Pages or Blog posts. Changing it clears the template and the items.
  • Control template — locked to the default (Default product, product.json), with Templates from your live theme: Dawn under it.
  • Variant template — the alternate templates for that page type (Product · alternate, with its file name under it). If there are none, the panel says No alternate templates in Dawn. Add one in the theme code editor.
  • Apply to — All products or Selected products (the noun follows the page type).

With All, every item of that type that uses the default template shows the alternate one to variant visitors. With Selected, click Select products to open the picker: search, tick the items and click Add N. The picked items show as chips you can remove with ×. You can pick up to 500.

The launch checks list “choose a template for Variant A” while no variant template is chosen, and “pick at least one product for Variant A” when Selected has no items.

You can also ask Splitty for a template test when the template exists in your live theme. Splitty’s template tests apply to all items of the page type; pick specific items yourself afterwards.

Pages, Blog Posts and the Read Content Permission

To list your pages and blog posts in the picker, Split Test Pro needs Shopify’s Read content permission (pages and blog posts). Stores that installed before template tests shipped are asked by Shopify to approve it the next time they open the app; the prompt lists the new permission and Split Test Pro doesn’t change anything in your store with it.

Until it is approved, choosing Pages or Blog posts shows Split Test Pro needs permission to read your pages and blog posts. Grant it in Shopify. and the picker is disabled. Follow the link, approve the update, and come back. Products and collections don’t need it.

How It Renders

Shopify renders an alternate template when the page’s address carries view=<suffix>. When a variant visitor opens a page of the chosen type that uses the default template — and, with Selected, one of the picked items — the Split Test Pro script reloads it once with ?view=alternate added, keeping the rest of the address. The visitor’s address bar shows the parameter on those pages; other pages are untouched. The control and visitors outside the test see the default template.

If the suffix ever stops existing in the theme, Shopify falls back to the default template, so visitors see the control’s page rather than an error.

SEO

An alternate template is the same product (or collection, page, post) at the same canonical URL — view only changes how Shopify renders it. There is no second page to noindex, unlike a redirect test.

Combining With Other Test Types

A Template test combines with Code · CSS & JS, URL redirect and Theme test in the same variant. With a Theme test, the template still comes from your live theme, so add the same alternate template to the variant theme too. See Variant Types Overview.

Making It Permanent

When the template wins, the Results page shows a Make it permanent block: Variant A wins with the template product.alternate. Assign it to all products in Shopify to make it permanent. Open products opens the products list in your Shopify admin — or the product itself when exactly one was selected. On each item, choose the template under Theme template and save.

Until you do, Winner Rollout can keep serving the template to everyone. Assign it in Shopify before you stop serving, otherwise visitors return to the default template. See Declaring a Winner.

Next Steps

Ready to ship a winner?
Start free today.

Sign up free in under a minute — no credit card, no installation steps until you're ready.

  • No credit card
  • 14-day free trial