docusaurus/website/docs/api/plugins/plugin-google-analytics.md
Sébastien Lorber 8f47babb46
docs(v2): Docs refactoring and reorganization (#3831)
* stable refactor of plugins api documentation

* plugins sidebar not collapsed by default as small?

* theme docs reorg

* Refactor migration guide doc

* fix broken link
2020-11-30 14:07:08 +01:00

831 B

id title slug
plugin-google-analytics 📦 plugin-google-analytics /api/plugins/@docusaurus/plugin-google-analytics

The default Google Analytics plugin. It is a JavaScript library for measuring how users interact with your website.

Installation

npm install --save @docusaurus/plugin-google-analytics

:::tip

If you have installed @docusaurus/preset-classic, you don't need to install it as a dependency.

:::

Configuration

module.exports = {
  plugins: ['@docusaurus/plugin-google-analytics'],
  themeConfig: {
    googleAnalytics: {
      trackingID: 'UA-141789564-1',
      // Optional fields.
      anonymizeIP: true, // Should IPs be anonymized?
    },
  },
};