Liquid Snippet
Last updated
Last updated
Shoplift also leverages a light javascript snippet to allocate tested visitors to appropriate experiences and prevent page "flicker."
When you launch Shoplift, the javascript code required for testing will deploy to your theme automatically, so you don't have to touch any code. A small theme snippet titled shoplift.liquid will be inserted into the /snippets/
directory in your live theme, and is referenced in your theme.liquid file directly after the opening <head>
tag.
If you change themes, Shoplift will detect if the testing script is present on your live theme periodically, and also each time the app is launched or a new test is launched. If the testing script is removed, then it will be redeployed automatically at one of these times.
If you modify your theme, please ensure that the code in your theme.liquid remains directly beneath the opening <head>
tag, because this ensures that it can operate as quickly as possible to provide a smooth testing experience on your website.
The Shoplift tracking script has a minimal impact on pagespeed, to the tune of around a 2 point reduction when measured with Google's page performance tool.
We do not recommend removing the Shoplift script because it is required to run A/B tests. If you want to uninstall Shoplift from your store, see Uninstalling Shoplift.