Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize amp-ads for viewability. #72

Merged

Conversation

adamsilverstein
Copy link
Contributor

The data-loading-strategy attribute controls how eagerly (how many viewports) amp-ads load. See https://amp.dev/documentation/components/amp-ad/#data-loading-strategy-(optional)

This is important because if we load ads a user never scrolls to, these ads are never viewable and overall yield will suffer as a result. Unfortunately the default value is sub-optimal.

This article - https://medium.com/ampfuel/optimize-your-amp-pages-for-high-ad-viewability-rate-or-high-ads-served-311f6b539c73 - does a great job explaining the optimal value to use (and why). Fortunately the AMP runtime provides a constant we can use: data-loading-strategy="prefer-viewability-over-views". This at the moment is 1.25 but may be fine tuned in the future if further testing reveals the need for a different number.

This PR ads the attribute by default with the expectation that it will improve yield for all users; let me know if you prefer this be controllable via a filter or if you plan on doing something broader like #55.

Copy link
Contributor

@claudiulodro claudiulodro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the delay on reviewing this. Thanks for the contribution. This looks like a good improvement, and it works well in my testing.

I think it makes sense to use this strategy by default instead of making things more complex for our users by requiring them to learn about loading strategies and make a decision on one. 👍

@adekbadek adekbadek merged commit 6a29e67 into Automattic:master Sep 15, 2020
@adekbadek
Copy link
Member

Note: I've had to briefly turn off branch protection to merge this. The reason was that CI did not pick up this PR because "build from forks" setting was off. I've now turned it on, so this will not happen again.

matticbot pushed a commit that referenced this pull request Sep 15, 2020
# [1.7.0-alpha.1](v1.6.1-alpha.1...v1.7.0-alpha.1) (2020-09-15)

### Features

* optimize amp-ads for viewability ([#72](#72)) ([6a29e67](6a29e67))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.7.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Sep 15, 2020
# [1.7.0](v1.6.1...v1.7.0) (2020-09-15)

### Features

* optimize amp-ads for viewability ([#72](#72)) ([6a29e67](6a29e67))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

dkoo pushed a commit that referenced this pull request Apr 13, 2021
# [1.7.0](v1.6.1...v1.7.0) (2020-09-15)

### Features

* optimize amp-ads for viewability ([#72](#72)) ([6a29e67](6a29e67))
matticbot pushed a commit that referenced this pull request Apr 20, 2021
# [1.1.0-alpha.1](v1.0.0...v1.1.0-alpha.1) (2021-04-20)

### Bug Fixes

* add 'supports' to block to prevent Gutenberg 8.6.0 notice ([3651cb8](3651cb8))
* correctly center aligncenter ads ([56d891a](56d891a))
* dont define slots that arent present ([f7439ff](f7439ff))
* dont show ads on viewports smaller than smallest ad size ([f726214](f726214))
* for sticky ads, use smallest ad unit size available ([#101](#101)) ([8b4da54](8b4da54))
* harden queried object check logic ([dced583](dced583))
* improve responsive ads in non-AMP mode ([02bde12](02bde12))
* initial work on amp multisize ([ae6aad6](ae6aad6))
* limit multisizes of sticky ads ([#109](#109)) ([481fccc](481fccc))
* placeholder box-shadow and background color since gutenberg 7.7 ([6a96286](6a96286))
* remove deprecated third arg from function ([fddcd06](fddcd06))
* remove early ad display calls ([95a2217](95a2217))
* remove redundant responsive ad handling ([a8b5727](a8b5727))
* unique IDs for responsive ads ([#35](#35)) ([e98b0fc](e98b0fc))
* use name for array index not code, as code can be reused ([dea4799](dea4799))

### Features

* add common ad targeting to ad units ([18dca0b](18dca0b))
* add filter for controlling whether ads are displayed ([d0d0851](d0d0851))
* add filter for customizing ad output ([ee6e442](ee6e442))
* add filters to extend ad sizing logic ([a3b396f](a3b396f))
* add Gutenberg icon and replace Material ([#88](#88)) ([2e7ddc9](2e7ddc9))
* add support for ad targeting via filter ([9abc0ae](9abc0ae))
* automatic responsive ad handling in non-AMP mode ([7d4719e](7d4719e))
* check for amp plus status ([7168e03](7168e03))
* data attributes on gam scripts for amp sanitization ([484fc82](484fc82))
* improved ad sizing for non-responsive amp ads ([9551a20](9551a20))
* optimize amp-ads for viewability ([#72](#72)) ([6a29e67](6a29e67))
* responsive ads for super cool ad inserter placements ([#31](#31)) ([2fbf558](2fbf558))
* size grouping for responsive amp ads ([0b7da43](0b7da43))
* trigger release ([af80dd2](af80dd2))
* trigger release ([441aef1](441aef1))
* update block icon ([#116](#116)) ([6831c72](6831c72))
* update block icon style and colour ([#82](#82)) ([a31297f](a31297f))
* update block placeholder and alignment options ([#121](#121)) ([744bb3d](744bb3d))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants