Project

ratel

0.0
No commit activity in last 3 years
No release in over 3 years
a/b testing module
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 3.2.11
 Project Readme

Ratel

Gem Version Coverage Status Build Status

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:

$ bundle

Or install it yourself as:

$ gem install ratel

Usage

  1. Define the block to switch the multiple patterns (screen_changes method)
  2. Define the conversion (screen_conversion method)

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.rb
module Ratel
  module Tracking
    module MyTrackingSystem

      # `args` equals screen_conversion's args
      def push *args
        # options = args.extract_options!
        # ...
      end
     
    end
  end
end

Rails Config

Ratel.configure do |config|
  config.tracking = :my_tracking_system # snake_case symbol or string
end

Execute your method (Ratel::Tracking::MyTrackingSysmtem.push) when screen_conversion method called.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

LICENSE

(The MIT License)

Copyright © 2013 yulii. See LICENSE.txt for further details.