-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 calculates wrong scroll triggers for embedded shadow documents #18735
Milestone
Comments
/to @zhouyx |
Setting as P2 since |
The analytics team, ( @lannka @zhouyx @calebcordry ) and I decided that it would be good to re-think how we are doing scroll events, and decide what would be the expected behavior on this before we start implementing a solution. |
16 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's the issue?
amp-analytics ScrollManager calculates scroll positions for scroll triggers based on the viewport scrollHeight/scrollTop. For shadow documents (e.g. in amp-next-page) this means it calculates the current scroll percentage from the entire parent document, even if the shadow document is off screen.
Scroll position should be calculated from the shadow document's body height instead, otherwise you will get completely different analytics behaviour when a document is embedded, vs when used standalone.
The text was updated successfully, but these errors were encountered: