Forum Moderators: martinibuster

Message Too Old, No Replies

Blank ad space and collapsing

         

Dimitri

9:51 pm on Aug 20, 2019 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



Hi,

The other day I was answering @gatormark that, my "blank" ad spaces were correctly being collapsed by Adsense.

I thought it might deserve a discussion on its own, especially since, in a near future (or may be even right now), this is what Adsense is going to do for all slots: [webmasterworld.com...] (among other things).

So, from "my" observations on "my" site (may be it's different elsewhere) :

- Ad slots above the fold, are never collapsed
If this is the expected behavior, I guess that this is to prevent "jumps" of the page layout, I don't know which word you are using in English. I mean, when elements of a page, keeps moving up and down as other elements are getting their final size. (good practice is to set the size of elements or/and placeholders)
Before being collapsed, ad slots are getting their desired size, then the height is turned into 0px if empty.
So, if even a tiny bit of an ad slot is visible above the fold, it won't be collapsed.

- If you control the size of the ad slot using CSS, then the ad slot will not be collapsed.

- Finally, if you want to detect, in javascript, if a slot is collapsed, you can check its height, using a timer function for example, but, the best remains to use the the ResizeObserver interface: [developer.mozilla.org...] . However, it's actually supported only by Chrome and Opera, (and the next update of Firefox)

JorgeV

8:32 am on Aug 30, 2019 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



Hello Dimitri-

I think you are right. Since a while, adsense no longer collapses blank ads above the fold. This sucks, especially since Adsense discontinued backup ads!

There must be a way, beside using AdManager.