amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

amp-ad: Make viewport distance for prefer-viewability-over-views configurable

Open jasti opened this issue 9 years ago • 13 comments

Currently, the data-loading-strategy option for prefer-viewability-over-views by default loads the ads only within 1.25 viewports of the current viewport. If publishers want to, we should allow this number to be configurable so publishers can make ads load more eagerly or lazily. CC @cramforce

jasti avatar Mar 16 '17 21:03 jasti

https://github.com/ampproject/amphtml/pull/3113

jridgewell avatar Mar 16 '17 21:03 jridgewell

It's worth thinking through if we still want to call it prefer-viewability-over-views cause if the viewport height < 1.25, it's the other way around or we could ensure that the configuration can only make it lazier. Think I'd prefer that.

jasti avatar Mar 16 '17 21:03 jasti

@jridgewell I remember this one. Do you want to take this on next sprint since you already have a head start? Think we should make the config to be strictly > 1.25. Will need a doc update - feel free to make it or let me know.

jasti avatar Mar 16 '17 21:03 jasti

Can we have it accept a float > 1.0 and less than ?? eg data-loading-strategy="1.8"

What's a good upper bound for how early to load ads? I'd to see maybe 4 (so we have a default of 2.5 +/- 1.5)

jpettitt avatar Mar 16 '17 21:03 jpettitt

Default is 3 viewports, so I think that'd be the max.

Do you want to take this on next sprint since you already have a head start?

/to @zhouyx

jridgewell avatar Mar 16 '17 21:03 jridgewell

I think the right min value is 0 (meaning: Do not render unless visible).

Agree on 3 (default) for max, unless anyone has a very good argument otherwise.

cramforce avatar Mar 16 '17 22:03 cramforce

@jasti @cramforce any idea when would this feature be out and live?

ronakrathod18 avatar Apr 12 '17 15:04 ronakrathod18

@jasti do you know if anything changed with ad viewability reporting on or after 04/05?

ronakrathod18 avatar Apr 12 '17 15:04 ronakrathod18

Visibility v3 was launched that day which I do believe caused AV rate to increase

cc/ @dvoytenko

keithwrightbos avatar Apr 12 '17 15:04 keithwrightbos

@ronakrathod18, you can expect this feature to be production by first or second week of May.

jasti avatar Apr 12 '17 15:04 jasti

To summarize the discussion here:

  • We will reuse the existing attribute data-loading-strategy, which currently only supports 1 value prefer-viewability-over-views. We will make it to accept a float number within range of [0, 3].
  • To follow the current behavior, we ignore the attribute if it has an invalid value.
  • We keep the default value to 3 (if the attribute is not specified).

I will also remove prefer-viewability-over-views from our doc.

lannka avatar Apr 27 '17 18:04 lannka

Hi @lannka - Is this feature request now live?

ronakrathod18 avatar Jul 11 '17 15:07 ronakrathod18

@ronakrathod18 Yes. Let us know how it goes.

jasti avatar Jul 11 '17 16:07 jasti