Set Up Quick and Dirty PHP A/B Test

Status
Not open for further replies.

Laubster

Senior Member
Joined
May 21, 2013
Messages
1,008
Reaction score
383
Hello,

I need someone to set up a super basic A/B test for me. I have regular shared hosting and two html files I want to display, traffic split 50/50. Please shoot me a PM with your price quote, need this done ASAP.

Thanks,

Chris
 
I can do this quick
Add me up on skype
PavanIndia
 
Code:
<?php
$pages = array("a.html","b.html");    
$choice = mt_rand(0,count($pages)-1);    
$location = $pages[$choice];    
header("Location: $location");    
?>


Save that as index.php and then rename your pages to a.html and b.html (or change the contents of the $pages array to reflect your actual page names, you can add further pages too if required).

With minimal work you can also get this to pass simple trackers via get. I even had this selecting the end site landing page id's and passing them through to the CTA links on my A/B tests at one point :)
 
Not sure if this works or not but found it with a quick search
Code:
http://phpabtest.com/
http://phpabtest.com/quick-start
 
Thanks everyone! My programmer came through for like $2 but I'll save this for future reference.
 
Status
Not open for further replies.
Back
Top