My boss for some reason wants to try to implement A/B Testing (or Split Testing) in JavaScript. Anyone know of any good JavaScript packages/libraries/solutions to implement A/B Testing?
A/B testing is the practice of comparing multiple variations of elements on your webpage at a time and picking out the best. You can perform A/B tests at different levels- you can test different colours of the CTA button, change the headlines, etc.
JavaScript is Used in AB Testing Software Some visitors will see only this default version of the website. For some visitors, our JavaScript is then injected and executed. The AB Testing software determines who sees the default web page and who will see a variation of the page.
One of the most preferred and enterprise-level A/B testing tools is Visual Website Optimizer (VWO). Hundreds and thousands of brands worldwide use Visual Website Optimizer (VWO) as an experimentation platform to carry out A/B tests on products, websites, or applications.
Here's this: http://ejohn.org/blog/genetic-ab-testing-with-javascript/
Are you trying to test the marketability of your site or the performance of your code or what?
Assuming marketability, you could simply have some JS that appends a class name to your body tag (+ whatever else) based on a random number. Then record the random choice and outcome (when the visitor clicks something, also record which random layout they were presented with) via whatever analytics engine you use. You could also consider using cookies to ensure returning visitors get the same treatment.
I don't know of a code quality a/b framework for JS but the idea would be similar. Define what constitutes higher quality (lower milliseconds of execution time?), run the variations of the code and see which comes out ahead. Tools like JMeter and JSUnit might be helpful for these purposes.
I have found this simple, open-source JS tool quite useful: https://github.com/jamesyu/cohorts
It doesn't have all the features you might want, but it's free, flexible, pretty well and tidily written, and you can always hack on it to support additional requirements.
Supports Google Analytics (via event tracking) and other back-ends.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With