# Docusaurus web analytics installation - Docs

1.  1

    ## Install the plugin

    Required

    Docusaurus is a popular static site generator for documentation. You can add PostHog using the official plugin:

    Terminal

    PostHog AI

    ```bash
    npm install --save posthog-docusaurus
    ```

2.  2

    ## Configure the plugin

    Required

    Add the plugin to your `docusaurus.config.js`:

    docusaurus.config.js

    PostHog AI

    ```javascript
    module.exports = {
      plugins: [
        [
          'posthog-docusaurus',
          {
            apiKey: '<ph_project_token>',
            appUrl: 'https://us.i.posthog.com',
            enableInDevelopment: false,
          },
        ],
      ],
    }
    ```

    **More options**

    See the [Docusaurus integration docs](/docs/libraries/docusaurus.md) for more configuration options.

3.  3

    ## Send events

    Recommended

    Start your Docusaurus site and visit a few pages. PostHog will automatically capture pageviews and other events.

    Click around and view a couple pages to generate some events. PostHog automatically captures pageviews, clicks, and other interactions for you.

    If you'd like, you can also manually capture custom events:

    JavaScript

    PostHog AI

    ```javascript
    posthog.capture('my_custom_event', { property: 'value' })
    ```

4.  4

    ## Next steps

    Recommended

    After installing PostHog and ensuring [autocapture](/docs/data/autocapture.md) is enabled, head to your [web analytics dashboard](/docs/web-analytics/dashboard.md) to see your data. And then check out our [getting started](/docs/web-analytics/getting-started.md) guide.

    > **PostHog tip:** Web analytics works with [anonymous events](/docs/data/anonymous-vs-identified-events.md). This means if you are primarily using PostHog for web analytics, it can be significantly cheaper for you.

### Community questions

Ask a question

### Was this page useful?

HelpfulCould be better