Theme Update for A/B Tests
Theme Update
This change is not essential but is recommended. We also recommend allowing Sort'd to apply this change for you by selecting 'Automatically Added by Sort'd' when going live with a test. When this is selected, the following is not required as it'll be completed by our development team.
The following is only recommended for those with development experience.
All functionality to run A/B tests are added as a theme app extension. Meaning no changes to your theme are needed.
Out of an abundance of caution, you can update your theme's canonical tags to ensure the tests are fully compliant with search engines. The following screenshots show how this change can take place.
Before

After

If the value at collection.metafields['app--3094213']['variantA'].value.handle is not blank, then that should be used in canonical URL, otherwise how your theme currently implements canonical tags should be used.
An example code snippet is below.
{% assign ab_test_canonical = collection.metafields['app--3094213']['variantA'].value.handle %}
{% if ab_test_canonical != blank %}
{% liquid
assign current_url_handle = routes.collections_url | append: '/' | append: collection.handle
assign canonical_url_handle = routes.collections_url | append: '/' | append: ab_test_canonical
%}
<link rel="canonical" href="{{ canonical_url | replace: current_url_handle, canonical_url_handle }}" />
{% else %}
<link rel="canonical" href="{{ canonical_url }}">
{% endif %}
In this example, canonical tags are created with {{ canonical_url }}. Your theme may implement canonical tags differently.
For themes with custom or different approaches to adding canonical tags, you may need to make adjustments to this code. Our development team are on hand to assist whenever needed.