ampproject / ampproject/amphtml

I2I: migrating amp-sticky-ad to amp-ad

Open
#30,659 2 comments 0 reactions 1 assignee Claimed by @powerivq View on GitHub
INTENT TO IMPLEMENT Stale
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

## Summary
We have made an amp-sticky-ad extension to allow displaying of amp-ad in a way that sticks to the bottom of the page.

```


```

We propose to merge all the features of amp-sticky-ad into amp-ad, and deprecate the amp-sticky-ad extension. Amp-sticky-ad features will become attributes on amp-ad, and all existing amp-sticky-ad usage can be transformed one-to-one into an amp-ad tag with no change in behavior.

This will address the issues we are raising above. It makes amp-ad the only arbiter of the ad rendering process, removing the need to use the owner system. More importantly, it adds to the flexibility for publishers.

## Design document
We are adding sticky as an attribute to the amp-ad extension to indicate that it is a sticky ad, and a position can be set to indicate where the ad slot is placed on the page. The following is an example of how an amp-sticky-ad would be transformed into.

```

```

`sticky` may be of values: buttom, bottomright, bottomleft, top, topleft, topright, indicating where in the page would the ad slot be sticky to.

Note: how many of these do we want to support? We do not currently have ads sticky to the top.

### Restrictions
At the outset of the migration, we are keeping the existing restraints in places. That includes:
1. The max-height of the sticky-ad is 100px, if the height exceeds 100px then the height would be 100px and overflow content will be hidden.
2. Do not allow transparent background.
3. Only render the ad when there are some actions (scrolling event)
4. Only one sticky ad on a page

### Resizing
At the outset of this migration, we do not plan on supporting resizing of the ad slot.

## Motivation

There are several issues with this approach:

1. The current system requires use of the owner system, which is scheduled to be deprecated.
2. This requires the publisher to tag their sticky ad in a certain inflexible way.

## Additional context
We are also working on allowing more ad formats on amp-ad, which includes several proposals calling for a derivative version of this sticky ad.

These rich formats will also share the same sticky attribute with this proposal in the future. They will be using a different position attribute (bottomright), and additional opt-in attributes.

## Launch tracker
The proposal is to do the following:

- Implement the sticky attribute on amp-ad, reaching feature parity;

- Send deprecation notice for amp-sticky-ad users;

- Iterate on the design, and progressively implement rich ad formats on top of it.

/cc @ampproject/wg-monetization

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.