You can traffic anchor ads that appear at the top or bottom of your web pages, remaining in view as the user scrolls. Anchor ads allow you to improve the monetization of your web pages, using a high-performing format that is compliant with the Better Ads Standards. Users can collapse an anchor ad at any time by clicking the arrow.
Jump to: Top anchor ads | Bottom anchor ads | Web anchor sizes | Get started
Top anchor ads
A top anchor ad is initially hidden to ensure menus at the top of the page aren’t covered. An anchor ad will appear as the user scrolls. To ensure content isn't covered when the user scrolls to the top of the page, space is reserved at the very top by setting padding-top matching the height of the slot on the body element (please ensure CSS on your site causes the space to be reserved).
Example of a top anchor ad on mobile webClosed | Open |
Closed
Open
Bottom anchor ads
Bottom anchor ads appear as soon as the ad has been fetched. To ensure content isn't covered when the user scrolls to the bottom of the page, space is reserved at the very bottom by setting padding-bottom matching the height of the slot on the body element (please ensure CSS on your site causes the space to be reserved).
Example of a bottom anchor ad on mobile webClosed | Open |
Closed
Open
Web anchor sizes
Inventory type | Sizes |
---|---|
Traditional reservations |
These reservation sizes are supported:
|
Programmatic demand |
For programmatic:
|
Get started
See details on tagging (including an example of how to control whether an anchor slot will be created on desktop or on mobile), device targeting, and more in the developer documentation.
- Tagging
- Add the
TOP_ANCHOR
orBOTTOM_ANCHOR
slot type to your web page, ideally within the<head>
element. - Display the ad slot as you would any other ad slot.
defineOutOfPageSlot()
may return null if the page doesn’t support the format
Tagging tips:- Only add anchor slots where you want an ad to be shown. Be aware that anchor ads are not limited to mobile devices. If you serve the same code to both mobile and non-mobile users, it’s recommended to explicitly define when and where anchor ads should be shown for each environment. See an example of how to target by device in the developer documentation.
- To see what your page would look like with a top or bottom anchor ad, append the hash parameter
#gamTopAnchorDemo
or#gamBottomAnchorDemo
to any page that already loads gpt.js.
- Add the
- Trafficking
- Create ad units (or use existing ones) for anchor slots. To streamline trafficking, include the size 320x50.
- To streamline trafficking, include the available sizes for traditional reservations.
- Create line items:
- For reserved inventory:
- Target anchor ad inventory as you would any other type of inventory.
- Creatives must have one of the available sizes for traditional reservations.
- Note that you can target line items by Inventory format, with “Anchor” as an option.
- For programmatic inventory:
- Include the relevant ad unit in the Ad Exchange line item.
- Include one of the available sizes for traditional reservations in the associated placeholder creative.
- Note that anchor ads can be larger for programmatic.
- For reserved inventory:
- Create ad units (or use existing ones) for anchor slots. To streamline trafficking, include the size 320x50.
- Reporting
Use the “Inventory format” dimension to see how anchor ads are performing compared to other formats.