English
umami-analytics
Seamlessly integrate Umami Analytics—a privacy-focused, open-source web analytics solution—into your VuePress site.
Usage
npm i -D @vuepress/plugin-umami-analytics@nextimport { umamiAnalyticsPlugin } from '@vuepress/plugin-umami-analytics'
export default {
plugins: [
umamiAnalyticsPlugin({
// options
}),
],
}This plugin supports both Umami Cloud and Self-hosted instances.
Guide
Reporting Events
Out of the box, the plugin automatically captures page view events during initial visits and subsequent route changes.
For advanced tracking needs, the global umami object is exposed on the window instance. You can utilize this to trigger custom events programmatically via umami.track().
Options
idRequired
stringThe unique Website ID provided by your Umami dashboard.
link
stringDefault
'https://us.umami.is/script.js'The source URL of the Umami tracking script.
autoTrack
booleanDefault
trueWhether to track pageviews and events automatically.
Set this to false if you wish to disable automatic data collection and rely solely on manual tracking functions.
domains
string[]A list of allowed domains. Tracking will only occur when the site is accessed via these specific domains.
hostUrl
stringDefault
linkA custom endpoint for sending analytics data. If not specified, it defaults to the script location defined in link.
