ampproject / ampproject/amphtml

Potential missed opportunity re. amp-analytics/amp-ad

Open
#32,919 2 comments 0 reactions 0 assignees View on GitHub
Stale WG: analytics WG: monetization
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

**summary**

While fixing a new bug I introduced in amp-analytics, I noticed a codepath which I'm curious about.
Specifically that all analytic events fired for a destroyed embed are bailed out on.

https://github.com/ampproject/amphtml/blob/01f115a81355ca87ee5dab69127a710f8afcdc72/extensions/amp-analytics/0.1/amp-analytics.js#L643-L651

My question for those who know more about `` and ``: are there any instances where we'd still want to send the analytics event even though the embed has since been removed? If so, we probably want to make this check more granular and be able to tune it on a per event basis. My sources say this occurs many many times per day :)

cc @calebcordry / @micajuine-ho

Contributor guide

Open the contributing guide

Research direction

Start with extensions/amp-analytics/0.1/amp-analytics.js at the linked lines and trace how destroyed amp-ad embeds cause analytics events to be bailed out. Determine whether any events should still be sent after removal; done requires a clear decision and, if warranted, defined per-event behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
analytics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.