1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Interesting idea - has anyone tried this?

Discussion in 'AdSense' started by Troutnut, Apr 9, 2006.

  1. #1
    I just had an interesting idea I haven't seen about before, and I'm curious if anyone's tried it.

    I'm writing a pretty fancy database site and I'm getting ready to create the code to deliver my ads. I'm going to have several alternate versions of my AdSense codes (different color schemes, etc) so I can rotate those and see which ones work best, and if rotating them works better than just using the highest-performing colors in the rotation all the time.

    But I had another idea: What about rotating ad networks? I've found that users see a lot of the same Google ads every time they view my page. If they get 3 or 4 pages into a session and still haven't clicked one of those ads, they probably aren't going to. So I could show them Yahoo hads after they've seen the Google ads a few times, for example. Or I could just alternate and show Google ads 70% of the time and Yahoo 30% of the time, increasing the overall variety of ads.

    It seems this would be totally legit with the ToS, since every page loaded would only display ads from one network. It would just be a different network on different page loads.

    Has anyone played around with this kind of thing?
     
    Troutnut, Apr 9, 2006 IP
  2. jackburton2006

    jackburton2006 Peon

    Messages:
    5,296
    Likes Received:
    282
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes, this is a common practice. A lot of people does it. :)
     
    jackburton2006, Apr 9, 2006 IP
  3. iowadawg

    iowadawg Prominent Member

    Messages:
    10,918
    Likes Received:
    811
    Best Answers:
    0
    Trophy Points:
    380
    #3
    Yeah, I been looking at something like that for some of my sites.
    Anyone know how to do it, relatively quick and painless for an old man like me to implement?
     
    iowadawg, Apr 9, 2006 IP
  4. jackburton2006

    jackburton2006 Peon

    Messages:
    5,296
    Likes Received:
    282
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Shoemoney has a third-party something like this set up at shoemoneyads.com. He's offering to host and serve your ads for free, in fact.
     
    jackburton2006, Apr 9, 2006 IP
  5. disgust

    disgust Guest

    Messages:
    2,417
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    0
    #5
    it isn't free, but adsensetracker (also tracks ypn as well) I've found incredibly useful and convenient. might not be worth the cash for a small time publisher, but if increasing your CTR a few tenths of a percent is enough to pay for it over a month, there's really no reason not to get it-- unless, of course, there's a free/open source alternative out there I'm not aware of :)
     
    disgust, Apr 9, 2006 IP
  6. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #6
    Maybe this could help you .

    rand will generate a number between 0 and 3 ... and if the number is 0 , yahoo will show up (yahoo.php is a file that contain the yahoo code) if number is 1 , 2 or 3 google adsense will show up

    1/4 to get yahoo
    3/4 to get google

    
    
    <?php
    
    $nb = rand(0,3);
    
    if($nb == 0) {
       require("yahoo.php");
    }
     else {
       require("google.php");
     }
    
    ?> 
    
    
    Code (markup):
     
    commandos, Apr 9, 2006 IP
    themlife likes this.
  7. bpearson

    bpearson Peon

    Messages:
    173
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I thank there is also a script out there to check stats in ypn and adsense and server the network with the eCPM
     
    bpearson, Apr 9, 2006 IP
  8. froghat

    froghat Peon

    Messages:
    74
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    commandos , thanks for that code man! Do we put that code in between the adsense and Yahoo code? I was about to ask a similar question about this but Troutut saved me time. lol
     
    froghat, Apr 9, 2006 IP
  9. disgust

    disgust Guest

    Messages:
    2,417
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    0
    #9
    no, you would put that there instead of the code and it'd randomly include one of the code files

    ie yahoo.php would have your yahoo ad code, google.php would have your google code
     
    disgust, Apr 9, 2006 IP
  10. Troutnut

    Troutnut Peon

    Messages:
    76
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #10
    With the code commandos provided, make sure you only have one ad unit per page. Otherwise you would end up showing a mix of Google/Yahoo ads on the same page, which could get you kicked out of Google.

    It's easy to use PHP, or whatever your favorite server-side programming language is, to do the same thing for multiple ad units. It's just a bit more complicated than what's posted above.
     
    Troutnut, Apr 9, 2006 IP
  11. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #11
    Yes , right .

    if you want to have more than 1 ad unit / site it can easly be fixed by declaring variables .

    like in the google.php and yahoo.php you could add variables like

    $ad_unit1 = " your google/yahoo ads code 1";
    $ad_unit2 = " your google/yahoo ads code 2";
    $ad_unit3 = " your google/yahoo ads code 3";



    Then use the code i posted above , then when u want to use your ads code , just add echo $ad_unit1 ; or 2 or 3 in the place you want .
     
    commandos, Apr 9, 2006 IP
  12. froghat

    froghat Peon

    Messages:
    74
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #12
    What is a php? Can you like me to a help page. thanks
     
    froghat, Apr 9, 2006 IP
  13. Troutnut

    Troutnut Peon

    Messages:
    76
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #13
    A PHP is a handy language for making pages on the Internets.

    Basically, it's a very popular (the most popular?) programming language for doing advanced stuff behind-the-scenes on your website. Here's their introductory tutorial: http://us3.php.net/tut.php

    It's not for super-newbies to the web/programming, but the basic stuff with PHP isn't hard at all.
     
    Troutnut, Apr 9, 2006 IP
  14. froghat

    froghat Peon

    Messages:
    74
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #14
    hmmm, Ok well I installed PHP on my server but is there a help page that focuses on the random ad feature?
     
    froghat, Apr 9, 2006 IP
  15. Greg-J

    Greg-J I humbly return to you.

    Messages:
    1,844
    Likes Received:
    153
    Best Answers:
    0
    Trophy Points:
    135
    #15
    I'll throw my solution in to the ring here. Here's what I would reccommend.

    First, put all your different ad codes in a file, we'll call it ads.php. In that file, write the following. Put as many different ads as you want in there, just name them appropriately. $ad[1], $ad[2], $ad[3], etc.

    ads.php
    
    <?php
    
    $ad[1] = <<<CODE
    // Place ad code here
    CODE;
    
    $ad[2] = <<<CODE
    // Place ad code here
    CODE;
    
    $ad[3] = <<<CODE
    // Place ad code here
    CODE;
    
    ?>
    
    PHP:
    Using this type of string, called a 'here document string', allows you to have a variable that spans multiple lines and keeps your formatting intact. It's not necessary, but if you're new to php it might not be a bad idea.




    Next, we'll put this next bit of php code wherever you normally put your adsense code.
    
    <?php
    
    srand((double)microtime()*1000000); // if you are using php4.2 or higher, you can ommit this.
    echo $ad[rand(1,3)]; //the first number should stay 1. The second should be the number of different types of ads you have in ads.php. In this case, 3.
    
    ?>
    PHP:






    I hope this helps.
     
    Greg-J, Apr 9, 2006 IP
  16. Greg-J

    Greg-J I humbly return to you.

    Messages:
    1,844
    Likes Received:
    153
    Best Answers:
    0
    Trophy Points:
    135
    #16
    A little note about the above code. Unless you're using a version of php pre-dating 4.2, you can use the following piece of code to include your randomly called ad code:



    <?=$ad[rand(1,3)]?>


    Cheers.
     
    Greg-J, Apr 10, 2006 IP
  17. Troutnut

    Troutnut Peon

    Messages:
    76
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Froghat,there isn't a "random ad feature." PHP is a very flexible programming language with which you can do just about anything. The random ad code people have posted here is a very simple application.

    I recommend doing a Google search for "introduction to PHP tutorials" or something, and familiarizing yourself with the basics of the PHP language for a day or so. It will pay off pretty fast. Also, be sure you download the PHP manual and keep it handy on your desktop or something. I've written hundreds of thousands of lines of PHP and I still reference the manual 10+ times a day... it's great.
     
    Troutnut, Apr 10, 2006 IP
  18. w3bmistress

    w3bmistress Peon

    Messages:
    145
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #18
    I use rand() to rotate google with other ad networks. This way I dont have to clutter my pages up with too much advertising. It actually increased my CTR, and CPM by doing this, instead of creating new ad spots for google.
     
    w3bmistress, Apr 10, 2006 IP