Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I2I A new story analytics macro based on meta tag #37423

Open
powerivq opened this issue Jan 19, 2022 · 1 comment
Open

I2I A new story analytics macro based on meta tag #37423

powerivq opened this issue Jan 19, 2022 · 1 comment
Labels
INTENT TO IMPLEMENT Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code Stale Inactive for one year or more

Comments

@powerivq
Copy link
Contributor

powerivq commented Jan 19, 2022

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

@powerivq powerivq added the INTENT TO IMPLEMENT Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code label Jan 19, 2022
@stale
Copy link

stale bot commented Jan 21, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Inactive for one year or more label Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
INTENT TO IMPLEMENT Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code Stale Inactive for one year or more
Projects
None yet
Development

No branches or pull requests

1 participant