Simple Way To Rotate Ads

Discussion in 'AdSense' started by ScottHughes, Jan 16, 2008.

  1. #1
    I want to rotate between two different AdSense ad blocks for testing purposes. I'm trying to think of the best way to do it. I could search Google for an ad rotation script, but I don't want anything big, bulky or complex. I don't need anything fancy. I can probably do it myself with PHP. I just want to think of the simplest way. What do you think? What is the simplest way to rotate ads?

    They don't necessarily need to alternate for every page view. They could alternate every 5 or 10 minutes, or something like that. It doesn't matter. I just want to see which ads perform best.

    Thanks,
    Scott
     
    ScottHughes, Jan 16, 2008 IP
  2. Dudefromusa

    Dudefromusa Guest

    Messages:
    1,073
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Do you use wordpress?
    I think u need to use Mighty adsense Plugin :)
     
    Dudefromusa, Jan 16, 2008 IP
  3. ScottHughes

    ScottHughes Peon

    Messages:
    755
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the tip, but it's not a Wordpress site. It's a phpBB forum and a hand-coded PHP site.

    I think the simplest way might just be to do it by the time. For example, I could have it so if the hour is an even number than it displays the first ad code, and if the hour is an odd number it displays the second ad code.
     
    ScottHughes, Jan 16, 2008 IP
  4. Dudefromusa

    Dudefromusa Guest

    Messages:
    1,073
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Umm u can code like after every page load display ad set no X
    Where x is your ad set
     
    Dudefromusa, Jan 16, 2008 IP
  5. godmode

    godmode Well-Known Member

    Messages:
    4,453
    Likes Received:
    156
    Best Answers:
    0
    Trophy Points:
    190
    #5
    If you looking for a PRO solution then try Openads, you can rotate based on country/IP and whatever you can dream off.
     
    godmode, Jan 16, 2008 IP
  6. immortality

    immortality Peon

    Messages:
    1,512
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    0
    #6
    immortality, Jan 16, 2008 IP
  7. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #7
    
    switch(rand(0, 1))
    {
       case 0:
          echo "<code for ad A>";
          break;
       case 1:
          echo "<code for ad B>";
          break;
    }
    
    PHP:
    By adjusting the numbers you can control exactly the ratios at which each ad is delivered. It's also more straightforward to implement and adjust than some scheme involving the time of day.
     
    SmallPotatoes, Jan 17, 2008 IP
    ScottHughes likes this.
  8. ScottHughes

    ScottHughes Peon

    Messages:
    755
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks! That's exactly what I was looking for.

    Thanks,
    Scott
     
    ScottHughes, Jan 17, 2008 IP