Use Experiments.js to A/B Test Multiple Rebuy Settings!

We do not have a native A/B testing suite within the Rebuy admin just yet. We are in the process of building one out, but we do still have an option to allow you to perform A/B testing today via Experiments.js.

Experiments.js is an optional JavaScript package that allows developers to easily A/B test Smart Cart, Widgets, and settings, using your favorite testing suites like Google Optimize, VWO, Optimizely, or your own solution. It is extremely lightweight (under 2kB) with zero dependencies.


To use the package:

Install the script in your theme's head before the closing tag </head>:

<script src="https://cdn.rebuyengine.com/onsite/js/experiments.js"></script>


Please note that you should NOT use defer or async, which allows the script to load and be ready for use before the DOM content is loaded. The script is loaded from a CDN, so download times are typically below 40ms.

Once Experiments.js is included, the package becomes globally available at window.RebuyExperiments. You can now easily use your optimization platform to run experiments!


Typically Smart Cart or the Widget being experimented on are installed to the theme with Live Mode disabled. You can use RebuyExperiments to enable the widget only for a certain segment of your traffic. In addition, you can apply settings changes via an experiment to test discount amounts, language changes, different API endpoints, or any other configuration -- it's totally hackable and totally up to you!


Be sure to keep an eye out for more Rebuy A/B Testing features on the way!


If you have more questions, please reach out to support!

Did this answer your question?