vuepress-plugin-umami-analytics v1.15.0
vuepress-plugin-umami-analytics
VuePress v2 plugin for injecting Umami analytics script into your app code. Umami is a self-hosted, privacy-friendly alternative to Google Analytics.
Installation
npm install --save vuepress-plugin-umami-analyticsUsage
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 */
})
: [],
],
}Options
For more details on the configuration of the tracker, see the official documentation.
id
Type:
stringRequired:
trueDetails:
Add website to Umami analytics and get parameters from tracking code. Put data-website-id here.
src
Type:
stringRequired:
trueDetails:
Link to Umami analytics script.
hostUrl
Type:
stringRequired:
falseDefault value:
nullDetails:
Send data to this host instead of the one where the script is located.
autoTrack
Type:
booleanRequired:
falseDefault value:
trueDetails:
Set to false to disable tracking all pageviews and events.
doNotTrack
Type:
booleanRequired:
falseDefault value:
falseDetails:
Whether to respect the browser's Do Not Track setting.
cache
Type:
booleanRequired:
falseDefault value:
falseDetails:
Whether to cache some data to improve performance. Be careful, it will use session storage, you may have to inform your users.
domains
Type:
string[]Required:
falseDefault value:
nullDetails:
Only run the tracker on the domains specified. With a
nullvalue, tracker is active everywhere.

Contribution
Pull requests are welcome.