Baby Community
Well-known member
the source is very nice but you can add it with a little play ..
collapseEmptyDivs()
is for ads (including AdSense ads) delivered through Google Ad Manager (previously called Doubleclick for Pusblishers or DFP in short), it will not work for direct Google AdSense ads neither manual nor auto-ads.Please read my previous post; this code is for Google AdManager/Doubleclick for publishers (DFP) and does work just fine for that. It does not work for pure AdSense.@Kirby
is the conclusion that nobody has been able to get this to work?
I would like to know how I can get the AD space to collapse when there is no fill, either using Javascript or CSS. I found old articles, but the code doesn't match what google tells me to put on my website.
I surrounded the ad space in a div, but it just leaves a large white space when nothing shows up. I have service workers so that the user can use the website while offline. I would like the ad space to collapse so that there is more room for content. This is what I have pasted into the my website.
Except of course it isn't happening.Platinum Product Expert Gracey
8/11/19
AdSense is already doing that - though I'm not sure if it's rolled out to all accounts yet.
Simplifying "If no ads available"
We're continuously working to increase the quality and safety of our ad network and reduce the number of malicious ads that enter the AdSense network. As a result, we're removing the "If no ads available" option and we'll be defaulting to collapsing the ad space or showing a blank space instead. If your current setting is a color or another URL, it will be updated in the near future.
https://support.google.com/adsense/answer/9193354
AdSense is what was in question here (at least from my side)...this is strange.Please read my previous post; this code is for Google AdManager/Doubleclick for publishers (DFP) and does work just fine for that. It does not work for pure AdSense.
google's support forums are the least helpful.Collapse AD space when no fill. - Google AdSense Community
support.google.com
Except of course it isn't happening.
We use essential cookies to make this site work, and optional cookies to enhance your experience.