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.
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.
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):
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... ;-)