Andy AB

Andy AB is a simple, open-source experimentation framework that helps you run AB and multivariate experiments on your website.

Here are two example experiments

The first one enrolls you into either the Control cohort or the Treatment cohort. The second experiment always excludes you, just to demonstrate this feature.

The cohort you're assigned into is stored in a cookie, so you'll need to hit `Reset` to get re-enrolled.


var experiment1 = new AndyAB("AndyAB example experiment 1")
  .withCohorts(["control", "treatment"])
  .enrol()
  .whenIn("control", "#experiment1", function(element) {
    element.innerHTML = "In Control cohort for Experiment 1!";
  })
  .whenIn("treatment", "#experiment1", function(element) {
    element.innerHTML = "In Treatment cohort for Experiment 1!";
  });
        


var experiment2 = new AndyAB("AndyAB example experiment 2")
  .withCohorts(["control", "treatment"])
  // always exclude from this experiment
  .withExclusion("excluded", function() { return true; })
  .enrol()
  .whenIn("control", "#experiment2", function(element) {
    element.innerHTML = "In Control cohort for Experiment 2!";
  })
  .whenIn("treatment", "#experiment2", function(element) {
    element.innerHTML = "In Treatment cohort for Experiment 2!";
  })
  .whenIn("excluded", "#experiment2", function(element) {
    element.innerHTML = "In Excluded cohort for Experiment 2!";
  });