@vuepress/plugin-google-analytics

Google analytics plugin

Install

  1. yarn add -D @vuepress/plugin-google-analytics
  2. # OR npm install -D @vuepress/plugin-google-analytics

WARNING

We currently recommend using Yarngoogle-analytics - 图1 instead of npm to install all dependencies if you are using Google Analytics Plugin, because npm fails to generate the correct dependency tree in this case.

Usage

  1. module.exports = {
  2. plugins: [
  3. [
  4. '@vuepress/google-analytics',
  5. {
  6. 'ga': '' // UA-00000000-0
  7. }
  8. ]
  9. ]
  10. }

TIP

Please be aware of GDPR (2018 reform of EU data protection rules)google-analytics - 图2 as IPs are anonymized automatically.

Options

ga

  • Type: string
  • Default: undefined

Provide the Google Analytics ID to enable integration.