Skip to content

ZhongxuYang/vitepress-plugin-google-analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vitepress-plugin-google-analytics

Google analytics plugin for Vitepress

vitepress-plugin-google-analytics logo

Downloads Version License

Install

yarn add -D vitepress-plugin-google-analytics
# OR npm install -D vitepress-plugin-google-analytics

Usage

// .vitepress/theme/index.ts

import 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! 🎉

About

google-analytics plugin for vitepress

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published