How can I Alternate pub id's?

Discussion in 'AdSense' started by Canadianbacon, Jun 4, 2006.

  1. #1
    Is there a script that will alternate one adsense pub id with another on the same page? So with each page load, one or the other shows.... 50/50

    i have site i'm runing with a friend it would be easier if we could both use our own adsense accounts.
     
    Canadianbacon, Jun 4, 2006 IP
  2. rewlie

    rewlie Active Member

    Messages:
    937
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    58
    #2
    try cj ad rotator, google it, or search on this forum, someone do post about it before.
     
    rewlie, Jun 4, 2006 IP
  3. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #3
    if you use php you can simply do :
    
    <?
    if (rand(1,2) == 1) {
     $adsenseid = "pub-123456789";
    } else {
     $adsenseid = "pub-987654321";
    }
    ?>
    
    Code (markup):
    Then you have $adsenseid which is either yours or your friend's adsense ID so you can insert it in the adsense code:

    
    <script type="text/javascript"><!--
    google_ad_client = "<?= $adsenseid ?>";
    google_ad_width = 468;
    google_ad_height = 60;
    google_ad_format = "468x60_as";
    etc...
    
    Code (markup):
     
    JamesColin, Jun 4, 2006 IP
  4. rewlie

    rewlie Active Member

    Messages:
    937
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    58
    #4
    senserely, how many are your members now on your revenue sharing community??
     
    rewlie, Jun 4, 2006 IP
  5. AnsonM

    AnsonM Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Doesn't this break the adsense TOS?

     
    AnsonM, Jun 4, 2006 IP
  6. nriweb

    nriweb Well-Known Member

    Messages:
    422
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    108
    #6
    Having multiple adsense publisher id on the same website is allowed by google ... its advisable to get the permission of the other publisher before doing so.

    I am not sure about having ad units for multiple publishers on the same page. I mailed google recently .. waiting for the reply.
     
    nriweb, Jun 4, 2006 IP
  7. rewlie

    rewlie Active Member

    Messages:
    937
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    58
    #7
    it will still be the same, say you have 3 publisher, one can display 4, does that mean you can display 12 ads on one page ?? NO!
     
    rewlie, Jun 4, 2006 IP
  8. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #8
    Rewlie, they are more than last week and less than next week, sign ups are pouring in.
    Google also allows to display several IDs on one page, but the 3 ads + adlink + 2 search + 4 referrals limit on one page is still valid.
     
    JamesColin, Jun 4, 2006 IP
  9. rewlie

    rewlie Active Member

    Messages:
    937
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    58
    #9
    senserely : looking to be your partner, but my project isn't release yet, still under Google clarification, it's also an ad revenue sharing, but more complex process, still playing with the db, i let you know once it's ready.
     
    rewlie, Jun 4, 2006 IP
  10. Canadianbacon

    Canadianbacon Well-Known Member

    Messages:
    1,231
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    173
    Articles:
    1
    #10
    Someone wanna dumb that down a notch...

    Where does the code go?
     
    Canadianbacon, Jul 18, 2006 IP
  11. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #11
    Is this for an HTML or PHP page? I just happen to code a revenue sharing system for vBulletin yesterday. I may have a tip or two I can give ya.
     
    noppid, Jul 18, 2006 IP
  12. Canadianbacon

    Canadianbacon Well-Known Member

    Messages:
    1,231
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    173
    Articles:
    1
    #12
    it is for php
     
    Canadianbacon, Jul 18, 2006 IP
  13. infonote

    infonote Well-Known Member

    Messages:
    4,032
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    160
    #13
    All you need to do is a FOR loop. It will rotate the ads.
     
    infonote, Jul 18, 2006 IP
  14. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #14
    first code anywhere above all adsense block
     
    JamesColin, Jul 19, 2006 IP