where do i place my crazyegg script if i use a rotation script (Prosper202)?

mediaaff

New member
Jun 17, 2009
231
3
0
I'm using the prosper202 rotation script as below to split test 2 different web pages. Where do I place the rotations script? I tried placing it in the individual web pages but it doesn't work.

<?

//Tracking202 Offer Rotation Script

//enter your affiliate urls below, you can enter as many as you want, please
//make sure that you have the affiliate url with the SUBID syntax at the end
//of it, for reference goto: subids.com for more information.
$offer[1] = 'http://myaffiliateurl.com?subid=';
$offer[2] = 'http://myaffiliateurl2.com?subid=';
$offer[3] = 'http://myaffiliateurl3.com?subid=';

//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');
$offerNumber = @fread($fh, 5);
@
fclose($fh);

//see which landing page is next in line to be shown.
if ($offerNumber >= count($offer)) {
$offerNumber = 1;
} else {
$offerNumber = $offerNumber + 1;
}

//write to the txt file.
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $offerNumber . "\n";
fwrite($fh, $stringData);
fclose($fh);

//grab the subid that t202 adds
$subid = $_GET['subid'];

//redirect to the affilate url, + add the subid at the end
header('location: ' .$offer[$offerNumber] . $subid);

?>
 


Are you direct linking or using your own LP? Assuming you use you're split testing your versions of LPs, it'll be like this:

http://mylpurl.com/index.php (this is my own version of split testing LP, it gets you the same results with less clutches.
Code:
<?php
//list all offer or LP url

$offer[] = 'lp1.php?subid='; //could also work
$offer[] = 'http://myaffiliateurl.com?subid=';
$offer[] = 'http://myaffiliateurl2.com?subid=';

  //random offerNumber
  $offerNumber = rand(0, count($lp)-1);
//get subid, could also change it to t202kw or keyword
$subid = $_GET['subid'];

//header redirect
header("location: ".$offer[$offerNumber].$subid);
?>
then place crazyegg javascript on lp1.php and lp2.php. You have to create each page on cracyegg for each landing page.
 
Thanks Martin but i can't get the script to work. I keep getting this error...

Warning: Cannot modify header information - headers already sent by (output started at /home/goodluckbros/public_html/gaywebmasterforum.com/test.php:1) in /home/goodluckbros/public_html/gaywebmasterforum.com/test.php on line 14

and your url doesn't open...lol...
 
The "headers already sent" error is usually caused by having white space before or after the opening and closing PHP tags (<?php . . . ?>). Make sure there's no white space after you close (?>). It's a common error.
 
I'm using my own LP... could you explain how your code works? It's confusing...

Is the code below suppose to be the rotation script that rotates between the various LPs I wish to split test?

If so, which line of code do I replicate according to the no. of LPs I have?

Also... what's the difference between this...

$offer[] = 'lp1.php?subid='; //could also work


and these...

$offer[] = 'http://myaffiliateurl.com?subid=';
$offer[] = 'http://myaffiliateurl2.com?subid=';





Are you direct linking or using your own LP? Assuming you use you're split testing your versions of LPs, it'll be like this:

http://mylpurl.com/index.php (this is my own version of split testing LP, it gets you the same results with less clutches.
Code:
<?php
//list all offer or LP url

$offer[] = 'lp1.php?subid='; //could also work
$offer[] = 'http://myaffiliateurl.com?subid=';
$offer[] = 'http://myaffiliateurl2.com?subid=';

  //random offerNumber
  $offerNumber = rand(0, count($lp)-1);
//get subid, could also change it to t202kw or keyword
$subid = $_GET['subid'];

//header redirect
header("location: ".$offer[$offerNumber].$subid);
?>
then place crazyegg javascript on lp1.php and lp2.php. You have to create each page on cracyegg for each landing page.
 
Also... what's the difference between this...

$offer[] = 'lp1.php?subid='; //could also work


and these...

$offer[] = 'http://myaffiliateurl.com?subid=';
$offer[] = 'http://myaffiliateurl2.com?subid=';

There's no differences between those 3. If you use your own LPs within your own domain, lp1.php is fine, however if you want to rotate and redirect to LPs outside your root domain, you'll have to include http://mydomain.com/lp1.php etc...

Regarding "header already sent", i'd recommend you asking your hosting to see what the problem is.