I2I A new story analytics macro based on meta tag #37423
Description
Summary
This proposal allows story to use in-ad meta tag for analytics purposes.
Design Document
Given an analytics configuration like below:
<amp-analytics>
<script type="application/json">
{
"transport": {"beacon": false, "xhrpost": false},
"requests": {
"visibility": "/${type}?id=METATAG_AD_amp4ads-id"
},
"triggers": {
"rootVisible": {
"on": "story-ad-click",
"request": "storyAds",
"extraUrlParams": { … }
}
}
}
</script>
</amp-analytics>
The following is an example of AMP4AD HTML (header only) returned as an ad response on an AMP page, which is to be rendered within an iframe.
<!doctype html>
<html ⚡4ads lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<style amp4ads-boilerplate>body{visibility:hidden}</style>
<meta name="amp4ads-id" content="vendor=doubleclick,type=impression-id,value=12345">
<script async src="https://cdn.ampproject.org/amp4ads-v0.js"></script>
When sending out the ping upon specific events, we would replace the METATAG_AD(tagname) macro to the corresponding meta tag value inside the corresponding ads iframe.
The triggering events are
- story-ad-view
- story-ad-swipe
- story-ad-click
- story-ad-exit
The following story events are excluded, as well as other non-story events:
- story-ad-discard
- story-ad-request
- story-ad-load
- story-ad-insert
- Special scenarios
If there are multiple meta tags with the same name
- The first matching meta tag prevails
If there are no matching meta tags
- Substitute with empty string
If the macro is used outside of these specified events
- Substitute with empty string
Motivation
Web story publishers wish to use information from within the AMPHTML story creatives to inform them of a page's performance and revenue analytics information. This proposal allows publishers to track in-creative meta tag by using a macro on the story page.
Alternative Solutions
We have considered:
- Using the ad response headers as a means to pass information
It is not being chosen because for 3p use cases, it would be much more difficult to implement.
Launch Tracker
No response
Notifications
/cc @ampproject/wg-approvers @ampproject/wg-monetization @ampproject/wg-stories