Skip to content

Apply AMP analytics ad tracking events to an ad without requiring a selector #4018

@j-e-shaw

Description

@j-e-shaw

Currently, AMP analytics tags for ads require a selector (e.g. "selector": "#anim-id"). However, the amp-ad's id isn't necessarily known when the analytics tags are generated. Instead of requiring a selector, when the analytics events are added to the page as the result of an ad request, they should apply to the ad with which they are served.

Along with that, when shadow-DOM isn't supported, the analytics tags need to be hoisted from the ad response and placed in the main AMP page, not the iframe. Then, the AMP runtime can correctly track the viewability of the ad and fire the events.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions