views:

132

answers:

1

from: http://www.bingocardcreator.com/abingo/usage

#A view example with a block passed to ab_test:
<% ab_test("call_to_action", %w{button1.jpg button2.jpg}) do |button| >
  <%= image_tag(button, :alt => "Call to action!" %>
<% end %>

Does whatever "choice" that gets passed in the block have to be some sort of link? How does a/bingo know when different choices have been converted?

+3  A: 

The way Abingo works is to issue different options to different "identities" in a consistent manner so that the results can later be aggregated together again. There are several ways to do this, such as by IP address, by session_id, or by registered account, all of which are valid and can be used in conjunction. In effect, a particular identity will always get the same random selection of options.

An example from the documentation on assigning the identity is as a handler in ApplicationController:

before_filter :set_abingo_identity

def set_abingo_identity
  if @user
    # Assign identity based on user
    Abingo.identity = @user.abingo_identity
  else
    # Assign identity for anonymous user
    session[:abingo_identity] ||= rand(10 ** 10).to_i.to_s
    Abingo.identity = session[:abingo_identity]
  end
end

When you want to track action based on which A/B option was used, you need to inject calls in your controllers. Another example:

def show
  # Track conversion for active Abingo identity
  bingo!("show_info_page")
end

The mechanism by which the user navigates to that particular page is entirely arbitrary and can be by link, by form submission, by JavaScript redirect, or by clicking on an email. The only thing that matters is that the display of the A/B option and the later controller action that tracks the activity both have the same Abingo identity assigned.

tadman
That's a stellar answer. I'll have to test it out. Thanks!So I guess the beauty of a/bingo is that the call to the bingo! method is the same no matter which alternative is displayed to the user.