Miss any of our Open RFC calls?Watch the recordings here! »

nuxt-vitals

1.1.0 • Public • Published

nuxt-vitals

Web Vitals: Essential module for a healthy Nuxt.js

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.

Installation

npm install --save-dev nuxt-vitals # or yarn add --dev nuxt-vitals 

Setup

Add nuxt-vitals to buildModules section of nuxt.config.js

export default {
  buildModules: [
    ['nuxt-vitals', { 
      // Tracking ID (required) { string }
      // Replace UA-XXXXXXXX-X by your Google Analytics tracking ID.
      trackingID: 'UA-XXXXXXXX-X',
      // Event Category (optional) { string }, default 'Web Vitals'
      eventCategory: 'Some Category',
      // Debug (optional) { number } default 0 
      debug: 1,
      disabled: false
    }]
  ]
}

⚠️ If you are using Nuxt < v2.9 you have to install the module as a dependency (No --save-dev or --dev flags) and use modules section in nuxt.config.js instead of buildModules.

Google Analitycs Event Measurement

Behavior > Events > Overview > Event Category > Event Action

Events Actions

License

MIT

Install

npm i nuxt-vitals

DownloadsWeekly Downloads

150

Version

1.1.0

License

MIT

Unpacked Size

5.76 kB

Total Files

5

Last publish

Collaborators

  • avatar