Giter Club home page Giter Club logo

Comments (1)

mehigh avatar mehigh commented on May 8, 2024

By providing an feature for
https://github.com/GoogleChrome/web-vitals/
We would be able to gather RUM data immediately post-deployment in Google Analytics rather than wait 28 days for GSC data to refresh

This particular feature only as a dependency for Google Analytics, and due to the availability of buffering for performance observer entering https://www.chromestatus.com/feature/5118272741572608 the metrics before the monitoring code is run would also be made available, hence this can be delayed to run much later when the CPU is idling.
https://github.com/GoogleChromeLabs/web-vitals-report/blob/71b0879334798c732f460945ded5267cab5a36bf/src/js/analytics.js#L135

Events are sent to Google Analytics
There's console logging instead when gtag / analytics global is not present

Implementation
There is no negative consequence for monitoring to FCP/LCP (i.e. if we're loading the library on CPU idle).
Use requestidlecallback to send these only if support for this feature is present, even at the expense of not tracking some entries
Check for the gtag global to be defined, log to the console if gtag global is not available (useful for staging environments)
The script is loaded via type="module" so the extra JS doesn't get sent to browsers without support for PerformanceObserver.

from site-performance-tracker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.