A/Bingo - Nice Plugin for A/B Testing the User Response

A/Bingo is a Ruby on Rails A/B testing framework written as a plugin. It can be used to toggle between various options and get stats based upon user interaction.

Install A/Bingo

script/plugin install git://git.bingocardcreator.com/abingo.git

Create Migration

script/generate abingo_migration

Migrate database

rake db:migrate

Add code to your view files where you need to test

index.html.erb
1
2
3
<% ab_test("signup_title", ["Sign up", "Registration", "Free Sign up"]) do |signup_title| %>
<%= link_to signup_title, sign_up_path %>
<% end %>    

Above code will show 3 different titles randomly. Now we need to monitor the response for the testing

users_controller.rb
1
2
3
4
5
6
7
8
9
10
11
def create
  @user = User.new(params[:user])
  if @user.save
    bingo! "signup_title"
    session[:user_id] = @user.id
    flash[:notice] = "Thank you for signing up. You are now logged in."
    redirect_to root_url
  else
    render :action => 'new'
  end
end    

bingo! "signup_title" records the user interaction in database, which can be used to analyze. Use generate command to create a controller for abingo

script/generate controller abingo_dashboard

and add A/Bingo dashboard code to it

users_controller.rb
1
2
3
4
class AbingoDashboardController < ApplicationController
  # TODO add authorization.
  include Abingo::Controller::Dashboard
end    

Now visit http://localhost:3000/abingo to checkout the stats. Bingo !!

Sources :

Comments