-
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
Allow amp-analytics visibilitySpec to tracking elements other than amp-* #4449
Comments
iirc, we decided that using a dummy element at the end of featured article is okay. Lets keep this open though to collect more usecases. |
We have this use case in eBay AMP pages. We have lot of modules (Top Selling, Top Deals, Sponsored Listings, Guides, Collections etc. ) in the page and most of them are below the fold. Currently they are all HTML We want a similar tracking mechanism for AMP pages too. It is possible currently but restricted to AMP custom elements. We do not want to replace the <amp-embed id="topdeals" width=0 height=0 layout="nodisplay"></amp-embed> at the end of each module and pass this selector |
@senthilp No, we certainly do not want to create fake elements for this purpose and quite contrary we'd really like to expand all intersection observer polyfills to non-AMP elements. It'd take a bit of doing, however. I'll confirm the plans to support this and will chime back in here. /cc @jridgewell @aghassemi - this is very similar to the conversation we had about measurement/layout layers and extending support to non-AMP elements. |
/cc @jridgewell, @cramforce As we are proceeding with underlying tech implementation, it'd be good to confirm visibility vs state question. Should we report an element's visibility regardless its "loaded" state? Consider this example:
And let's assume we added 50% visibility reporting to both So, what do we believe are the right rules here? |
I think it's wrong to claim visibility when it's still not loaded. I would, however, entertain the idea that the loading of any subcomponent of an element that's being tracked for visibility is sufficient to say it's visible. This is also true at the page level with the |
@rudygalfi And what about the example I give? Are we ok with the possibility that, while |
Should we be waiting for all children to "load" before reporting visibility on |
@jridgewell - yes, this is certainly one possible interpretation as well. |
Can we enumerate the elements that we could give a loading signal for? Presumably it includes amp-img, amp-ad, amp-iframe. Are there any non AMP elements this applies to? I think it could make sense to call out a certain set of elements that have a loaded requirement before they will report visibility. (Usually visibility analytics hinges on the object actually being visible; otherwise it's worthless.) We could then document which elements this is true for and the rest are essentially based on layout visibility. If you choose to track on a "weak visibility" tag like |
@rudygalfi Your interpretation, I think, makes the most sense. Generally, each AMP element produces its own loaded signal. |
@dvoytenko Does this mean in the visibilitySpec config we would have a flag like |
Does it make sense for those elements that have loaded signal to |
@dvoytenko ah, never mind. I think we're already doing this, hiding unloaded resources and showing a placeholder, which doesn't solve the problem. |
Duplicate of #20609 |
The current amp-analytics visibilitySpec implementation requires elements to be AMP custom elements like amp-img or amp-youtube. For use cases like tracking a feature block on the page (e.g. related articles section), this is insufficient and may inspire hacky beahviors like (mis)using amp elements as visibility trackers.
The proposal to figure out some way to extend the visibilitySpec to non-amp-* elements while keeping perf sane.
cc @avimehta
(This was discussed in #1297.)
The text was updated successfully, but these errors were encountered: