How to Use Google Adsense Collapsing Ad Units

Do you know you can get collapsing Adsense ad units, and collapse the free space instead of showing Public Service Ads. Are Google Adsense Public Service ads and public service ads spoiling your professional website design? Alternate urls do not work for you? Then you need to activate Collapsing Ad Units… I do.

Google Adsense Collapsing Ads

Simply put, if there are no targeted ads available, then instead of showing public service ads (PSA) (or alternate ads / blank colours if specified) – the collapsing ad unit code will ‘collapse’ your ad unit so that it takes up no page space and your website appears as if no Google Adsense ad was places there. This helps to remove huge unused and non monetizing web space.

How can you make collapsing ads work on your site?
First you will need to download and host a small collapsing ad units HTML file on your domain. Host this file on each of your domains and subdomains in order to use the collapsing ad units feature. In the Alternate Ads URL text box, enter the fully defined path to the collapsing ad units HTML file on your domain.

Typically the file code looks like this and you can save it as google_adsense_script.html and upload to your server.

<!DOCTYPE html>
<html lang="en">
<script src="" type="text/javascript"></script>
<body style="background-color: transparent;">

This ensures you get a blank file with a transparent background which matches the background where the ad should have appeared.

Will it work on your Blogger blog? Only if site is hosted on an external server or you previously upgraded to Blog*Spot Plus. I am routinely using it on this blog and see no Public service ads.

Share with friends

About the Author: P Chandra is editor of QOT, one of India's earliest tech bloggers since 2004. A tech enthusiast with expertise in coding, WordPress, web tools, SEO and DIY hacks.