ampproject / ampproject/amphtml
Analytics ad-render-start/ad-render-end doesn't trigger inside amp-next-page
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
## What's the issue?
Seems like ads inisde and amp-next-page are not propagating the events to the top analytics tags.
## How do we reproduce the issue?
I have a amp page with two ads and a amp-next-page with two additional ads: https://output.jsbin.com/bezoxun. If you look in the network there are two calls to 'https://amp.dev/documentation/examples/components/amp-analytics/ping?' that it's what the tracking I'm doing to count ad-rendered:
```json
{
"requests": {
"event": "https://amp.dev/documentation/examples/components/amp-analytics/ping?user=2e0194f8-8b5d-4fea-9354-1fa085c78518&account=ampdev&event=${eventId}&n=${n}"
},
"triggers": {
"renderStart": {
"on": "ad-render-end",
"request": "event",
"vars": {
"eventId": "pageview",
"n": "${timestamp}"
}
}
}
}
```
The problem is that the two additoinal adds inside the amp-next-page are not triggering the request when they should. We should have 4 requests in the network tab for 'ping'
## What browsers are affected?
All browsers
## Which AMP version is affected?
I guess all AMP versions.
Contributor guide
Research direction
Start with the provided JSBin reproduction and inspect the amp-next-page and amp-analytics paths involved in propagating ad-render-end events. Compare the two ads on the main page with the two inside amp-next-page, then verify the fix by confirming that four ping requests appear in the network tab.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100