Ratel
A/B Testing for Rails
Let's enjoy UX-driven development!
Supported
- Google Analytics
Installation
Add this line to your application's Gemfile:
gem 'ratel'And then execute:
$ bundleOr install it yourself as:
$ gem install ratelUsage
- Define the block to switch the multiple patterns (
screen_changesmethod) - Define the conversion (
screen_conversionmethod)
A/B Testing
Pattern A 50% / Pattern B 30% / Original 20%
<% screen_changes at: :cassette, to: { a: 50, b: 30 }, with: :reset do |g| %>
<dl>
<dt>Selected Group</dt>
<dd><%= g %></dd>
</dl>
<a href="javascript: <%= screen_conversion :cassette, :click, g %>">Conversion!</a>
<% end %>Advanced Tips
Create your own Tracking System
Define the tracking class (Ratel::Tracking::MyTrackingSystem) and push method.
$ vi lib/tracking/my_tracking_system.rbmodule Ratel
module Tracking
module MyTrackingSystem
# `args` equals screen_conversion's args
def push *args
# options = args.extract_options!
# ...
end
end
end
endRails Config
Ratel.configure do |config|
config.tracking = :my_tracking_system # snake_case symbol or string
endExecute your method (Ratel::Tracking::MyTrackingSysmtem.push) when screen_conversion method called.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
LICENSE
(The MIT License)
Copyright © 2013 yulii. See LICENSE.txt for further details.