Skip to content
PHP client library for SeatGeek's Sixpack A/B testing framework
Latest commit 84da832 Dec 12, 2015 @zackkitzmiller zackkitzmiller Merge pull request #16 from johnbacon/patch-1
Fix typo
Failed to load latest commit information.
src/SeatGeek/Sixpack Merge pull request #13 from seatgeek/remove-temp Nov 10, 2015
tests And account for bad experiment names too Nov 10, 2015
.gitignore fast timeout and quick return for control alt Feb 11, 2013
LICENSE.TXT Change to BSD 2-Clause License Feb 20, 2013
README.markdown Fix typo Dec 12, 2015
composer.json Make autoloading test files possible Nov 10, 2015


Build Status Latest Stable Version


PHP client library for SeatGeak's Sixpack ab testing framework.


  1. Install Composer
  2. In the root of your project install sixpack via composer require seatgeek/sixpack-php
  3. In your php script put require 'vendor/autoload.php'; at the top so sixpack is loaded.


Basic example:

The PHP client stores a unique client id in the current user's cookie by default.

require 'vendor/autoload.php';
$sp = new \SeatGeek\Sixpack\Session\Base;
$alt = $sp->participate('test', array('blue', 'red'))->getAlternative();
if ($alt == 'blue') {
    /* do something blue */
} else {
    /* do somethign red */

Each session has a client_id associated with it that must be preserved across requests. The PHP client handles this automatically. If you'd wish to change that behavior, you can do so like this:

require 'vendor/autoload.php';
$sp = new \SeatGeek\Sixpack\Session\Base;
$resp = $sp->participate("new-test", array("alternative-1", "alternative-2"));
store_in_database("sixpack-id", $resp->getClientId());

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

require 'vendor/autoload.php';
$client_id = get_from_database("sixpack-id")
$sp = new \SeatGeek\Sixpack\Session\Base(array('clientId' => $client_id));


Other possible options for the Session constructor are:

  • baseUrl - Sixpack Server's location on the web
  • cookiePrefix - you can set a different prefix for the cookie if you like. Default is sixpack

If you'd like to force the Sixpack server to return a specific alternative for development or testing, you can do so by passing a query parameter named sixpack-force to that page being tested.<experiment name>=<alternative name>


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request


sixpack-php is released under the BSD 2-Clause License.

Something went wrong with that request. Please try again.