Skip to content

Commit

Permalink
Update amp-ad sticky ad documentation (#35512)
Browse files Browse the repository at this point in the history
  • Loading branch information
powerivq committed Aug 4, 2021
1 parent a62b451 commit c491d6f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion extensions/amp-ad/amp-ad.md
Expand Up @@ -63,6 +63,7 @@ The `<amp-ad>` requires width and height values to be specified according to the
width="300"
height="250"
type="industrybrains"
sticky="bottom"
data-width="300"
data-height="250"
data-cid="19626-3798936394"
Expand Down Expand Up @@ -97,6 +98,8 @@ Optionally, `amp-ad` supports a child element with the `placeholder` attribute.

If no ad is available for the slot, AMP attempts to collapse the `amp-ad` element (that is, set to `display: none`). AMP determines that this operation can be performed without affecting the user's scroll position. If the ad is in the current viewport, the ad will not be collapsed because it affects the user's scroll position; however, if the ad is outside of the current viewport, it will be collapsed.

If this is a sticky ad unit (`sticky` attribute is set), the entire sticky ad will not be displayed without regards to `fallback` attribute.

In the case that the attempt to collapse fails. The `amp-ad` component supports a child element with the `fallback` attribute. If there is a fallback element in presence, the customized fallback element is shown. Otherwise AMP will apply a default fallback.

**Example with fallback:**
Expand Down Expand Up @@ -177,6 +180,14 @@ Specifies an identifier for the
[ad network](#supported-ad-networks).
The `type` attribute selects the template to use for the ad tag.

### `sticky` (optional)

Use to denote that this is a sticky ad unit and specify the position of this unit. Its value must be one of:

- top
- bottom
- bottom-right

### `data-foo-bar`

Most ad networks require further configuration, which can be passed to the
Expand Down Expand Up @@ -249,7 +260,7 @@ to AMP components.

## Styling

`<amp-ad>` elements may not themselves have or be placed in containers that have CSS `position: fixed` set (with the exception of `amp-lightbox`).
`<amp-ad>` elements may not themselves have or be placed in containers that have CSS `position: fixed` set (with the exception of `amp-lightbox` and sticky ad unit).
This is due to the UX implications of full page overlay ads. It may be considered to allow similar ad formats in the future inside of AMP controlled containers that maintain certain UX invariants.

## Validation
Expand Down

0 comments on commit c491d6f

Please sign in to comment.