https://github.com/drylikov/gatsby_plugin_web_vitals
Web 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.
https://github.com/drylikov/gatsby_plugin_web_vitals
Last synced: 9 days ago
JSON representation
Web 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.
- Host: GitHub
- URL: https://github.com/drylikov/gatsby_plugin_web_vitals
- Owner: drylikov
- License: mit
- Created: 2024-06-13T21:29:24.000Z (10 months ago)
- Default Branch: drylikov
- Last Pushed: 2024-06-13T21:31:20.000Z (10 months ago)
- Last Synced: 2025-03-27T14:07:20.366Z (27 days ago)
- Language: JavaScript
- Size: 33.2 KB
- Stars: 3
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gatsby_plugin_web_vitals
> [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 plugin sends Web Vitals metrics to Google Analytics.
## Install
`npm i gatsby-plugin-web-vitals`
or
`yarn add gatsby-plugin-web-vitals`
## Usage
```js
// gatsby-config.js
{
resolve: 'gatsby-plugin-web-vitals',
options: {
// The Google Analytics property ID; the reporting code won't be generated without it
trackingId: 'YOUR_GOOGLE_ANALYTICS_TRACKING_ID',
// An array with metrics you want to track and send to analytics
metrics: [`FID`, `TTFB`, `LCP`, `CLS`, `FCP`],
// Event Category (optional) { string }, default 'Web Vitals'
eventCategory: 'Performance',
// Include Web Vitals tracking in development
// Defaults to false meaning Vitals will only be tracked in production.
includeInDevelopment: false,
// Prints metrics in the console when true
debug: false,
}
}
```---
Plugin based on [`nuxt-vitals`](https://github.com/daliborgogic/nuxt-vitals).