random ads

Discussion in 'JavaScript' started by Hobbit2, Dec 30, 2006.

  1. #1
    My partner and I both own a forum, and we want to share revenue. How can we display the ads 50/50? Any help would be appreciated, thanks.
     
    Hobbit2, Dec 30, 2006 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Supossing your pages are dynamically generated on server. You should add a simple code on it (PHP, perl, ...) to generate a random number between 0 and 1.
    
    if (random=0) 
      put_ads_for_you 
    else
      put_ads_for_your_partner
    
    Code (markup):
    For example on adsense ads, you can change the variable:
    google_ad_client = "pub-XXXXXXXXXXXXXX" / google_ad_client = "pub-YYYYYYYYYYYYYY";
    or the variable:
    google_ad_channel ="aaaaaaaaaa" / google_ad_channel ="bbbbbbbbbb"
     
    ajsa52, Dec 30, 2006 IP
  3. AoaoSo

    AoaoSo Peon

    Messages:
    61
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    var D=new Date();
    Digital.getSeconds()%2==0?yourad():partnerad();

    function yourad(){}

    function partnerad(){}
     
    AoaoSo, Dec 31, 2006 IP
  4. internetmarketing

    internetmarketing Peon

    Messages:
    71
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    nice informative thread...:)
     
    internetmarketing, Jan 1, 2007 IP