split-test
A support library to simplify split testing. We have a repository of working examples you can reference in https://github.com/mobify/adaptivejs-split-test-examples
Quickstart
Install split-test
using npm:
$ npm install split-test --save-dev
Defining a split condition
var splitTest = SplitTest;
Obtaining the split value
splitTest;
Methods
init
Adds a script to a custom container.
Parameter name | Type | Description |
---|---|---|
value | Object | The split condition |
options | Object | The setup parameters |
var splitTest = SplitTest;
Available options
Options | Type | Description |
---|---|---|
namespace | String | The namespace of the cookie to prevent conflict between cookie names |
cookieDomain | String | The domain of this cookie. Default to the hostname |
lifetime | Integer (milliseconds) | The lifetime of the cookie. Default to 30 days. |
getChoice
Returns the split choice key.
// This returns either 'A', 'B', or 'C'var choice = splitTest;
setChoice
Manually sets the split choice.
Parameter name | Type | Description |
---|---|---|
value | String | split choice key |
splitTest; // This return 'C'splitTest;
How to create and ship a change
- Make your code changes and create a pull-request
- Ensure the tests still work (
grunt test
) - Get your change reviewed and 👍'ed
Changelog
- 1.0.0: Remove bower dependencies and dist folder, distribute on npm
- 0.0.1: Initial commit
Where to get help
Talk to @jansepar or @dbader.