ampproject / ampproject/amp.dev
Document approaches for video analytics
- Dominant language
- HTML
- Stars
- 600
- Forks
- 675
- PR merge metrics
- No merged PRs in 30d
Description
There's several ways to go about collecting analytics for video in AMP, depending on how the video experience is implemented. This is a sketch of how to document this for a tutorial or guide page.
--------
- basically replaces the HTML5 video player in the browser (). No iframes required. We have recently launched a way for video data to be collected by AMP and passed along through . You can read more about how to configure it here: https://github.com/ampproject/amphtml/blob/master/extensions/amp-analytics/amp-video-analytics.md#video-analytics-triggers.
- AMP supports several video player extensions, e.g. . For a subset of these ([full list here](https://github.com/ampproject/amphtml/blob/master/extensions/amp-analytics/amp-video-analytics.md#support)), the above-mentioned video analytics features can be used, just like for the basic . (The reason they can do this is because those extensions also implement the video interface that's necessary to pass the interactions and events happening within the video player to amp-analytics.) To implement, it's simply required to specify the appropriate `selector` in the config.
- For video player extensions in AMP that don't support the video interface, there's no means of collecting analytics data for these players via the AMP page. However, many of these video player vendors do offer analytics via their platforms that publishers could look into. One gap, however, is that you wouldn't be able to answer questions like: "At what point did this video player become >50% visible on the screen?" The reason is because this requires AMP side reporting.
- Finally, can be used to present videos since arbitrary JS can run inside of them. If this is happening, then whoever has implemented the iframe's src can also implement the analytics collection there as well. However, just as with the above case, it can't talk to AMP, so reporting on things that only AMP knows (like visibility of the iframe) isn't possible.
Contributor guide
Assessment
This issue has not been assessed yet.