amp-ad Render on Idle not honoring data-loading-strategy
What's the issue?
The new Render on Idle feature for Doubleclick data-loading-strategy attribute.
How do we reproduce the issue?
- Generate a long page with multiple Doubleclick ad placements throughout.
- Add a
data-loading-strategy = "3"to each placement - Notice on page load, that the ad requests for all placements are made, not just those within 3 screens away.
Even without the data-loading-strategy attribute, the new Render on Idle is supposed to load ads within 3-12 viewports away. It seems to be requesting ads beyond 12 screens.
http://cosmopolitan-2708.feature.hearstapps.net/style-beauty/fashion/gmp19181271/best-designer-items-outnet-sale/
What browsers are affected?
All browsers.
Which AMP version is affected?
New issue. Powered by AMP ⚡ HTML – Version 1519774160068
/to @lannka
@keithwrightbos should we only do 12 viewports when data-loading-strategy is not specified?
render on idle does not effect when ad requests are made but rather when their creatives are rendered. Fast Fetch separates the two allowing for the ad response to be fetched immediately while enforcing AMPs constraints about when content is allowed to execute (the default being within 3 viewports and render on idle extends this to 12 viewports for ad creatives when the AMP scheduler is idle).
Reopening.
Fast Fetch separates the two allowing for the ad response to be fetched immediately while enforcing AMPs constraints about when content is allowed to execute
This addresses the network logs, but doesn't change that the creative can be rendered 12 viewports away when data-loading-strategy is specified. Likely the latter should take precedence, right?
Have you all heard back from AMP tech support or DFP support on this matter? Seems as though the VICE Media team are seeing the same issue.
Sorry just saw that this was re-opened. Render on idle is disabled if data-loading-strategy is specified (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-ad-network-doubleclick-impl/0.1/amp-ad-network-doubleclick-impl.js#L358):
/** @override */ idleRenderOutsideViewport() { // Disable if publisher has indicated a non-default loading strategy. if (this.element.getAttribute('data-loading-strategy')) { return false; }
If there is still an issue for VICE media, can they please provide more details on the issue?
[@keithwrightbos] we've set the data-loading-strategy attribute to 3 on each of our amp ad slots yet on page load we're seeing all ads requested at once. My previous experience with using data-loading-strategy ad requests are only made when scrolling in proximity (x number of viewports) of the ad slot. More than happy to share a test environment for review. Charles file attached https://drive.google.com/file/d/1JSzUKZrSHN1EmLewX5cDm4BvE8NdsNq3/view?usp=sharing
This is expected (see previous comment) and not related to render on idle. Fast Fetch (launched in July see https://amphtml.wordpress.com/2017/08/21/even-faster-loading-ads-in-amp/) sends the ad request for all slots independent of viewport location but waits to render (actually write the creative to the page) until the slot is within 3 viewports (or 12 if render on idle is enabled). Note that delayed impressions are not fired until the slot is rendered.
@keithwrightbos thank you for confirming.