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

Tracking scrolling using amp-analytics: add a selector #8403

Closed
javierparis opened this issue Mar 27, 2017 · 6 comments
Closed

Tracking scrolling using amp-analytics: add a selector #8403

javierparis opened this issue Mar 27, 2017 · 6 comments

Comments

@javierparis
Copy link

Description

Currently, the scroll event is based on the page dimensions. It would be very interesting to be able to track a subsection of the page, given a selector.
For instance, imagine an article (or a specific piece of information) in a page. And imagine that the article is what you most care regarding tracking the user scroll.
The article would start and end in a specific height within the page container. We could wrap that article and give it an id, and use a selector property in the analytics event, for tracking the scroll percentage based on that html element id.

@aghassemi
Copy link
Contributor

/to @dvoytenko
@zhouyx Is this at all related to what you have been working on recently for scoping analytics?

@zhouyx
Copy link
Contributor

zhouyx commented Apr 3, 2017

Scope does sounds like a possible solution to me in this case. @dvoytenko WDYT?

@aghassemi aghassemi removed their assignment Apr 3, 2017
@rudygalfi rudygalfi modified the milestones: Prioritized FRs, New FRs Apr 5, 2017
@dvoytenko
Copy link
Contributor

@javierparis Would this be solved by the visibility triggers? I.e. some sections in the doc will trigger visibility. That trigger is pretty robust with time conditions and percent visibility. And %/time of visibility would seem to be easier to normalize/understand vs scroll positions that are very sensitive to device size.

If that would work in principal, visibility has an issue that only AMP elements can be tracked. We can expand that to all other DOM elements. See #4449.

Otherwise, this is not about ads, is it? If so, I'm not sure how scoping would help here.

@rudygalfi
Copy link
Contributor

I think this could be solved by visibility triggers, but it also makes a great deal of sense as a spec attached to the scroll trigger. For instance, we could defined a scrollSpec that has a field called selector.

@dvoytenko dvoytenko assigned zhouyx and unassigned dvoytenko Jul 20, 2018
@zhouyx
Copy link
Contributor

zhouyx commented Jul 2, 2019

So this is not to track the scroll within one element, but the scroll of part of the document.
If we are going to track scroll of a certain area of the document, I agree that visibility trigger may be a better feature to use.
Closing the issue for now. Feel free to reopen if we still see the requirement. Thank you

@zhouyx zhouyx closed this as completed Jul 2, 2019
@tom-essp
Copy link

Hi, we were trying to add a selector to scroll percentage trigger to our content publishing website. We only want to measure this on the article part and not rest of the page. It would be really great if we can get that feature added

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

7 participants