---
title: Template testing (Shopify)
slug: template-shopify
description: How Shopify template tests work in Personizely: A/B test or personalize alternate templates via ?view=, creating templates, theme switching and deploying.
image: https://archbee-image-uploads.s3.amazonaws.com/1y1Fr-DMGy_apx7FwibyA/ORDTWfNKMXiY3ZRv0QSgP_personizely-docs-og.png
docTags: 
createdAt: 2026-10-16T19:40:32.650Z
---

A template test shows a different Shopify template, such as an alternate product, collection or home page template, to a share of your visitors on your live theme. It's the way to test a new page layout built in the Shopify theme editor without duplicating the whole theme. You can also run it as a personalization, showing a template to a specific audience.

**Available on:** Shopify. **Plan:** template campaigns must be included in your plan.
**Available as:** A/B test · Personalization

:::hint{type="info"}
**Test or personalize.** You can run a template campaign as an **A/B test**, where visitors are split at random and you measure which version wins, or as a **personalization**, where each variation is shown to a specific audience, with an optional control group to measure the lift. The setup is the same; [Personalizations](https://docs.personizely.net/personalizations) covers what's different.
:::

## How it works

1. **You pick the original template and a variation template.** For example, the original `product` template against an alternate `product.new-layout` template, both in your published theme.
2. **Variation visitors are redirected to the alternate template.** When a visitor in a variation opens a page that uses the original template, the snippet reloads that page with Shopify's `?view=` parameter (for example `?view=new-layout`). Shopify then renders the same page with the variation's template.
3. **The address bar is cleaned up.** After the page loads, the `view` parameter is removed from the address bar.
4. **The view is recorded once the variation page loads.** Control visitors see the original template and are counted straight away, unless you turn on [Reload the page for the control group](docId:9lUkx0Md8Jw22KSJuaSFR).
5. **Every matching page view redirects.** Unlike a [theme test](https://docs.personizely.net/theme-shopify), each page view of a matching template goes through the `?view=` reload for variation visitors.

## Set up a template test

1. Go to **Campaigns → New campaign → Template**, and choose **Experiment** or **Personalization**.
2. Choose the **Template type** and the **Original template**:

| Template type | Shopify templates               |
| ------------- | ------------------------------- |
| Homepage      | `index`                         |
| Products      | `product` and its alternates    |
| Collections   | `collection` and its alternates |
| Pages         | `page` and its alternates       |
| Blogs         | `article` and its alternates    |

3. For each variation, **Select template** to use an existing alternate template, or **Create new template** to duplicate an existing template of your theme into a new one, which you then edit. A new template's name may contain letters, numbers, dashes and underscores, and must not already exist. The copy is created as `templates/<type>.<name>` in the theme and keeps the original's format (JSON or Liquid).
4. Click **Edit** to open the variation template in the Shopify theme editor and build your layout. Use **Preview** to see it on a real product, collection or page.
5. To test several page types at once, add another template type to the campaign. Each variation then has one template per type.
6. Set the target, goals and traffic split, and start the campaign.

| Option                                | What it does                                                             | Values / default                              |
| ------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------- |
| Template type                         | Which kind of page the test runs on                                      | Homepage, Products, Collections, Pages, Blogs |
| Original template                     | The template whose pages are tested                                      | Any template of that type in your theme       |
| Template (per variation)              | The template variation visitors see                                      | An existing alternate template, or a new copy |
| Reload the page for the control group | Advanced settings, experiments only: control visitors get one reload too | Off                                           |

## Reload the page for the control group

A variation is counted only after its `?view=` reload lands, so visitors who leave during it are missing from the variation, while control visitors are counted straight away. Turn on **Reload the page for the control group** under **Advanced settings** so both groups go through the same second page load before they're counted. The trade-off is one extra page load for control visitors. See [Split URL testing](https://docs.personizely.net/url-split#reload-the-page-for-the-control-group) for more detail.

## Behavior details and limitations

- **Exact template match.** The test runs on pages rendered with the original template you selected. A product assigned a different template in Shopify admin (for example `product.preorder`) isn't included unless you add that template as an original too.
- **Pages already using `?view=` are skipped.** If a URL already has a `view` parameter, for example from a link or another app, the template test doesn't run on it.
- **Templates belong to a theme.** Templates are tied to the theme they were created in. If you publish a different theme during the test, the campaign shows "Templates in this campaign belong to a different theme than the one currently published on your store." Variation visitors are still redirected with `?view=`, but if the new theme has no template with that name, Shopify shows its default template, so the variation looks the same as the control. Stop the test, or recreate the templates in the new theme, before switching themes.
- **New templates are copies.** Personizely doesn't create templates from scratch. **Create new template** duplicates an existing template of your theme and keeps its format, JSON or Liquid. You then edit the copy.
- **The app embed must be enabled.** The test relies on the Personizely app embed in your theme to know which template a page uses.
- **Crawlers see the original template.** Bots don't run the snippet.
- **Deploying overwrites the original template.** [Deploying](https://docs.personizely.net/deploy-winners) copies the winning variation template's content over the original template in your published theme. You can also pick **Themes to deploy to** (other themes that should get the same change) and **Remove campaign templates after deployment** (delete the variation templates once copied). This is permanent, and the campaign can't be restarted; clone it to run a similar test. Personalizations can't be deployed.

## Running it as a personalization

- **One target per variation, first match wins.** Each variation has its own target, and a visitor gets the first variation in the list whose target they match. Put narrow audiences above broad ones. A visitor who matches no variation sees the original template.
- **Control group.** 25% of matched visitors by default see the original template and are counted as control.
- **No control reload.** **Reload the page for the control group** is available for experiments only, so in a personalization control visitors are counted straight away while variation visitors are counted after the `?view=` reload lands.
- **Live or Permanent.** With **Live**, the target is checked on every matching page view, so a visitor who stops matching sees the original template on the next page. Use **Permanent** to keep their first variation.
- **No deploy.** Personalizations can't be deployed, so the report has no **Deploy**. A personalization keeps running until you stop it, and you can edit its variations and targets as needed. To stop measuring and show it to every matching visitor, set the control group to 0%.
- **Example audience:** a different product template, such as `product.outdoor`, for visitors who have browsed one collection, using the [Page view history filter](https://docs.personizely.net/page-view-history) on `/collections/outdoor`.

## Examples

- **Product page layout:** `product` against `product.reviews-first`, a copy with the reviews section moved above the description. Primary goal **Purchase**, revenue per visitor.
- **Collection grid density:** `collection` against `collection.three-columns` with larger product cards, measured on add to cart and purchase.
- **Homepage for returning visitors:** a template personalization that shows `index.returning` to returning customers.

## Troubleshooting

- **The variation looks identical to control** → the variation template doesn't exist in your published theme. Check for the "different theme" warning in the campaign.
- **Some product pages aren't in the test** → those products use another template in Shopify admin, or their URLs already carry `?view=`.
- **The variation shows fewer visitors than control** → visitors leave during the `?view=` reload. Turn on **Reload the page for the control group**.

## Related

- [Theme testing (Shopify)](https://docs.personizely.net/theme-shopify)
- [Split URL testing](https://docs.personizely.net/url-split)
- [Install on Shopify](https://docs.personizely.net/install-shopify)
- [Revenue attribution](https://docs.personizely.net/attribution)
- [Scheduling, stopping and deploying winners](https://docs.personizely.net/deploy-winners)
