https://github.com/lexi-lambda/simple_split
dead simple A/B testing on Rails
https://github.com/lexi-lambda/simple_split
Last synced: 3 months ago
JSON representation
dead simple A/B testing on Rails
- Host: GitHub
- URL: https://github.com/lexi-lambda/simple_split
- Owner: lexi-lambda
- Created: 2015-07-13T22:21:07.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-24T05:01:05.000Z (almost 10 years ago)
- Last Synced: 2025-03-01T15:17:02.372Z (4 months ago)
- Language: Ruby
- Homepage:
- Size: 137 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# simple_split – dead simple A/B testing on Rails [](http://badge.fury.io/rb/simple_split) [](https://codeclimate.com/github/lexi-lambda/simple_split) [](https://travis-ci.org/lexi-lambda/simple_split)
The `simple_split` gem provides the absolute simplest possible interface for
split testing via Rails while still providing an expressive set of tools for
writing and maintaining experiments. More traditional solutions like
[`split`][split] provide more bells and whistles, but they also do far
more than is necessary for simple split testing via good analytics services.Instead, `simple_split` is bare bones, but it still supports flexible testing.
- Includes optionally-weighted variations
- Does not require the use of any data store
- Variations already seen by users are tracked via cookies## Quick Start
Add `gem 'simple_split'` to your Gemfile, then run `bundle`. That's it. Now you
can start writing A/B tests for your project.All classes that inherit from `ActionView` or `ActionController` have access to
the `ab_test` method. It accepts an experiment name and a list of variations.```ruby
ab_test 'experiment_name', 'variation_a', 'variation_b', 'variation_c'
```The result of a call to `ab_test` is a randomly selected variation. If a user
has already seen a particular variation, that result will always be returned
instead of picking a new one.Variations can be weighted by using a hash, where the keys are variation labels
and the values are numeric weights. If no weight is provided, the default is to
use `1.0`.```ruby
ab_test 'experiment_name', { 'variation_a' => 1.0, 'variation_b' => 0.2 }
```## Credit
This was inspired by the [`simple_abs`][simple_abs] gem, which also provides a
stripped-down interface. However, it still persists information to a database,
and it does not include support for weighted variations.[split]: https://github.com/splitrb/split
[simple_abs]: https://github.com/n8/simple_abs