Skip to content

Commit

Permalink
docs: Add log provider to README.md (#36)
Browse files Browse the repository at this point in the history
* Add `log` provider to README.md

Getting to know that this module can only be used to preview those metrics in development environment can involve people to use this great module.

I also added a small note about what this module does (related to #34)

* chore: add warning about using log provider
  • Loading branch information
stafyniaksacha authored Nov 8, 2021
1 parent 4c31d7d commit e019d1e
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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`:

Expand All @@ -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

Expand Down

0 comments on commit e019d1e

Please sign in to comment.