VuePress v2 plugin for injecting Umami analytics script into your app code. Umami is a self-hosted, privacy-friendly alternative to Google Analytics.
npm install --save vuepress-plugin-umami-analytics
Add plugin to your VuePress config:
import { umamiAnalyticsPlugin } from 'vuepress-plugin-umami-analytics'
let isProd = process.env.NODE_ENV === 'production'
export default {
plugins: [
isProd
? umamiAnalyticsPlugin({
/* options */
})
: [],
],
}
For more details on the configuration of the tracker, see the official documentation.
-
Type:
string
-
Required:
true
-
Details:
Add website to Umami analytics and get parameters from tracking code. Put data-website-id here.
-
Type:
string
-
Required:
true
-
Details:
Link to Umami analytics script.
-
Type:
string
-
Required:
false
-
Default value:
null
-
Details:
Send data to this host instead of the one where the script is located.
-
Type:
boolean
-
Required:
false
-
Default value:
true
-
Details:
Set to false to disable tracking all pageviews and events.
-
Type:
boolean
-
Required:
false
-
Default value:
false
-
Details:
Whether to respect the browser's Do Not Track setting.
-
Type:
boolean
-
Required:
false
-
Default value:
false
-
Details:
Whether to cache some data to improve performance. Be careful, it will use session storage, you may have to inform your users.
-
Type:
string[]
-
Required:
false
-
Default value:
null
-
Details:
Only run the tracker on the domains specified. With a
null
value, tracker is active everywhere.
Pull requests are welcome.