Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby client library for SeatGeek's Sixpack A/B testing framework
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
spec Fix tests that were broken when removing simple_* methods
Gemfile Reverting removal of gemspec from gemfile. Moving addressable depende…
LICENSE Merge branch 'master' of
sixpack.gemspec Fix tests that were broken when removing simple_* methods


Ruby client library for SeatGeek's Sixpack ab testing framework.


Add this line to your application's Gemfile:

gem 'sixpack-client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sixpack-client


Basic example:

require 'sixpack'

session =

# Participate in a test (creates the test if necessary)
resp = session.participate("new-test", ["alternative-1", "alternative-2"])
if resp["alternative"]["name"] == "alternative-1"
    css_style = "blue"

# Convert

Each session has a client_id associated with it that must be preserved across requests. Here's what the first request might look like:

session =
session.participate("new-test", ["alternative-1", "alternative-2"])
set_cookie_in_your_web_framework("sixpack-id", session.client_id)

For future requests, create the Session using the client_id stored in the cookie:

client_id = get_cookie_from_web_framework("sixpack-id")
session = client_id

Sessions can take an optional options hash that takes :base_url, and a params hash that takes :ip_address, and :user_agent a keys. If you would like to instantiate a session with a known client id, you can do that here. IP address and user agent can be passed to assist in bot detection.

options = {
    :host => '',
params = {
    :ip_address => ''
session = Session(client_id="123", options=options, params=params)

If Sixpack is unreachable or other errors occur, sixpack-rb will provide the control alternative object.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Write and run some tests with $ rake
  4. Commit your changes (git commit -am 'Added some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request
Something went wrong with that request. Please try again.