Regression - amp-ad fallback doesn't work
I brought this up 2 weeks ago on another issue but it might have been unrelated and got ignored.
This causes a very negative UI experience when ads don't show.
amp-ad fallback doesn't work, neither via the <div fallback> element or via collapsing.
This is with DFP so may be an issue with the DFP implementation. When I looked at this 2 weeks ago DFP was very clearly returning no ad (ie, it's not that DFP was returning an ad that looks empty but wouldn't be interpreted as no-ad).
Test page: http://output.jsbin.com/nemanob/quiet


@aghassemi
/to @lannka @zhouyx Setting as high priority for now until you triage.
@jamesshannon To confirm. I get this for the first ad. It doesn't collapse
This for the second ad that collapses.

They look correct to me. Can I know what went wrong here? Thanks.
Weird. Anybody else?
zhouyx is seeing what I'd expect. But my screenshots show something else.
It's WAI in FF but not Safari (where I don't run anything special) and Chrome on my phone.
However, it's not WAI in Chrome on my desktop, even incognito mode. The frame instead has the "blank DFP ad" html:

I also copied the page into a google storage bucket in case jsbin was causing issues: https://storage.googleapis.com/mps-storage/jshannon/amp_test_pages/ampad_fallback.html
I see. In your case, there's a blank DFP ad html. But when I investigate the page, there's not ad html. AMP has no idea of the what's the ad creative looks like, whether it's a blank ad or a filled ad. Thus it doesn't apply fallback in your case.
@keithwrightbos Do you have an idea what's the correct behavior here? Thanks.
That's what DFP returns when there's a blank ad, in addition to the metadata. While this could be an issue with the DFP implementation (not always communicating that the returned ad is blank), it's also possible that it's passing the HTML and ALSO telling amp-ad that the ad is blank, and amp-ad isn't respecting that.
@jamesshannon Doubleclick Fast Fetch attempts to identify no fills by looking for a truly empty creative (meaning empty string). Are you saying that there are cases where the result is essentially a no fill but there is some HTML in the creative? Does this content expect to be rendered (e.g. it contains some tracking or other scripts)?
In my experience working on DFP, DFP has historically returned empty-HTML-code (different from no-HTML-code empty string) when it doesn't have an ad to return. I can't say if DFP has changed behavior recently, or does something different only in response to (fast-fetch) AMP requests.
When I reported this in the other bug I think I even included a screenshot that while DFP returned the empty-HTML-code there was also a x-lineitem-id response header of -1 or -2 -- I always forget which one, but that signifies no creative being returned. AFAIK DFP doesn't add trackers or anything, it's simply doing this because it historically assumes the ad will be rendered and probably ran into issues where browsers don't like empty content response.
We have launched an explicit indicator of no fill that is no longer dependent upon the creative itself being empty. Please re-open if this issue is still present for doubleclick amp-ad requests. Thanks