How To Split Test Landing Pages with Prosper202

July 10th, 2011 by admin Leave a reply »

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:

  1. index.php – this is the file we will drop our split testing script in soon.
  2. lp1.php – stands for landingpage1. It’s our first landing page we want to test out.
  3. lp2.php – stands for landingpage2. It’s our second landing page we want to test out.
  4. 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 Here is a visual of what your folder looks like now:

Necessary Files

Step #2: The Code for index.php

Here is the code you need to put in index.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);
//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);
//include the landing page
//terminate script

Here’s the script in .txt format

Now, whenever you go to 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

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:

  1. 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 Pages
  2. lp1.php – set up your landing page and place the javascript/php affiliate link code.
  3. 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)

Prosper202 Landing Page Split Test

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

$landingpage[1] = 'lp1.php';
$landingpage[2] = 'lp2.php'; //delete this line if this landing page doesn't perform!
Traffic Blackbook


  1. John says:

    Nice to see you posting again Garrett, great stuff as always!

  2. matt says:

    Where is the count script?

    • admin says:

      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

  3. TramayneP says:

    Thank you so much for spelling it out!

  4. david suarez says:

    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?

    • admin says:

      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

  5. david suarez says:

    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

  6. admin says:

    Yea definitely! My email is my sites name @ gmail

    In the meantime, you could look on Youtube at this link:

  7. LV says:

    what would the script be if I wanted to rotate 3 or maybe even 4 Landing page?

    • admin says:

      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’;

  8. Alex says:

    Thanks a lot for this script! Really simple to setup and a complete life saver for me. It’s also awesome that I won’t need ot worry about changing my campaign URL’s when I want to rotate in new LP’s !!

  9. Lucas says:

    I need create two go.php archives?

    • admin says:

      I’m not sure what you mean? 2 go.php files? You only need 1 file, and the script goes in there – you can name it whatever you want.

  10. JimmyJ says:

    I think what Lucas is trying to say is this. In prosper202 – Step #6 Get LP Code, you have 2 pieces of code you need:

    1) Inbound Javascript Landing Page Code (which is to be placed on e.g. lp1.php)

    2) Outbound PHP Redirect Code (php code that you will place in your redirect script e.g. redirect1.php)

    If you are rotating 2 landers you will require one of each. You will have to create the redirect php pages yourself.




  11. usr says:

    This is great. But how would you split test between landing pages and direct link at the same time? Lets say you set
    $landingpage[4] = ‘direct link you get from prosper’;

    but this gives an error “Warning: include_once() [function.include-once]: http:// wrapper is disabled in the server configuration by allow_url_include=0”. Do you know any workaround?


    • admin says:

      It’s pretty easy to do… here’s my modified script on Pastebin:

      On line 3, the variable $num is going to hold 0 or 1. If it’s 0, you just do a redirect to your affiliate link, ELSE the script runs the code block that alternates the landing pages. The issue with your code is that the script is trying to “include” your affiliate link, when you really want to redirect with “header()”.

      Learn basic PHP and this sort of stuff will become super easy. Scroll down to “Diving Into PHP” on this page. Once you understand the basics, your ability to be flexible when tracking will be very useful for you.

  12. Robson says:

    Hello am new to prosper202 and am using only one page put the land prosper only a few clicks and this marking is not marking the ctr of land for example page 100 clicks it marks as few as 20 clicks, I will let down the lp get code I would have make any changes in this code’m putting it above the

  13. ehab says:

    I was reading your post about how to split test landing pages in prosper202 and i did like what you did and every thing work great except that it dont pass keywords , and i found many people have same error …. do you have any idea on how to pass keywords .
    here another post for someone who tried to solve this issue but i tested it and didnt work also

Leave a Reply