Collapsing ad units are an optional advanced feature of Google adwords ads. The collapsing ad unit code will ‘collapse’ your ad unit so that it takes up no page space if there are no targeted ads available. This allows you to minimize any blank space that would otherwise occur through the use of alternate colours.
To implement the collapsing ad units feature, you’ll need to host a small HTML file on your domain. Your alternate ad URL will reference this file, which will be called if there are no ads available for that particular ad unit. Please follow the instructions below:
- Download the collapsing ad units file by right-clicking the link below and selecting Save Target as� http://pagead2.googlesyndication.com/pagead/google_adsense_script.html
- Copy this file to any location on your domain. Important: if you are running ads on multiple domains or subdomains, you will need to 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.
For example: code>http://www.example.com/scripts/google_adsense_script.html
- Click Update Code
- Copy and paste the ad code into your web pages. You must ensure that the alternate ad references the collapsing ad units script on the same domain or subdomain as your web page. For example, if your alternate ad URL references the collapsing ad units HTML file on www.example2.com, you cannot place this ad code on any page of www.example.com or on any page of forums.example2.com. Doing so will result in errors on your page.
If you have successfully implemented the collapsing ad unit code, your ad units will disappear when targeted ads are not available. Please note that this feature will not work with Internet Explorer version 5.0 or lower any unused ad units will appear as empty, transparent boxes.