Skip to content

Instantly share code, notes, and snippets.

View ab-testing-spas.md

A/B testing in single-page apps

I'm curious if anyone has experience implementing A/B testing in the context of large single-page apps. Some thoughts and questions:

  • There are a handful of well-known A/B testing products like Optimizely, VWO, etc, that seem to me to be a pretty ok fit for relatively static web pages. Generally what they do is allow you (slash non-developers) to define a code variation in a WYSIWYG editor, whose output is a JS snippet that modifies the DOM to match the desired visual changes. And then you load their third party JS library into your app, and then at runtime that library injects the code variant snippets and it modifies your DOM accordingly, depending on which variation a given user should see. Then when a