Solvedamphtml amp-ad 'Ad' attribution does not collapse if no ad returned

What's the issue?

amp-ad 'Ad' attribution does not collapse when no ad returned

Briefly describe the bug/feature request.
amp-ad allows publishers to collapse the iframe if no ad is returned. However, the 'Ad' attribution element does not collapse with the iframe, thus leaving an ad attribution with no ad in the page.

How do we reproduce the issue?

The below URLs have an amp-ad setup that if no ad is returned (refresh several times until no ad is returned) still show the 'Anzeige' (localised version of 'Ad' in German) attribution:
https://www.google.de/amp/amp.handelsblatt.com/stromnetze-in-deutschland-energieverband-warnt-vor-zu-langsamen-ausbau-/19708306.html
https://www.google.de/amp/amp.wiwo.de/der-tag-nach-der-frankreich-wahl-dax-erklimmt-nach-abstimmung-rekordhoch-/19706872.html
https://www.google.de/amp/m.faz.net/aktuell/gesellschaft/tiere/jagd-auf-zugvoegel-80-euro-pro-portion-rotkehl

If this is a feature request you can use this section to point to a prototype/mockup that will help us understand the request.
anzeige

What browsers are affected?

All

Which AMP version is affected?

Is this a new issue? Or was it always broken? Paste your AMP version. You can find it in the browser dev tools.
New issue following from the recent ad placeholder release.

23 Answers

✔️Accepted Answer

Use a amp-ad:before selector? When the ad collapses, the before will too.

Related Issues:

3
amphtml Responsive Layout for <amp-img> BREAKS aspect ratio when nested in <amp-carousel>
@johnnyshankman Forgot about this option This bug breaks <amp-carousel>s containing <amp-img>s of di...
3
amphtml amp-ad 'Ad' attribution does not collapse if no ad returned
Use a amp-ad:before selector? When the ad collapses the before will too. What's the issue? amp-ad 'A...