A simple framework for handling common tasks with the Myna Split Testing framework
JavaScript CoffeeScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Enganno is a Javascript framework to make working with the Myna split testing service easier. I hope to evolve it eventually to support other A/B testing frameworks, but don’t hold your breath.


  • pluggable strategies. Roll your own or use some that I built
  • readbale syntax


This librabry requires

  • the myna-js framework
  • jQuery (tested with version 1.8, but should work with earlier versions)

Quick Start

//create a reward system
rewardSystem = new enggano.reward.RewardSystem([
	new enggano.reward.strategy.DomEvent("click", ".hero-unit a.btn-primary")

//create a strategy to handle Myna's suggestion
suggestionStrategy = new new enggano.suggestion.strategy.SetBodyClass();

//create an experiment and run it
new enggano.Experiment(	
                "c095ffc4-b354-4d7f-b02c-774ed6ba7558", //the experiment id
                {timeout: 3000}, //myna config options



An experiment is the top level object. You run an experiment by providing an id, some configuration, plus a strategy and a goal.

Suggestion Handling Strategy

A strategy is what to do with each suggestion from the Myna framework. A suggestion has one main method, success, which takes the suggestion and does whatever with it. For example, you can show/hide DOM elements or put a custom class on the body element.

It often makes sense to chain suggestion handling strategies. A common use case is to record the choice set by Myna in your analytics system (e.g. Google Analytics) or perhaps to log the choice to the console for debugging purposes. I make this easy with a special strategy, CompoundStrategy, which accepts other strategies and runs in LIFO.

suggestionStrategy = new enggano.strategy.CompoundStrategy([
	new enggano.suggestion.strategy.SetBodyClass(), //sets the body class to unique identifier (to target in CSS)
	new enggano.suggestion.strategy.LogInConsole(), //outputs to the console what the choice was
	new enggano.suggestion.strategy.RecordInGoogleAnalytics() //records the choice in Google Analytics


A goal is a description of the outcome you are seeking, e.g. clicking a button or visiting a specific page. You can easily create your own goals, but I wrote some general purpose ones which will cover most cases.

Reward System

A reward system is a collection of one or more reward strategies and their values. A reward strategy tells the framework how to know if a goal occured and what the reward should be.

rewardSystem = new enggano.reward.RewardSystem([
	new enggano.reward.strategy.DomEvent("click", "#my-button", .8), //reward for clicking a buttton
	new enggano.reward.strategy.VisitMatchingUrl(/contact\/success/, 1) //reward for visiting the /contact/success page