Skip to content

Instantly share code, notes, and snippets.

@underdown
Created March 20, 2012 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save underdown/2141741 to your computer and use it in GitHub Desktop.
Save underdown/2141741 to your computer and use it in GitHub Desktop.
Split test only new visitors
<?php
setcookie("BTDT", "1", strtotime("+30 days"));
if(!$_COOKIE["BTDT"]) {
if($_GET["gclid"]) {
switch(rand(1,3)) {
case 1: header("location: /a/index.php");break;
case 2: header("location: /a/index2.php");break;
case 3: header("location: /a/index3.php");break;
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment