Search code examples
javascriptab-testing

Good Javascript A/B (Split) Testing package/library?


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?


Solution

  • 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.