performance-audit-plugin icon indicating copy to clipboard operation
performance-audit-plugin copied to clipboard

Support GoogleChrome/web-vitals

Open mpodorov opened this issue 3 years ago • 5 comments

https://github.com/GoogleChrome/web-vitals script can calculate CLS, FID, LCP for site pages and send the data to Google Analytics.

It would be great to extend this plugin to allow it to receive the same data and show the statistics (Lighthouse-less mode of operation).

mpodorov avatar Oct 01 '21 13:10 mpodorov

Thanks for your suggestion @mpodorov, I took a look on it and this functionality is offered already by Matomo's premium plugin SEO Web Vitals. Not sure if changing this performance audit plugin to cover such metrics from the frontend would violate Matomo's marketplace terms?

DevDavido avatar Oct 02 '21 11:10 DevDavido

SEO Web Vitals plugin does almost the same as your plugin (runs Lighthouse), but on Google side, not on own server, it can't get metrics directly from the analyzed site either.

mpodorov avatar Oct 02 '21 17:10 mpodorov

Ok, it wasn't clear to me that the SEO Web Vitals plugin gets its metric data from Google. In this case I really support the idea to refactor this plugin and report the web vital metrics from the frontend instead of running audits in the backend. Each page could have a distribution of the measured web vital metrics then. The Js Tracker Custom plugin could be used to extend the tracking code of Matomo by this plugin. Is anybody willing to participate in this large plugin refactoring?

DevDavido avatar Oct 03 '21 15:10 DevDavido

@findus23 Would it be ok for Matomo to offer such an (refactored) plugin?

DevDavido avatar Oct 03 '21 15:10 DevDavido

@DevDavido We're not planning to offer such a refactored plugin where we track the data ourselves currently. That's because for many/most users this would result in doubling the number of tracking requests causing a lot of extra load on servers for a feature that is likely not used as often.

Additionally, the script for web vitals would need to be loaded first before anything else and before any content is loaded. This can slow down sites and the feature would not work out of the box easily and be tricky to install.

These are the main two reasons we're not planning on developing it.

tsteur avatar Oct 03 '21 18:10 tsteur