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

🐛 amp-analytics: allow intersectionRatio to be used on :root #19280

Merged
merged 2 commits into from Nov 14, 2018

Conversation

jeffkaufman
Copy link
Contributor

@jeffkaufman jeffkaufman commented Nov 13, 2018

Currently, ${intersectionRatio} expands to "" when applied to :root. This is a problem for supporting GPT with AMP Inabox because we watch :root and need to support publishers subscribing to changes in slot visibility. [1] Expand support to include :root.

[1] https://developers.google.com/doubleclick-gpt/reference#googletag.events.slotVisibilityChangedEvent

Currently, ${intersectionRatio} expands to "" when applied to :root.  This is a
problem for supporting GPT with AMP Inabox because we watch :root and need to
support publishers subscribing to changes in slot visibility. [1]  Expand
support to include :root.

[1] https://developers.google.com/doubleclick-gpt/reference#googletag.events.slotVisibilityChangedEvent
@@ -363,6 +363,7 @@ export class VisibilityManager {

} else {
state['opacity'] = this.getRootMinOpacity();
state['intersectionRatio'] = this.getRootVisibility();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question I have is that interesectionRatio doesn't make much sense for root other than inabox use case. And if we also need to update the document?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree intersectionRatio doesn't make much sense for root outside the Inabox case, but I think it's not a problem to support it?

By "And if we also need to update the document?" did you mean the documentation? I just added that: 9f286fc

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha totally meant documentation! LTGM, Thanks!

@zhouyx zhouyx merged commit c1251c0 into ampproject:master Nov 14, 2018
Enriqe pushed a commit to Enriqe/amphtml that referenced this pull request Nov 28, 2018
…ect#19280)

* amp-analytics: allow intersectionRatio to be used on :root

Currently, ${intersectionRatio} expands to "" when applied to :root.  This is a
problem for supporting GPT with AMP Inabox because we watch :root and need to
support publishers subscribing to changes in slot visibility. [1]  Expand
support to include :root.

[1] https://developers.google.com/doubleclick-gpt/reference#googletag.events.slotVisibilityChangedEvent

* update docs to not be element specific
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants