# Install on Docusaurus

> List the tag in the scripts array of docusaurus.config.js and it is added to every documentation page.

Section: Installation guides  
Canonical page: https://statsy.co/docs/install/docusaurus  
Last updated: 2026-09-15

Docusaurus can inject third-party scripts from its config, so no theme swizzling is needed.

## Where it goes

Add an entry to the `scripts` array in `docusaurus.config.js`. Extra keys become attributes on the rendered tag.

```js
module.exports = {
  scripts: [
    {
      src: 'https://statsy.co/js/script.js',
      defer: true,
      'data-website-id': 'ws_XXXXXXXX',
      'data-domain': 'docs.yourstartup.com',
    },
  ],
};
```

Set `data-domain` to the host the docs are actually served from. Beacons are accepted from your site’s domain and its subdomains, so a docs site on `docs.yourstartup.com` can report into the same Statsy site as `yourstartup.com`.

## Confirm it works

Build and deploy, then open the docs and check **Live**. Click through to another page: Docusaurus routes on the client with the History API, so each page is counted.

## One Statsy site, or two

You can measure docs in the same site as your marketing pages, or create a separate site for them. Same site means one set of totals and a **Pages** report that mixes both; separate sites keep the reports clean but split visitor counts. See [Subdomains and multiple domains](https://statsy.co/docs/tracking-script/subdomains-and-cross-domain) before you choose.

Previous: [Install on Hugo](https://statsy.co/docs/install/hugo)  
Next: [How revenue attribution works](https://statsy.co/docs/revenue)