Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ZhongxuYang/vitepress-plugin-google-analytics
google-analytics plugin for vitepress
https://github.com/ZhongxuYang/vitepress-plugin-google-analytics
google-analytics vitepress-plugin
Last synced: about 2 months ago
JSON representation
google-analytics plugin for vitepress
- Host: GitHub
- URL: https://github.com/ZhongxuYang/vitepress-plugin-google-analytics
- Owner: ZhongxuYang
- Created: 2022-09-25T16:09:27.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-15T01:03:52.000Z (about 2 years ago)
- Last Synced: 2024-10-16T23:15:43.081Z (about 2 months ago)
- Topics: google-analytics, vitepress-plugin
- Language: TypeScript
- Homepage:
- Size: 41 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-vitepress-v1 - Google Analytics - Google Analytics Plugin for VitePress (:electric_plug: Plugins / Community Plugins)
README
# vitepress-plugin-google-analytics
> Google analytics plugin for Vitepress
## Install
```sh
yarn add -D vitepress-plugin-google-analytics
# OR npm install -D vitepress-plugin-google-analytics
```## Usage
```ts
// .vitepress/theme/index.tsimport DefaultTheme from "vitepress/theme"
import googleAnalytics from 'vitepress-plugin-google-analytics'export default {
...DefaultTheme,
enhanceApp: (ctx) => {
googleAnalytics({
id: 'G-******', // Replace with your GoogleAnalytics ID, which should start with the 'G-'
})
}
}
```Then you can use `Google analytics` in `production`! 🎉