Landing Page Rotation Script

Posted by Ad Hustler | Posted in Affiliate Marketing, Tracking | Posted on 24-03-2010

There are a lot of situations where you need to rotate landing pages (or links) to see which are performing best. I was searching around for a script better than the one I was using and found one provided by Xentech on Wickedfire. This script also works if you need to rotate prosper202 landing pages. I thought this could help some people so i’m posting it here.

PHP Code For The Rotator

<?php
$k = $_GET['sub'];

$aff[] = 'http://xxx.com/tracking202/redirect/dl.php?t202id=6133&t202kw=';
$aff[] = 'http://xxx.com/tracking202/redirect/dl.php?t202id=6133&t202kw=';
$aff[] = 'http://xxx.com/tracking202/redirect/dl.php?t202id=6133&t202kw=';
$aff[] = 'http://xxx.com/tracking202/redirect/dl.php?t202id=6133&t202kw=';
$aff[] = 'http://xxx.com/tracking202/redirect/dl.php?t202id=6133&t202kw=';
$aff[] = 'http://xxx.com/tracking202/redirect/dl.php?t202id=6133&t202kw=';
$aff[] = 'http://xxx.com/tracking202/redirect/dl.php?t202id=6133&t202kw=';
$aff[] = 'http://xxx.com/tracking202/redirect/dl.php?t202id=6133&t202kw=';
$aff[] = 'http://xxx.com/tracking202/redirect/dl.php?t202id=6133&t202kw=';
$aff[] = 'http://xxx.com/tracking202/redirect/dl.php?t202id=6133&t202kw=';

srand ((double) microtime() * 1000000);
$random_number = rand(0,count($aff)-1);

$lol = ($aff[$random_number]);
$lal = $lol.$k;

header("Location: $lal");

Add or Remove These Lines To Add or Remove Links From Rotator

$aff[] = 'http://xxx.com/tracking202/redirect/dl.php?t202id=6133&t202kw=';

Append ?sub=test to your final link to pass subid values to the links within the rotator

Ad Hustler | Subscribe To Ad Hustler

Comments

  1. Awesome. I’ve been looking for a better script for a while. I like that this one doesn’t require an external .txt file. I will definitely try this out.

  2. Its actually a really solid script.

  3. Hey! That’s the one he gave me! This script is boss.

  4. Here is the script I use, something like this one but you can use with unlimited campaigns and rotate the ones you want.
    Pretty simple. Please format if not showing ok.

  5. Um, you can use the one AdHustler posted with as many campaigns as you want. And if you want to weight one heavier than the other, just put in more of the same link. For example, to run one campaign 80% of the time and another 20% of the time, put in 4 links of Campaign A and 1 link of Campaign B.

  6. This script is almost identical to the one they had on AffPortal.com, and that one works flawless for me. Thanks for sharing.

  7. Not sure why you need to seed the random number generator … does almost-true randomness matter for this use-case? array_rand() should be good enough. Regardless of my personal issues with it, thanks for sharing.

  8. Thanks for posting the script but is there any issue with having to get each LP approved 1st before rotating them.

    It shouldn’t matter if you just do a few simple color tweaks but I could see Adwords and other PPC engines being dicks about not getting each LP cleared. Have you ever run into trouble with this.

    I know Trafficvance wants you to list all LPS you are rotating with them.

  9. This is awesome!

  10. @Tom

    Yeh that would be fine.. I just ripped this and modified it from a script used to generate random banners or something ages ago.

  11. I actually have mine up on my screen right now so I thought I would share too, its very short:

    basically just like yours, with the k variable as the keyword. One thing I would point out for these is you can vary the percent of traffic sent to each link by including a link more than once (so if you want 90% of traffic to go to the first link, put it in 9 times and then the second link once)

  12. Sorry about that, the comment field couldn’t handle the php tags –

    for those curious http://www.mediafire.com/file/qzk3dygdyam/rotator.txt

  13. Nice Simple Script will test out on couple sites I have not running wordpress thanks ad hustler.

  14. Hi, a simple online solution to this problem that doesn’t require any programming can be found at http://linkshiftr.com/. Link customization, redirection, and rotation take seconds to create and change… check it out

  15. Sometimes I love Google.

    Now I just need this to work with Geo redirect.

  16. How can I add dynamic {sub} or {keyword} into the url?

  17. [...] Pages And The Urgency Of Time Mad lib form style testing results Photoshop Guide For Affiliates Landing Page Rotation Script 6 Seductive CTR Tips Tuesday Tips – Improving Landing Page CTR The 1 Penny Tip Top 100 [...]

  18. where do I actually place this script – on a server, on one of the landing pages??

  19. [...] Pages And The Urgency Of Time Mad lib form style testing results Photoshop Guide For Affiliates Landing Page Rotation Script 6 Seductive CTR Tips Tuesday Tips – Improving Landing Page CTR The 1 Penny Tip Top 100 [...]

Post a comment