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.

How to minimize an alternative ad?

Discussion in 'Placement / Reviews / Examples' started by szy, Jan 2, 2005.

  1. #1
    Hi.

    I don't know how to display just nothing (or 1x1 px gif?) when there is no AdSense ad.

    I want to save place on the website if AdSense doesn't serve anything.

    Any ideas?

    Szy.
     
    szy, Jan 2, 2005 IP
  2. EdenView

    EdenView Peon

    Messages:
    305
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you have another adsense ad above the one with no content, then the second one doesn't even load on some of my pages.

    Also, you could have alternative ad code be blank space so when it's PSA's nothing but blank space shows up.
     
    EdenView, Jan 2, 2005 IP
  3. szy

    szy Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ... yes, this space makes me crazy... :mad:

    Szy.
     
    szy, Jan 2, 2005 IP
  4. Will.Spencer

    Will.Spencer NetBuilder

    Messages:
    14,789
    Likes Received:
    1,040
    Best Answers:
    0
    Trophy Points:
    375
    #4
    Set your AdSense alternative ad as such:
    
    google_alternate_ad_url = "/google_adsense_script.html";
    
    Code (markup):
    And then include this code in the file /google_adsense_script.html:
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title></title>
    <script src="http://pagead2.googlesyndication.com/pagead/google_adsense_script.js" type="text/javascript"></script>
    </head>
    <body style="background-color: transparent;">
    </body>
    </html>
    
    Code (markup):
     
    Will.Spencer, Jan 2, 2005 IP
  5. my3cents

    my3cents Peon

    Messages:
    332
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #5
    In addition to Will's code above, it is also important to note that this "collapsing" ad space code only works in IE... at least last time I checked... But that covers 85% of your users for most sites... At least until Firefox takes over the world... ;-)
     
    my3cents, Jan 2, 2005 IP
  6. szy

    szy Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Great, it works! Thank you :)

    Szy.
     
    szy, Jan 2, 2005 IP
  7. EdenView

    EdenView Peon

    Messages:
    305
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #7
    The sooner the better :rolleyes:
     
    EdenView, Jan 2, 2005 IP
  8. szy

    szy Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    But it works in FF too. At least in my 1.0 PL version.

    Szy.
     
    szy, Jan 3, 2005 IP
  9. TechEvangelist

    TechEvangelist Guest

    Messages:
    919
    Likes Received:
    140
    Best Answers:
    0
    Trophy Points:
    133
    #9
    Good tip Will

    I just started using AdSense on a site and I was contemplating how to accomplish this.
     
    TechEvangelist, Jan 3, 2005 IP