♻️Switching Themes

Switching themes is often a core part of the theme management workflow for Shopify stores. If you switch themes often, read below to understand how you can minimize the impact on your live tests.

Switching themes while tests are live

If you are running an active test and switch themes, then as long as the tested templates continue to be available in your new theme, the test will be unaffected and continue to run.

This is the case when switching from one theme to a new theme via the Shopify Admin, as well as when switching from one version of a theme to a new version via Github.

What to be aware of when switching themes

Occasionally, tests will be drafted and test templates will be created after a branch for a new theme has been created. In this case, there is potential for the new theme to exclude any templates created for the currently active test when the theme is published.

If a new theme is published and does not include the templates required for an active test, the test will be ended immediately.

How to ensure your new theme contains the relevant Shoplift files when switching or deploying new themes

If you often switch or deploy new versions of your live theme, ensure that any theme files created by Shoplift are present in your new theme:

  • theme.liquid tracking script: make sure that the Shoplift tracking script is maintained in your theme.liquid file directly after the opening <head> tag

  • shoplift.liquid tracking snippet: make sure that in the /snippets directory in your new theme, you have the shoplift.liquid tracking snippet included

  • shoplift.css Brand Styles asset: if you use Brand Styles and Lift Assistβ„’ theme sections for testing, then ensure that your Brand Styles CSS file persists in your new theme

  • "sl" prefixed sections and snippets: if you use Lift Assistβ„’ theme sections for testing or on your live website, then ensure that your new theme includes any section and snippet files with the file prefix of "sl" (like "sl-image-hero", for example).

We suggest that if you change your theme often, you plan your testing strategy around this workflow as not to interrupt testing.

Last updated

Was this helpful?