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

Observe Intersection and nested AMP documents. #3265

Closed
JoelRegus opened this issue May 18, 2016 · 5 comments
Closed

Observe Intersection and nested AMP documents. #3265

JoelRegus opened this issue May 18, 2016 · 5 comments

Comments

@JoelRegus
Copy link
Contributor

If an amp-ad element exists within an AMP page that is served within an iframe, the data returned from observeIntersection will be relative to the iframe, not the parent document.

This makes sense, however it posses an issue when measuring viewability.

For example, the ad on this page is always going to be in view:

http://dfp-amp-testing-1185.appspot.com/amp_tests/dfp-image-layouts-fixed.html

Is there a way for the amp-ad element to know if it is being served within a nested AMP environment? This could help us decide if we should use the data returned from observeIntersection when making our viewability calculations.

@cramforce
Copy link
Member

Good point. As we formalize the viewer API we will need to require viewers to supply their own change records down to us. The current viewport implementations should, to some extend handle this already.

CC @dvoytenko

@dvoytenko
Copy link
Contributor

Right now we require AMP to be sized to the whole viewport (top = 0; left = 0; right = 0; bottom = 0) and provide offsets in the form of padding. This however, is purely the initial implementation choice and we will likely add more API to support more complicated cases.

@dvoytenko dvoytenko added this to the Backlog milestone May 23, 2016
@jasti
Copy link
Contributor

jasti commented Feb 10, 2017

@chenshay, is this something the viewer API already passes down to the document? Just trying to understand priority.

@jasti
Copy link
Contributor

jasti commented Jun 1, 2017

Ping @chenshay

@lannka
Copy link
Contributor

lannka commented Jul 2, 2019

we already supports a window.context API to track view-ability: https://github.com/ampproject/amphtml/blob/master/ads/README.md#ad-viewability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants