Skip to content

undone-labs/nuxt-module-plausible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nuxt Module Plausible

A Plausible Analytics module for use with nuxt.js 2

Installation

npm i @agency-undone/nuxt-module-plausible --save

Usage

First, add the nuxt-plausible-module to the modules block of nuxt.config.js

export default {
  modules: [
    'nuxt-plausible-module'
  ],
}

Next, add a plausible section to nuxt.config.js

export default {
  plausible: {
    include: true
  }
}

Environment

The NODE_ENV environment variable toggles Plausible based on environment. Plausible will be loaded when "NODE_ENV" = "production".

NODE_ENV=production

When working in any other environment Plausible will only be loaded if localhost tracking is explicitly enabled in the nuxt.config

export default {
  plausible: {
    include: true,
    trackLocalhost: true
  }
}

About

A Nuxt 3 Plausible analytics module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published