Shopify variations
Test a draft theme or an alternative template in your Shopify store.
If your website runs on Shopify, you can test whole themes or page templates without writing code. ABlyft offers two variation types for it: Shopify Theme and Shopify Template.
Before you start, the ABlyft snippet must be installed in your Shopify theme, and the experiment needs a page and a goal like any other experiment.
Shopify Theme
Shows a draft theme of your store to a part of your customers before you publish it.
- In Shopify, go to Online Store → Themes and prepare your draft theme (do not publish it).
- Open the Edit code page of the draft theme. The theme ID is part of the URL, for example
themes/123456789. - In ABlyft, create a variation of the type Shopify Theme, see Variations.
- In the section Shopify Theme, enter the Draft theme ID (numbers only, up to 12 digits) and save.
When a visitor is assigned to the variation, the snippet waits until Shopify is available on the page. If the visitor does not see the draft theme yet, the snippet redirects to the preview of that theme and hides Shopify's preview bar.
Shopify Template
Shows an alternative template of a page type, for example a second product page layout. It works with all page types: product, collection, page, blog, article, cart, search and customers.
- In your theme, create the alternative template, for example
product.alternate.liquidorproduct.alternate.json. - In ABlyft, create a variation of the type Shopify Template.
- In the section Shopify Template, enter the Template name. Only the part between the page type and the file
ending is used. For
product.alternate.liquidenteralternate. - Save.
The snippet then reloads the page with the parameter ?view=alternate, which makes Shopify render the alternative
template. If the page already has a view parameter, the snippet does not redirect.
Template and theme must exist
ABlyft does not check whether the theme ID or the template exists in your store. Preview the variation (see below) before you start the experiment.
Preview and goals
- Use Show in browser in the menu of the variation, or the preview of the experiment, to check how the theme or template looks. See Preview & QA.
- Goals work as in every other experiment. See Goal types. For purchases and revenue in Shopify, ABlyft supports order tracking through a webhook or through the Customer Event pixel, see Shopify tracking.
Related
For developers: the underlying functions are shopifyPreviewTheme and shopifySwitchTemplate in the
JavaScript tools.