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: Developer Documentation - Prismic

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


1 Like

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.


Following this post: How to do A/B Testing with Gatsby and Prismic?
I was wondering if there is an API available today to use Google Optimize with Prismic?

If not, what is the best process for doing A / B Testing with Prismic?



@guillaume.blanc I have checked with our production team and I've been informed that we have no short-term plan to manage experiments for now.

I will keep this thread open if somebody from the community has tried to implement this on their own.

This issue has been closed due to inactivity. Flag to reopen.

Hi @Fares/@renaud,

Six months after this issue was last discussed here, would you mind if I asked if the picture has changed?

Today Google Optimize has of course the necessary API which was the cause of the problem reported in this thread in June last year.

Is the experiments feature on the roadmap? Is it Prismic's intention to bring this feature back, or is it retired permanently?

We have an active A/B split testing requirement around our Prismic solution and would be grateful for any insight on the above, as well as any broader recommendations, so we can plan our way forward.

Many thanks,


1 Like

Hi Chris,

I'm going to reach out to the team to get more information about this and get back to you.


Hi again,

So I talked with the team and passed them the documentation for the Optimize API. The API provided by Optimize seems to be a way to display a given variant (A/B) to your user's website, not for an application like us to create experiments programmatically. Although we'll have to look further into it.

So for the moment, the best way to do A/B testing with Prismic is still something like Optimizely I think. You can also try Renaud's recommendation above.


Hi all,
@PrismicIs there any news regarding Google Optimize, or other A/B testing tools?
Maybe there is someone from the community who could explain his solution.
Thanks in advance :slight_smile:

Hello @website3, at the moment there are no plans to implement native Prismic functionality to work with A/B testing.

Hi Pau, thank you very much for your answer. We have already noted that Prismic does not offer this functionality.

However, I would also just like to know what external too (Google Optimize,, Optimizely) you (Primsic) recommend for A/B testing or what others in the community use to perform A/B testing with Primic and Gatsby.
Thanks. Ani

I think Netlify has an A/B testing feature. You could serve both master ( a ) and a b branc to serve content from a fixed Prismic release. To start an A/B test you'd have to input different content on your b release and then to start the test on Netlify. It can be a workaround.

Also, I've seen users implementing Google Optimize. might be worth checking out.