ampproject / ampproject/amphtml

autonomy for amp auto ads

Open
#31,857 1 comment 0 reactions 0 assignees View on GitHub
Stale Type: Feature Request
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

## Context
Today, the amp-auto-ads component has a problem (not so much a problem) that the ads doesn't load if causes layout shifting. Because of that, we don't have so much control of where we want to display ads. Yeah, I know we can put divs with the max height to prevent layout shifting, but if we do that, there's no reason to have a amp-auto-ads component. The main reason to have a this component, is for the publisher deals with the content and some network deals with the ads, in the simplest way possible.

So, we need to have a solution that gives more autonomy for the networks display the ads through the amp-auto-ads component.

## Alternatives I've considered
I have considered two alternatives, don't know if it's viable.

1 - Implement a Loader.
The first and simplest alternative is to implement a loader on the page. When the publisher implement the amp-auto-ads they can have a option that uses a loader to display all the ads before is visible for the users. Don't know if it will work, and I know this isn't the best solution.

2 - Store on google cache.
This one I don't have any idea how could be implemented, but as the publishers receives a json file with the ads configuration from the amp-auto-ads, the google could search for all the places and implement a div with the max height in the source file stored in cache, so when the user request for the site, the divs are implemented in the source code and will not cause layout shifting.

I need more ideas.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the amp-auto-ads component and the issue's two proposed alternatives: a loader and storing layout information in Google Cache. The issue does not identify files, tests, or a decided approach, so first define a feasible solution and clear acceptance criteria for giving ad networks more control without layout shifting.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.