ampproject / ampproject/amphtml

amp-auto-ads do not work with "Overlay formats" (anchor, side rails, vignette)

Open
#40,353 6 comments 0 reactions 0 assignees View on GitHub
Type: Bug
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

### Description

I am in the process of converting some pages to AMP. The non-AMP existing version of the page that has worked for a long time correctly displays auto ads as configured through Adsense. The AMP version of the same exact page, however, doesn't work with any of the "Overlay formats" for auto ads. After a lot of testing, I do believe this is a bug within Adsense for sure and potentially within the amp-auto-ads component.

### Reproduction Steps

Reproduction is pretty simple:

1. Configure your Adsense account to use auto ads AND (importantly) click on "Overlay formats" and make sure all 3 are checked
2. Add amp-auto-ads exactly as the documentation says
3. Then, use the Network inspector on Chrome to look at the exact configuration that comes back from Adsense. For me in my Network inspector, the URL request looked like this:

`https://pagead2.googlesyndication.com/getconfig/ama?client=ca-pub-5211547430456695&plah=gethuman.com&ama_t=amp&url=https%3A%2F%2Fgethuman.com%2Fcustomer-service%2FFedEx%2Ffaq%2FWhat-are-the-different-shipping-options-available-with-FedEx%2F4jpSN1&__amp_source_origin=https%3A%2F%2Fgethuman.com`

Anyways, you will see that Adsense does correctly return placements for "In page formats" but it does not return placements for "Overlay formats". I have no idea where to file a bug with Adsense, but I strongly suspect the issue is on their side since the request to Adsense from amp-auto-ads looks right and the configuration returned DOES NOT reflect what is actually configured in the Adsense account.

If you want to see a live example compare these two pages that are exactly the same in content but one is non-AMP and the other is AMP:

Non-AMP version (auto ads working correctly)
[https://gethuman.com/customer-service/Verizon](https://gethuman.com/customer-service/Verizon)

AMP version (auto ads not working for Overlay formats like vignette)
[https://legacyweb.gethuman.com/customer-service/Verizon](https://legacyweb.gethuman.com/customer-service/Verizon)

### Relevant Logs

Here is an example of the config I get back from Adsense for the amp-auto-ads component:

```shell
{
"producerVersion": "20250709_104536",
"placements": [
{
"anchor": {
"selector": "DIV#lay-fl-right\u003eDIV",
"index": 0
},
"pos": 1,
"type": 1,
"style": {
"top_m": 10,
"bot_m": 32
}
},
{
"anchor": {
"selector": "DIV#lay-fl-right\u003e.min",
"index": 0
},
"pos": 1,
"type": 1,
"style": {
"top_m": 10,
"bot_m": 32
}
},
{
"anchor": {
"selector": "DIV#lay-fl-bottom",
"index": 0
},
"pos": 4,
"type": 1,
"style": {
"top_m": 10,
"bot_m": 48
}
}
],
"attributes": {
"data-tag-origin": "ampa",
"data-package": "8886251856"
},
"optInStatus": [
2,
1
],
"adConstraints": {
"initialMinSpacing": "600px",
"subsequentMinSpacing": [
{
"adCount": 6,
"spacing": "900px"
}
],
"maxAdCount": 8
},
"stickyAdAttributes": {
"data-no-fill": "true"
}
}
```

### Browser(s) Affected

Chrome

### OS(s) Affected

_No response_

### Device(s) Affected

_No response_

### AMP Version Affected

011905222334000

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the amp-auto-ads component using the stated Adsense configuration and compare the AMP and non-AMP pages. Inspect the Network inspector response, especially the returned placements and overlay formats. Done means determining whether the component or Adsense configuration prevents anchor, side-rail, and vignette overlays from appearing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.