-
Notifications
You must be signed in to change notification settings - Fork 418
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
CLS is not reporting often #78
Comments
How are you sending the data to your analytics server. And what analytics tool are you using? |
We POST events using a custom tool. This tool has been in production for a long time and we consider it stable. For example, we also send an event for page load time after the onload event is triggered and that reports for ~97% of page views. Some of the missing 3% is probably due to bounces or users leaving pages before the onload event is triggered, and possibly issues with some insignificant browsers/webviews. But I think that's a good example of the stability in our event tracking system. Do you have some advice for how/when we should be POST'ing the CWV metrics? |
Are you using The In the case of Web Vitals, since CLS is tracked during the entire page lifecycle, it invokes its callbacks in the |
Thanks for the help @philipwalton! It appears that our tracking library is using One last question for you and anyone else that's listening, which might help us better understand what we should work toward: In your experience using other analytics libraries, do you know the percentage of page views that CLS and FID typically report on? |
I wouldn't necessarily expect the number of pageviews to always line up exactly with the number of CLS beacons received. Here are a few things that could account for the difference.
As for what results you can expect to see in the real world? I can only speak for myself. I use this library to measure Web Vitals on my personal website and here's how my numbers break down, when comparing the counts for each metric to the number of recorded page loads:
Note that I would expect CLS to be recorded at higher rates than LCP and FID since both of those metrics will not report for pages loaded in the background. CLS, though, in theory should always have a value, and I agree that an 18% miss rate (what I see on my site) is less than ideal. |
Thank you, that's very helpful. It looks like our FID and LCP mostly match, so I'm not too concerned there. I'll look deeper into how our analytics tool is forwarding CLS. |
A follow-up for the folks that may uncover this later. We did manage to improve how our analytics is sending beacons when the page is unloading and we're seeing much better reporting for CLS. Here's our current reporting numbers for page views which seem fairly in line with Philip's:
Thanks again, Philip. |
First: I'd like to thank you all for the time you put into this library!
I have a small issue with how often CLS is reporting:
On a highly trafficked site that I'm working on, we found that CLS is captured very infrequently in our analytics. In fact, only ~31% of pageviews on Chrome report a CLS metric; whereas FID is captured on ~43% (not great either) and LCP is captured on ~80% of page views.
It sounds like the implementation waits for visibility to be hidden before reporting. Is it possible that a lot of page loads are not triggering the hidden event before navigation to a new page? Any other ideas?
The text was updated successfully, but these errors were encountered: