Install Simple Analytics with VuePress edit

Run this command to install Simple Analytics for VuePress:

npm install vuepress-plugin-simple-analytics --save-dev

Add the plugin

Add the plugin to your plugins in .vuepress/config.js.

module.exports = {
  plugins: ["vuepress-plugin-simple-analytics"],
};

More features

We have more features like a custom domain to bypass ad-blockers, events, and allow the collect from DNT users. Events are enabled by default.

module.exports = {
  plugins: [
    [
      "vuepress-plugin-simple-analytics",
      {
        customDomain: "data.example.com", // You custom domain
        eventsGlobal: "sa", // The global events object for sa("click_button")
        skipDnt: true, // When set to true you track the DNT users
      },
    ],
  ],
};