# Install the snippet

> For the complete documentation index, see [llms.txt](https://analytics.writechoice.io/docs/llms.txt).

One script tag, added once, on every page of your site - what it does, and how to check that it works.

The analytics come from one script tag on every page of your site. You add it once; the numbers start to appear in the portal within a minute of the first visit.

## Get your code

Open **Settings → Install** in the sidebar (or **Install** at the top of any Analytics tab). The code for your site is there, with your site key already filled in, for each platform.

![The Install page, with the HTML, Docusaurus and Mintlify tabs and the snippet](https://analytics.writechoice.io/docs/images/screens/install-light.webp)

Then follow the guide for your platform:

**[Plain HTML](https://analytics.writechoice.io/docs/install/html/)**

Any site where you can edit the page `<head>`.

**[Docusaurus](https://analytics.writechoice.io/docs/install/docusaurus/)**

The `scripts` list of `docusaurus.config.js`.

**[Mintlify](https://analytics.writechoice.io/docs/install/mintlify/)**

A small `.js` file in the docs folder.

**[WriteDocs](https://analytics.writechoice.io/docs/install/writedocs/)**

The `scripts` field of `writedocs.json`.

## What the script does

- Records a pageview when a page loads and on every in-app navigation, so single-page sites and docs platforms are counted correctly.
- Records the searches typed in WriteDocs, DocSearch and Mintlify search boxes, and custom events you define. See [Events, tags and search](https://analytics.writechoice.io/docs/install/events-and-tags/).
- Measures page speed (Core Web Vitals) on a sample of page loads, and records clicks and scrolling for the [heatmaps](https://analytics.writechoice.io/docs/analytics/heatmaps/) on a sample too.
- Uses **no cookies** and stores nothing that identifies a visitor. The visitor's IP address is used only to work out the country and is never stored. Visits are counted in 30-minute windows with a token kept in the page's memory only.
- Respects the reader's choice: nothing is measured in a browser with Global Privacy Control, after a reader opts out, or, if you ask for it, before your consent banner says yes. See [Consent and opt-out](https://analytics.writechoice.io/docs/install/consent/).
- Never breaks your page: if the script cannot load or the service is unreachable, nothing happens.

It loads with `defer` and doesn't block rendering.

Session replay and error tracking are off by default. **Recording and tracking**, at the bottom of the Install page, shows what's on for your site.

## Check that it works

**1. Open your published site**

In a browser, open a page of your site where you added the script (the published site, not a local copy).

**2. Watch the network**

Open the developer tools (F12), select the **Network** tab and reload the page. You should see two requests to `analytics.writechoice.io`: `/s/<your site key>.js` with status `200` (the script) and `/e` with status `200` (the pageview).

**3. See it in the portal**

Within about a minute, the visit appears in **Analytics → Overview**.

If the `/e` request is missing, see [Troubleshooting](https://analytics.writechoice.io/docs/install/troubleshooting/).