joined:Aug 3, 2015
What solution would you guys choose to collapse empty ads?
I prefer the first solution:
If ad slots will get filled most of the time:
Add googletag.pubads().collapseEmptyDivs(); to the <head> portion of your page to collapse a particular div only when an ad doesn't serve to its ad slot. If a slot isn't filled, the div collapses, possibly moving the page content up with it and reflowing the page.
If ad slots will stay empty most of the time:
Add googletag.pubads().collapseEmptyDivs(true); to the <head> portion of your page to collapse all divs on the page before the browser fetches any ads. When an ad request happens for a slot, if the particular slot is filled, the div expands, possibly pushing down the page content and reflowing the page.
If ad slots will always stay empty on a page:
Don't specify the collapseEmptyDivs() method at all. The divs will never collapse ,so the page content will never be pushed down or pulled up; however, this may leave a blank space on the page if an ad doesn't serve to a particular slot.