This document describes the basic working of Tagalys server-side A/B testing for collection sort orders in Shopify Liquid stores, and the initial setup process.
<aside>
ℹ️ Tagalys A/B testing is not compatible with localised/translated collection handles
</aside>
How it works
- The A/B test configuration is set up on the Tagalys dashboard. This includes the number of variants (with custom sort order) and traffic percentages assigned to each.
- 30 minutes before the A/B test starts, Tagalys creates the collection variants in Shopify.
- Variant collections in detail
- Once the A/B test is live, the Tagalys JavaScript library automatically assigns and redirects users to either the primary collection or a variant. Search engine bots are also redirected.
- Once the A/B test is completed, the collection variants are deleted and the visitors are redirected to the primary collection.
Integration instructions
- Step 1: Save
tagalys_a_b_testing.liquid
in the Snippets folder of the theme.
- Step 2: Include the Tagalys A/B testing JavaScript library
- Step 3: Update the canonical URL tag
- Step 4: Use the
primary_collection
collection reference metafield to render collection details other than the product grid
- Step 5: Use
collection
to render products, sort options and filters
- Step 6: Make sure that variant collections aren’t discoverable in the front-end
Customisation
- Prevent initialisation for specific visitors
- Force-assign a user to a specific variant
- Customise collection page URLs and redirection logic
- Check if a collection is an A/B test variant