VuePress EcosystemVuePress Ecosystem
  • Theme Guidelines
  • theme-default
  • Hope Theme
  • Plume Theme
  • Reco Theme
  • Feature Plugins
  • Markdown Plugins
  • Search Plugins
  • Blog Plugins
  • PWA Plugins
  • Analytics Plugins
  • SEO Plugins
  • Development Plugins
  • Tool Plugins
  • AI Plugins
  • @vuepress/helper
  • English
  • 简体中文
GitHub
  • Theme Guidelines
  • theme-default
  • Hope Theme
  • Plume Theme
  • Reco Theme
  • Feature Plugins
  • Markdown Plugins
  • Search Plugins
  • Blog Plugins
  • PWA Plugins
  • Analytics Plugins
  • SEO Plugins
  • Development Plugins
  • Tool Plugins
  • AI Plugins
  • @vuepress/helper
  • English
  • 简体中文
GitHub
  • baidu-analytics
  • google-analytics
  • umami-analytics

baidu-analytics

@vuepress/plugin-baidu-analytics

Integrate Baidu Analytics into VuePress.

Tips

Do not enable SPA mode in Baidu Analytics. The plugin will report page view events correctly.

Usage

npm i -D @vuepress/plugin-baidu-analytics@next
.vuepress/config.ts
import { baiduAnalyticsPlugin } from '@vuepress/plugin-baidu-analytics'

export default {
  plugins: [
    baiduAnalyticsPlugin({
      // options
    }),
  ],
}

Reporting Events

The plugin automatically reports page view events on page visits and route changes.

A global _hmt array is available on the window object for custom event reporting.

Options

id

  • Type: string
  • Required: Yes
  • Details: Baidu Analytics tracking ID, which is the query parameter in the hm.js URL.
Edit this page on GitHub
Last Updated:: 6/2/25, 4:28 PM
Contributors: Mister-Hope, Zihan Hu
Next
google-analytics