Project

ab_tester

0.0
No commit activity in last 3 years
No release in over 3 years
Yet another AB Test gem, but this supports AbstractController, not only ActionController
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
 Project Readme

ABTester

A stupid simple gem that helps to do very simple AB Tests with Rails 3 pages and emails.

Install

Criando um projeto do zero:

gem install ab_tester

Usage

On controller or mailer

class SomeController < ApplicationController
  ab_tester 'choice_a' => 3, 'choice_b' => 2, 'choice_c' => 6

  protected
  def identity_hash
    # Some way to identity uniquely a user, put something on session, cookie, or simple use some data from somewhere
    current_user.id
  end
end

On view:

<p>Choice selected:</p>
<% ab_choice 'choice_a' %>
  Choice A
<% end %>
<% ab_choice 'choice_a' %>
  Choice B
<% end %>
<% ab_choice 'choice_a' %>
  Choice C
<% end %>

It's possible to get data on controller using choices:

def index
  ab_choice 'all_data' do
    @users = User.all
  end

  ab_choice 'some_users' do
    @users = User.page(params[:page])
  end
end

Statistics

rake ab_tester:stats

Reseting Stats

rake ab_tester:reset

Dumping Data

rake ab_tester:dump

TODO

  • Tests, shame on me!