Previewing personalized variants alongside Sanity drafts before publishing
I am a content strategist trying to get our review flow spelled out before we launch our first experiment. Today editors preview draft documents in Sanity before publishing and stakeholders sign off on that preview.
Once experiment variants enter the picture I need the equivalent: a way for stakeholders to see variant B exactly as a matching visitor would, before anything goes live. Ideally something I can just send in a slack message.
How does previewing work on the Croct side, and is there anything the dev team needs to set up for it in advance?
1 answer
The Slack-message workflow you describe is pretty much exactly how it works. From the experience or experiment editor you generate a preview link for a specific variant. The links are shareable, valid for 24 hours, and can be regenerated when they expire, so you send stakeholders a fresh link per review round.
When someone opens the link they see your real site with that variant applied, plus a widget in the bottom-right corner showing exactly what they are looking at: the experience, experiment, audience, variant, and locale. That widget saved us a lot of "wait, which version am I seeing" confusion in reviews.
Three things the dev team should have in place first:
- The slots need to be integrated in the frontend, previews render through the same slots as production.
- The slot versions in code must match what you are previewing.
- The domain you preview on has to be listed in trusted origins in the Croct settings, otherwise the link will not activate.
Once those are set, generating links is entirely a content-team action, no dev involvement per review.