You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Navigation Timing API is built-in to all major browsers (supported by 97% of users). This gives you all the data shown in the "timing" tab for network requests in the Chrome and Firefox devtools. Spec.
It gives you timestamps for when certain actions start and end (such as DNS lookup, connecting, request sent, server response received, DOM content loaded event, DOM load complete) which can be used to build a timeline of the page load, or log the duration of each event.
constperf=window.performance.getEntriesByType('navigation')[0];// Some examples of the data:// DNS lookup timeperf.domainLookupEnd-perf.domainLookupStart// TLS handshake timeperf.requestStart-perf.secureConnectionStart// TTFB (time to first byte)perf.responseStart-perf.requestStart// Response timeperf.responseEnd-perf.responseStart// Render time perf.domComplete-perf.domContentLoadedEventEnd
Seeing this data in Plausible and being able to slice it by the other metrics in Plausible would be very useful. For example, are some countries experiencing significantly longer load times? Are some browsers slower to render the page than others? Integrating it would barely increase the size of the JS library since no third-party code is needed - it's all in window.performance.
Note: The PerformanceTiming interface is deprecated. It's an older implementation accessible at window.performance.timing. window.performance.getEntriesByType('navigation') gives you the PerformanceNavigationTiming interface, which is not deprecated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The Navigation Timing API is built-in to all major browsers (supported by 97% of users). This gives you all the data shown in the "timing" tab for network requests in the Chrome and Firefox devtools. Spec.
It gives you timestamps for when certain actions start and end (such as DNS lookup, connecting, request sent, server response received, DOM content loaded event, DOM load complete) which can be used to build a timeline of the page load, or log the duration of each event.
Seeing this data in Plausible and being able to slice it by the other metrics in Plausible would be very useful. For example, are some countries experiencing significantly longer load times? Are some browsers slower to render the page than others? Integrating it would barely increase the size of the JS library since no third-party code is needed - it's all in
window.performance
.Note: The
PerformanceTiming
interface is deprecated. It's an older implementation accessible atwindow.performance.timing
.window.performance.getEntriesByType('navigation')
gives you thePerformanceNavigationTiming
interface, which is not deprecated.Beta Was this translation helpful? Give feedback.
All reactions