How to do A/B Testing with Gatsby and Prismic?

Hi all,

What is currently the best way to do A/B testing with Gatsby and Prismic?

I can see here that A/B Experiments is deprecated:

Does this mean that there is no way to use Google Optimize with Prismic or is there a way to work around this? There must be a lot of Prismic users with the same challenge, so I’m curious how people solve this problem


Hi Jonas,

Thanks for posting on Prismic community, It seems the the new Optimize product has now a API, so I will check with our product team and get back to you.


1 Like

Hey @Fares and @juj

Sadly to my knowledge, Optimize don’t provide yet an API that we (prismic) can use to generate Experiment with prismic. This means that we don’t have a way to provide a fully automated process like it was the case with Experiment previously. This doesn’t prevent you from managing A/B Testing in your project, though. For that, you can create yourself an experiment in Optimize & then follow the recommendation to fetch two different documents depending on the variation that you get from Optimize.

I know that some users also use slices in the same document to know which content to render—having a slice variation 1 & variation 2.

I hope this helps.

1 Like

This issue has been closed due to inactivity.