Now I have a case that ad block is empty for some reason. Is there any way to force Google to show at least something in this block (let say a blue rectangle)? Or may be I can skip the empty ad block to avoid the empty white areas? It looks weird if the part of page is just empty.


4 Answers 4


There are many reason google will show empty Ads,if it's genuine reason like preliminary checks on your site,etc..,sure your ads will display very soon.

I think there is no way you can force Google Ad,So even if you manage to do that, expect your account to be suspended some time later,because that's way of showing AdSense violates Google's TOS.

You shall not, and shall not authorize or encourage any third party to: ... (ii) edit, modify, filter, truncate or change the order of the information contained in any Ad, Link, Ad Unit, Search Result, or Referral Button, or remove, obscure or minimize any Ad, Link, Ad Unit, Search Result, or Referral Button in any way without authorization from Google.

  • I think you understand my needs not as it is. I'm not trying to force showing ads when Google can not do it. Google some time can not show ads for some reasons (this performance indicated by the 'coverage' parameter). I just want to avoid the empty squares on a page and replace them with a color filled rectangle at last. I can slightly remember this setting in AdSense account if I'm not wrong. There was an options to show: empty rectangle, color filled rectangle or something else (I don't remember the details)... May 26, 2014 at 9:34
  • Sorry Roman am not aware of that,i think you can do this one on Google’s DoubleClick. May 26, 2014 at 9:43

You can refer to Backup ads information page for that. In absence of ads, you can choose to display an empty box (default), a box filled with a selected color or a custom html for displaying some thing else (e.g. a banner ad for an in-house web site).


There was a possibility to replace empty unit with one of these: a) solid color b) close the space c) any other code

Unfortunately, these options were discontinued few months ago, so you really have no other option in adsense. source: https://support.google.com/admanager/answer/3376115?hl=en

However, you can use something before calling adsense. Some ad manager or header bidding.


Well this is at first tricky, but actually pretty simple (skip to TL;DR if you like).

Google adsense as of 2019-06-17 creates a structure like this for me:


Now you can sort of test the loading of the outer iframe (eg use document.getElementById('aswift_0').contentDocument)., but cross-domain restrictions [CORS] prevent accessing the document that is loaded in to that frame, and so the actual iframe#google_ads_frame1 is inaccessible. For me, the outer frame can load, and leave the inner frame absent; so it's not enough to test for the outer frame.


Well you can just style the outer frame, and if the outer frame isn't there you could put a div in place to hold the outer frame and style that.

TL;DR, I did:

div.s1 ins > ins > iframe { background-color: #e5eac0; }

and styled the iframe. But if you want a colour even when that frame isn't there then wrap the <script> call in a div and style that to the size you're expecting your iframe to be, and give it whatever background you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.