I2I: amp-ad always show fallback element when no ad available
Summary
amp-ad element supports a fallback child element, that is shown only when these two conditions are met
- No Ad available
- The attempt to collapse the
amp-adelement fails
The proposal is to add a new attribute to amp-ad element, called data-on-no-content to give more control how the amp-ad behaves when no Ad is available.
For now, the only value supported by this attribute would be fallback When set, and no Ad is available, amp-ad won't try to collapse but will always show the fallback element instead.
Motivation
For sites running direct Ad campaigns, or that apply floor price optimization in order to preserve high quality advertisement, is very common to never achieve 100% of Ad fill rate, and the Ad server returns empty.
Instead of always collapsing, the fallback element in the amp-ad could offer alternate content to the user when there's no advertisement, like related next articles or other re-circulation elements, to increase user engagement.
An example
<amp-ad data-slot="/30497360/a4a/empty"
data-on-no-content="fallback"
height="250"
type="doubleclick"
width="300">
<amp-list fallback src="https://www.example.com/related-articles.json"></amp-list>
</amp-ad>
/cc @ampproject/wg-approvers @zhouyx @lannka
Pull request opened with an implementation proposal
Current behavior: attempt to collapse -> provided fallback -> default fallback. With the exception that sticky ad and flying carpet ad always collapse.
Personally I'm fine with the proposal as long as the fallback is not another <amp-ad> component.
to @ampproject/wg-ads
@zhouyx Thanks!
What problem do you see by having another <amp-ad> as fallback?
I don't think it's the best user experience by falling back to another ad. But I also understand that's possible today. Will let @lannka and @jasti make the decision.
What do you think @lannka @jasti ?
Is there any chance this could be discussed?
@zhouyx @lannka @jasti
@oliverfernandez it does not seem right to me to use fallback to do another ad request. If the feature request is to retry with a different ad network (what so called mediation chain), I'd rather implement a feature for that. Having another dynamic element inside fallback can be abuse of fallback.
since @jasti is out, @nainar what you think from UI's perspective? The decision here can affect any AMP extension that supports a fallback.
@ampproject/wg-ui-and-a11y
@lannka Thanks! Let's see what @ampproject/wg-ui-and-a11y thinks about this PR.
I think that the mediation chain you mention is also interesting. What do think would be the best context to discuss this? Open another issue, or in a Design Review meeting?
@oliverfernandez yep, please a new issue to discuss the new feature request.
@ampproject/wg-ui-and-a11y any guideline how fallback should be used? I feel we should disallow dynamic content in fallback
I'm not sure how (if?) we validate fallback contents, but I do share the concerns with having dynamic content in fallbacks in general. This could lead to a long delay for the user before they see some content depending on how long it takes things to fail.
I'm not sure if we have any official guidance on the matter though.
@honeybadgerdontcare what do you think if we want to validate fallback content to only allow a whitelist of AMP extensions?
@lannka It'd depend on how it's implemented. Is this something only the amp-ad component would use for a fallback or would other components that may want a fallback also find this useful?
I agree with @sparhami that we should come up with an official guideline on the usage of fallback element before we start to validate them. I know a lot of users are already relying on the fact that an ad can fallback to another ad when there's a no fill.
Friendly ping on this thread. We get request for this on slack as well.
Hi guys! I just wanted to do some friendly push to this since having flexibility on the amp ad fallback is an important feature for our clients needs
I think the idea solution here is to validate fallback elements for all components. However at this moment it would be difficult to do because that could bring a breaking change. @nainar @jeffjose ideas on a deprecation process? Or is this not practical because the change would affect a list of components.
We do have the option to change the ad behavior without a breaking change. But that's a UX decision to make and we'd want to run some UX study before changing the product behavior. @jeffjose could you please help with the study here. Thanks. If possible we can bring this topic to one of the design review for more feedback.
Hi there Guys!! Is there any update on this issue?
having flexibility on the amp ad fallback is an important feature
@juanazabalmrf I assume you're talking about ads mediation (try different vendor if this vendor does not return an ad).
I think people generally agree that using fallback to do this kind of thing is not what fallback is originally designed for, and we want to fix that.
Feel free to propose a generic ads mediation extension to fulfill your requirements. With my limited knowledge about mediation, for example something like:
<amp-mediation-ad>
{
vendors: [
{
type: 'vendor-a',
customerId: '12345',
},
{
type: 'vendor-b',
customerId: 'abcde',
}
]
}
</amp-mediation-ad>