Testing product hero images stored in Sanity, does the image live in Croct or Sanity?
i want to A/B test two product hero images against each other. What I cannot figure out from the docs is where the variant image actually lives. Is the second image URL stored in the Sanity document, in the Croct variant content, or in both places? And later, when a marketer wants to swap out the losing image, what exactly do they edit and where?
1 answer
Only the default lives in Sanity. Think of it as two layers:
- The Sanity document holds the canonical hero image. That is what renders for everyone outside the test, and it is the fallback when no experience applies or a fetch fails.
- The challenger image is variant content inside the experiment. Variant content follows the slot's component schema, so if your hero component has an image field, each variant has that same field, and you paste the challenger's URL there.
You do not duplicate the control into Croct; the experiment layer only holds what differs.
On the workflow question: variant content is edited in the experience editor, no code change involved, so a marketer can swap the losing image or adjust the test themselves. An experiment holds 2 to 5 variants with a primary goal and a traffic allocation percentage, so a third image later is just another variant. If the challenger wins and you want it to become permanent, either roll the winner out from the experiment or update the Sanity document so the new image becomes the canonical default.