# Install the script

> Paste one script tag into the head of your site, check it is sending, and learn which attributes change what the script records.

Section: Get started  
Canonical page: https://statsy.co/docs/getting-started/install  
Last updated: 2026-09-15

Statsy is one tag. It is about 3 KB gzipped, loads with `defer`, and sends events in the background, so it never blocks a paint. Paste it inside `<head>` on every page of your site.

```html
<script defer data-website-id="ws_XXXXXXXX" data-domain="yourstartup.com" src="https://statsy.co/js/script.js"></script>
```

The install screen in the app shows this tag with your own site key already filled in. Copy it from there rather than from this page, and do not add the tag twice.

## The two attributes that matter

| Attribute | What it does |
| --- | --- |
| `data-website-id` | Your site key. It starts with `ws_` and is public. Required. |
| `data-domain` | Your main domain. Links to any other host are then counted as outbound clicks. Defaults to the current host. |

There are more attributes for scroll tracking, download tracking, hash routing, cross-domain cookies and a proxy origin. They are listed in the [install guides](https://statsy.co/docs/install).

## Check that it works

1. Deploy, then open your own siteLoad any page on the site in a normal browser tab. One pageview is enough.
2. Watch the install screen turn greenIt confirms the first pageview live, so you do not have to guess whether the tag is in the right place.
3. Open Live**Live** shows visitors from the last 30 minutes on a globe. Click through a few pages of your site and watch yourself move. If some pages show up and others do not, the tag is missing from those templates.

> **Watch out.** An ad blocker in your own browser can hide your test visit. Try a private window, or serve the script from your own subdomain with the proxy hostname setting so it is first-party.

## Guides for your platform

Where the tag goes depends on how your site is built. There is a short guide for each one: [Next.js](https://statsy.co/docs/install/nextjs), [WordPress](https://statsy.co/docs/install/wordpress), [Shopify](https://statsy.co/docs/install/shopify), and the rest under [Install](https://statsy.co/docs/install), including plain HTML, Webflow, Framer and Google Tag Manager.

Single-page apps need nothing extra: navigation through `pushState`, `replaceState` and the back button is tracked automatically. Hash-based routers opt in with `data-hash-routing="true"`.

Once pageviews are arriving, the next step is to tell Statsy what counts as a win on your site. See [Track goals](https://statsy.co/docs/getting-started/goals).

Previous: [Get started in 4 steps](https://statsy.co/docs/getting-started)  
Next: [Track goals](https://statsy.co/docs/getting-started/goals)