#214 A/B Testing with A/Bingo
A/B Testing (or Split Testing) is a way to experiment with variations in an application to see the most effective option.
- Download:
- source codeProject Files in Zip (127 KB)
- mp4Full Size H.264 Video (21.2 MB)
- m4vSmaller H.264 Video (12.5 MB)
- webmFull Size VP8 Video (34.8 MB)
- ogvFull Size Theora Video (29 MB)
Resources
bash
script/plugin install git://git.bingocardcreator.com/abingo.git
script/generate abingo_migration
rake db:migrate
script/generate controller abingo_dashboard
script/plugin install --force git://github.com/ryanb/abingo.git
script/plugin install git://git.bingocardcreator.com/abingo.git script/generate abingo_migration rake db:migrate script/generate controller abingo_dashboard script/plugin install --force git://github.com/ryanb/abingo.git
users_controller.rb
bingo! "signup_intro"
bingo! "signup_title"
# or
bingo! "signup"
bingo! "signup_intro" bingo! "signup_title" # or bingo! "signup"
application_controller.rb
before_filter :set_abingo_identity
private
def set_abingo_identity
if request.user_agent =~ /\b(Baidu|Gigabot|Googlebot|libwww-perl|lwp-trivial|msnbot|SiteUptime|Slurp|WordPress|ZIBB|ZyBorg)\b/i
Abingo.identity = "robot"
elsif current_user
Abingo.identity = current_user.id
else
session[:abingo_identity] ||= rand(10 ** 10)
Abingo.identity = session[:abingo_identity]
end
end
before_filter :set_abingo_identity private def set_abingo_identity if request.user_agent =~ /\b(Baidu|Gigabot|Googlebot|libwww-perl|lwp-trivial|msnbot|SiteUptime|Slurp|WordPress|ZIBB|ZyBorg)\b/i Abingo.identity = "robot" elsif current_user Abingo.identity = current_user.id else session[:abingo_identity] ||= rand(10 ** 10) Abingo.identity = session[:abingo_identity] end end
abingo_dashboard_controller.rb
class AbingoDashboardController < ApplicationController
# TODO add some authorization
include Abingo::Controller::Dashboard
end
class AbingoDashboardController < ApplicationController # TODO add some authorization include Abingo::Controller::Dashboard end
routes.rb
map.abingo_dashboard "/abingo/:action/:id", :controller=> :abingo_dashboard
map.abingo_dashboard "/abingo/:action/:id", :controller=> :abingo_dashboard
rhtml
<% ab_test("signup_title", ["Sign up", "Registration", "Free Sign up"], :conversion => "signup") do |signup_title| %>
<% title "Free Sign up" %>
<% end %>
<% if ab_test "signup_intro", nil, :conversion => "signup" %>
<p>...</p>
<% end %>
<% ab_test("signup_title", ["Sign up", "Registration", "Free Sign up"], :conversion => "signup") do |signup_title| %> <% title "Free Sign up" %> <% end %> <% if ab_test "signup_intro", nil, :conversion => "signup" %> <p>...</p> <% end %>

