amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

amp-ad Render on Idle not honoring data-loading-strategy

Open weylandjung opened this issue 8 years ago • 9 comments

What's the issue?

The new Render on Idle feature for Doubleclick placements does not honor the data-loading-strategy attribute.

How do we reproduce the issue?

  1. Generate a long page with multiple Doubleclick ad placements throughout.
  2. Add a data-loading-strategy = "3" to each placement
  3. 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/

image

What browsers are affected?

All browsers.

Which AMP version is affected?

New issue. Powered by AMP ⚡ HTML – Version 1519774160068

weylandjung avatar Mar 09 '18 12:03 weylandjung

/to @lannka

aghassemi avatar Mar 09 '18 18:03 aghassemi

@keithwrightbos should we only do 12 viewports when data-loading-strategy is not specified?

lannka avatar Mar 13 '18 17:03 lannka

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).

keithwrightbos avatar Mar 14 '18 16:03 keithwrightbos

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?

jridgewell avatar Mar 14 '18 18:03 jridgewell

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.

nhuynh50 avatar Mar 22 '18 02:03 nhuynh50

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 avatar Mar 22 '18 02:03 keithwrightbos

[@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

nhuynh50 avatar Mar 22 '18 02:03 nhuynh50

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 avatar Mar 22 '18 02:03 keithwrightbos

@keithwrightbos thank you for confirming.

nhuynh50 avatar Mar 22 '18 02:03 nhuynh50