amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Show default fallback when no ad is available to serve

Open jasti opened this issue 10 years ago • 16 comments

On AMP pages when an adserver doesn't respond with an ad, the AMP runtime will collapse the ad as long as it doesn't affect the user scroll position. amp-ad also supports a fallback attribute which is shown when ad isn't available for the slot.

In cases where the ad slot can't be collapsed and the publisher hasn't provided a [fallback] we show blank boxes, which is not good UX. Instead, we should show a default fallback image which has the following components: a) fallback image with a grey background, similar to Google Contributor image b) Text : "We don't have an ad to show you. Enjoy!" Text up for debate :)

CC @cramforce @kashyapnitin

jasti avatar Jun 28 '16 22:06 jasti

Should show prioritize the provided [fallback] element, falling back to one of the defaults you've suggested, when we can't resize?

jridgewell avatar Jun 28 '16 22:06 jridgewell

@jridgewell Yeah, the idea is to make a fallback for the fallback if the page does not provide one.

cramforce avatar Jun 28 '16 22:06 cramforce

Yup, I've also updated the issue with case. Priority is Try to show ad > Publisher provided fallback > Try to collapse > Default fallback (this issue)

jasti avatar Jun 28 '16 22:06 jasti

Whoops, I misread.

jridgewell avatar Jun 28 '16 22:06 jridgewell

It is worth reconsidering whether collapse should have higher priority over pub-supplied fallback.

On Tue, Jun 28, 2016 at 3:41 PM, Justin Ridgewell [email protected] wrote:

Whoops, I misread.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ampproject/amphtml/issues/3817#issuecomment-229206082, or mute the thread https://github.com/notifications/unsubscribe/AAFeT7vVzs1wySJuOUXm4CIwJT-5cRPHks5qQaMKgaJpZM4JAmFW .

cramforce avatar Jun 29 '16 00:06 cramforce

One thing I find is attempchangeHeight to <amp-ad-3p-impl> won't trigger a resize to its parent <amp-ad>? that's a bug right? @cramforce @jridgewell

zhouyx avatar Jul 06 '16 21:07 zhouyx

Right. One we need to fix before we ship A4A

cramforce avatar Jul 06 '16 21:07 cramforce

CC @ampproject/a4a

cramforce avatar Jul 06 '16 23:07 cramforce

@tdrl See comment about attemptchangeHeight not playing well with <amp-ad-3p-impl>?

michaelkleber avatar Jul 07 '16 00:07 michaelkleber

Tracking in #3936

cramforce avatar Jul 07 '16 00:07 cramforce

Definitely appears to be related to A4A change. Please feel free to re-assign to me.

What is the best way to pass reference to the parent element (amp-ad) to allow for calling attemptchangeHeight? Or would it be sufficient to call the following (after verifying parent element is amp-ad):

resourcesFor(this.getWin()).attemptChangeHeight(
    this.element.parentElement, 0, /* newWidth */ undefined, () => {
     this.element.parentElement.style.display = 'none';
 });

keithwrightbos avatar Jul 07 '16 02:07 keithwrightbos

@zhouyx in light of your new PR, here is a lo-fi version of how was thinking this should work overall. I'll make a better version tomorrow, but wanted to get this out for your feedback. img_0470

@lannka @jridgewell FYI.

jasti avatar Jul 28 '16 16:07 jasti

In the wake of Dima's PRs to make A4A upgrade-compliant and Keith's followup, A4A should implement the same fallback behavior as 3p-impl at this point, at least for ads rendered via the iframe fallback path. I think we'll need to examine behavior for the shadow DOM rendering path.

On Thu, Jul 28, 2016 at 12:33 PM, Vamsee Jasti [email protected] wrote:

@zhouyx https://github.com/zhouyx in light of your new PR, here is a lo-fi version of how was thinking this should work overall. I'll make a better version tomorrow, but wanted to get this out for your feedback. [image: img_0470] https://cloud.githubusercontent.com/assets/2366341/17220893/5ada5c9a-54bf-11e6-8459-fcf39fdade8f.JPG

@lannka https://github.com/lannka @jridgewell https://github.com/jridgewell FYI.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ampproject/amphtml/issues/3817#issuecomment-235950318, or mute the thread https://github.com/notifications/unsubscribe-auth/AQ4oaCS2BCPVTSeLTiL62x3-mjdQuDwyks5qaNnCgaJpZM4JAmFW .

Terran Lane email: [email protected] Google Cambridge, MA Knowledge Graph "But I don't want to go among mad people," Alice remarked. "Oh, you can't help that," said the Cat: "we're all mad here. I'm mad. You're mad." "How do you know I'm mad?" said Alice. "You must be," said the Cat, "or you wouldn't have come here."

tdrl avatar Jul 28 '16 17:07 tdrl

Part of #5918

rudygalfi avatar Dec 20 '16 18:12 rudygalfi

Launched. @glevitzky is this also already launched for A4A?

jasti avatar Feb 10 '17 05:02 jasti

Yes, this is the behavior we currently see in A4A.

glevitzky avatar Feb 10 '17 18:02 glevitzky