Setting up split tests is really easy once you know how. I remember struggling myself to understand how it all works, so today I’m going to show you exactly how to set up split tests using Prosper202 and the split testing script they provide. I like this script because it’s simple and does exactly what I need for 99% of projects.
Step #1: Understanding Which Files Are Involved
There are 4 files you need:
index.php– this is the file we will drop our split testing script in soon.lp1.php– stands for landingpage1. It’s our first landing page we want to test out.lp2.php– stands for landingpage2. It’s our second landing page we want to test out.count.txt– the split testing script within index.php relies on this file. The permissions of count.txt need to be set to 777, which you can do in your FTP program.
Let’s pretend we are working in a folder located at domain.com/split-test. Here is a visual of what your folder looks like now:

Step #2: The Code for index.php
Here is the code you need to put in index.php:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | <?php //Tracking202 Landing Page Rotation Script //landing pages filenames, theses will be rotated between eachother //theses landing pages must be in the same DIRECTORY as this file //you can add as many landing pages here as you like $landingpage[1] = 'lp1.php'; $landingpage[2] = 'lp2.php'; //this is the text file, which will be stored in the same directory as this file, //count.txt needs to be CHMOD to 777, full privlledges, to read and write to it. $myFile = "count.txt"; //open the txt file $fh = @fopen($myFile, 'r'); $lpNumber = @fread($fh, 5); @fclose($fh); //see which landing page is next in line to be shown. if ($lpNumber >= count($landingpage)) { $lpNumber = 1; } else { $lpNumber = $lpNumber + 1; } //write to the txt file. $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = $lpNumber . "\n"; fwrite($fh, $stringData); fclose($fh); //include the landing page include_once($landingpage[$lpNumber]); //terminate script die(); ?> |
Here’s the script in .txt format
Now, whenever you go to domain.com/split-test/index.php you’ll see the 1st landing page. When you refresh, you’ll see the 2nd landing page. When you refresh again, you’ll see the 1st landing page.
All the script does is grabs the landing pages you set (lp1.php & lp2.php) and loads it. You are actually viewing lp1.php and lp2.php AT domain.com/split-test/index.php
Check out my example here to see what I mean.
Step #3: Set Up Landing Pages in Prosper202
Now you need to setup lp1.php and lp2.php in Prosper202. There is nothing special about this part – you do it like normal. If you have poked around in Prosper202 before, chances are you already know how to do this.
For those who don’t, you need to setup landing pages for these files:
index.php– set up a landing page for index.php so you can select it in #7 Get Links. You don’t need to place any javascript or PHP code, but you do need to set it up in Setup–>#4 Landing Pageslp1.php– set up your landing page and place the javascript/php affiliate link code.lp2.php– again, set up your landing page and place the javascript/php affiliate link code.
Now, you can go to #7 Get Links and select your index.php rotator page. This is the link you submit to your traffic source. When people click your ad, some will see your first lander and others will see your second lander.
Step #4: Looking at the Data in Prosper202
Login to Prosper202 and go to Analyze–>Landing Pages
(click to enlarge)
I like to name my landing pages in Prosper202 the actual location of their file. That way, you can see which landing page is doing best and simply delete the others from index.php
1 2 | $landingpage[1] = 'lp1.php'; $landingpage[2] = 'lp2.php'; //delete this line if this landing page doesn't perform! |


Nice to see you posting again Garrett, great stuff as always!
Where is the count script?
you have to create that yourself. it should just be a right click –> create new file. then name it count.txt and make sure the permissions are set to 777
Thank you so much for spelling it out!
hey, if u could help me out on this one issue im having you would save a lot of hair on my head,
I got it such that when i refresh my URL both LPs rotate evenly.
however, im not sure what to put for the link to click on. sure i can put my affiliate link but it wont be cloaked and most importantly i cant see on my tracking202 if there was a “click through”
i tried doing all sorts of things but to no avail.
basically, what should go where “click here” on each of the lp1.php and lp2.php?
When you set up a campaign in Prosper202, in Step #6 Get LP code you are asked to put some Javascript code on your landing page as well as some PHP code for the click out.
Just go through the steps 1-7 when you are getting set up
hey i appreciate the reply man, im still a bit confused on how to set it up. I inputed the code that #6 gave me, and yea i see the “clicks” happening on my tracking 202 but i am still int he dark about what to put for my links for the “clickthrough”s to happen. hey if its possible could you ping me on skype or gtalk? ill keep refreshing this page for an asnwer, thanks bro
Yea definitely! My email is my sites name @ gmail
In the meantime, you could look on Youtube at this link: http://www.youtube.com/results?search_query=prosper202
what would the script be if I wanted to rotate 3 or maybe even 4 Landing page?
It’s super easy… all you do is add them on line 8-9 in the split testing script
$landingpage[1] = ‘lp1.php’;
$landingpage[2] = ‘lp2.php’;
$landingpage[3] = ‘lp3.php’;
$landingpage[4] = ‘lp4.php’;
Just make sure you number the $landingpage correctly, so it increases the number by 1 each time ( $landingpage[1], $landingpage[2], $landingpage[3], $landingpage[4] )
If you do it like this it won’t work…
$landingpage[1] = ‘lp1.php’;
$landingpage[1] = ‘lp2.php’;
$landingpage[1] = ‘lp3.php’;
$landingpage[1] = ‘lp4.php’;