diff --git a/README.md b/README.md index 0e930b7..10ee936 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ > Web Vitals: Essential module for a healthy [Nuxt.js](https://github.com/nuxt/nuxt.js) -[Web Vitals](https://web.dev/vitals) is an initiative by Google to provide unified guidance for quality signals that are essential to delivering a great user experience on the web. +[Web Vitals](https://web.dev/vitals) is an initiative by Google to provide unified guidance for quality signals that are essential to delivering a great user experience on the web. +This module will gather those metrics on each page view, and send them to a provider using either [`Navigator.sendBeacon()`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon) or [`fetch()`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) ## Installation @@ -42,9 +43,9 @@ export default { ### Google Analytics -Create a GA property and get `trackingID` - +_Report WebVitals to GA_ +Create a GA property and get `trackingID` Either provide `GOOGLE_ANALYTICS_ID` environement variable or set inside `nuxt.config`: @@ -63,8 +64,27 @@ Behavior > Events > Overview > Event Category > Event Action ### Vercel Analytics +_Report WebVitals to Vercel_ + Works without configuration +### Basic logger + +_Report WebVitals to Console_ + +Output metrics to the console insead of sending them to a remote provider + +```js +{ + webVitals: { + provider: 'log', + debug: true, // debug enable metrics reporting on dev environments + disabled: false + } +} +``` + +:warning: this provider does not send WebVitals trough network, issues with navigator extensions can not be deteced with this method. ### License