1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CPA Offer Randomizing/Rotating Through Links

Discussion in 'CPA' started by darkmarth, Jan 21, 2010.

  1. darkmarth

    darkmarth Junior Member

    Joined:
    Aug 12, 2008
    Messages:
    160
    Likes Received:
    39
    Location:
    Bay Area!
    Hello everybody! I have a quick question about automatically switching offers...

    You see, I have some BH traffic that needs to be spread out amongst different offers of a similar niche. For example's sake - lets say there are 4 Ipod Email submit offers...

    I want to be able to have 1 link, which directs the visitor to one of the 4 offers, at random...That one 1 offer isnt getting saturated until I manually switch the link.

    My guess is that I need to be linking to a php file, but I have no clue about how to do php coding...Maybe theres a wordpress plugin that I have overlooked?

    Anyway....Any insight into this would be greatly appreciated! Hopefully this question ends up helping a few other members too...
     
  2. Sieranne

    Sieranne Newbie

    Joined:
    Jan 4, 2010
    Messages:
    4
    Likes Received:
    3
    Code:
    <?php
    
    srand((double)microtime()*1000000);
    
    $links = array("http://www.linkone.com","http://www.linktwo.com");
    
    $rand_pick = rand(1, count($links));
    
    header( 'Location: ' . $links[$rand_pick-1] );
    
    ?>
    
    Simply put the code above into notepad and save as redirect.php for example then direct your links to that file. Replace linkone.com and linktwo.com with your affiliate links and add as many as you like to that array
     
    • Thanks Thanks x 2
  3. Popmania

    Popmania Registered Member

    Joined:
    Oct 3, 2009
    Messages:
    85
    Likes Received:
    11
    LOL! I was looking for something like that also!
    Thanks a lot.