https://github.com/azat-io/vuepress-plugin-umami-analytics
📗 VuePress v2 plugin for injecting Umami analytics script into your app code
https://github.com/azat-io/vuepress-plugin-umami-analytics
umami umami-analytics vuepress vuepress-plugin
Last synced: 10 days ago
JSON representation
📗 VuePress v2 plugin for injecting Umami analytics script into your app code
- Host: GitHub
- URL: https://github.com/azat-io/vuepress-plugin-umami-analytics
- Owner: azat-io
- License: mit
- Created: 2023-03-02T08:31:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-17T05:47:36.000Z (2 months ago)
- Last Synced: 2025-04-17T18:36:03.556Z (2 months ago)
- Topics: umami, umami-analytics, vuepress, vuepress-plugin
- Language: TypeScript
- Homepage:
- Size: 479 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- License: license
Awesome Lists containing this project
README
# vuepress-plugin-umami-analytics
[](https://npmjs.com/package/vuepress-plugin-umami-analytics)
[](https://npmjs.com/package/vuepress-plugin-umami-analytics)
[](https://github.com/azat-io/eslint-plugin-de-morgan/blob/main/license.md)VuePress v2 plugin for injecting [Umami](https://umami.is) analytics script into your app code. Umami is a self-hosted, privacy-friendly alternative to Google Analytics.
## Installation
```sh
npm install --save vuepress-plugin-umami-analytics
```## Usage
Add plugin to your VuePress config:
```js
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](https://umami.is/docs/tracker-configuration).
### id
- Type: `string`
- Required: `true`
- Details:
Add website to Umami analytics and get parameters from tracking code. Put data-website-id here.
### src
- Type: `string`
- Required: `true`
- Details:
Link to Umami analytics script.
### hostUrl
- Type: `string`
- Required: `false`
- Default value: `null`
- Details:
Send data to this host instead of the one where the script is located.
### autoTrack
- Type: `boolean`
- Required: `false`
- Default value: `true`
- Details:
Set to false to disable tracking all pageviews and events.
### doNotTrack
- Type: `boolean`
- Required: `false`
- Default value: `false`
- Details:
Whether to respect the browser's Do Not Track setting.
### cache
- 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.
### domains
- Type: `string[]`
- Required: `false`
- Default value: `null`
- Details:
Only run the tracker on the domains specified. With a `null` value, tracker is active everywhere.

## Contribution
Pull requests are welcome.