0

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.

Thanks!

1

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)... – Roman Matveev May 26 '14 at 9:34
  • Sorry Roman am not aware of that,i think you can do this one on Google’s DoubleClick. – Sudheera Njs May 26 '14 at 9:43
1

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).

1

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.

1

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:

ins#aswift_0_expand
 ins#aswift_0_anchor
  iframe#aswift_0
   html
    body
     iframe#google_ads_frame1

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.

Problem?

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, privacy policy and cookie policy

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