ampproject / ampproject/amphtml

Duplicated ad calls generated by amp-ad tag

Open
#38,021 2 comments 0 reactions 0 assignees View on GitHub
Component: amp-ad P1: High Priority Type: Bug WG: monetization
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

### Description

We noticed that the [Smart Adserver extension](https://github.com/smart-adserver/amphtml/blob/main/extensions/amp-ad-network-smartadserver-impl/0.1/amp-ad-network-smartadserver-impl.js) now generates duplicated ad requests for any given ad placement.

There is a "document" request and an "XHR" request.

This critical issue impacts all our customers as the counting discrepancies between the ad network and the ad agencies are up to 50%. Some conflicts also appeared between the two ads on the same placement, which causes significant harm to the AMP version of the customer.

The issue is fixed by https://github.com/ampproject/amphtml/pull/38014 though I am not sure to understand why we had to specifically disable the usage of XHR request whereas other extensions seem not to have done that 🧐

### Reproduction Steps

Any AMP pages using the amp-ad tag from smartadserver (e.g: [this page](https://smartadserver.gitlab.io/pages/amp/banner/)) will generate 2 ad requests for 1 ad placement.

![image](https://user-images.githubusercontent.com/19735493/161922717-d7dbb676-70b1-4e84-b2ba-69cc41b35e16.png)

The tag is:
`
`

### Relevant Logs

```shell
No console errors or warnings are logged.
```

### Browser(s) Affected

Chrome, Firefox, Safari, Edge, UC Browser

### OS(s) Affected

_No response_

### Device(s) Affected

_No response_

### AMP Version Affected

2203172113000

Contributor guide

Open the contributing guide

Research direction

Start with extensions/amp-ad-network-smartadserver-impl/0.1/amp-ad-network-smartadserver-impl.js and review the referenced PR 38014, which reportedly fixes the duplicate requests. Reproduce the issue with the provided Smart Adserver AMP page and verify that one placement produces only one ad request without console errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.