Creating Unique Post URLs for A/B Testing… Is this even possible?

You can use ShrimpTest for this. Basically, you need to reverse the test idea. You’re making three separate posts, one of which will be displayed on the front page. That means that two others will not be displayed on the front page. So you’re doing an exclusion.

Say your three posts have id’s of 101, 102, and 103. You’d set up a test and use the manual PHP mode. Then in your index.php file (or whatever is displaying on your homepage), you’d do this:

$variant = shrimptest_get_variant( 1 ); // this will be the test number
switch ( $variant ) {
  case 0:
    $exclude = array(102,103); // show post 101
    break;
  case 1:
    $exclude = array(101,103); // show post 102
    break;
  default:
    $exclude = array(101,102); // show post 103
    break;
}

Then something like query_posts(array('exclude'=>$exclude)) or similar to modify your main query. You don’t really explain in your question how you’re showing these, so I can’t be sure of this part.

ShrimpTest is generic. It can test anything. You just have to write the code for what you’re testing yourself.

Leave a Comment