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 will automatically report page view events when visiting and switching pages.

Besides, a global hmt array is available on the window object, and you can use it for custom events reporting.

Options

id

  • Type: string

  • Details: The ID of Baidu Analytics, which is the query of hm.js URL.

Edit this page on GitHub
Last Updated:: 4/12/25, 7:03 PM
Contributors: Mister-Hope, Zihan Hu
Next
google-analytics