# Install the tracking script in Astro

Add the snippet with is:inline to the layout every Astro page uses. Navigation with view transitions is tracked automatically.

Your snippet is in Settings → General of the website (the gear next to its name on the dashboard), with its id and domain filled in. The examples below use `YOUR_WEBSITE_ID` and `yourdomain.com`: replace them with yours.

Add the snippet to the layout every page uses. `is:inline` keeps Astro from bundling it, so the attributes stay as they are.

`src/layouts/Layout.astro`:

```astro
---
const { title } = Astro.props;
---
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>{title}</title>
    <script is:inline
      defer
      supr-website-id="YOUR_WEBSITE_ID"
      supr-domain="yourdomain.com"
      src="https://supranalytics.app/js/script.js"
    ></script>
  </head>
  <body><slot /></body>
</html>
```

With view transitions (`<ClientRouter />`), navigation uses `pushState` and is tracked automatically.

## Check it works

Open your website in a normal browser window, then the dashboard: the visit shows up within seconds, and the install card on a new website turns into the dashboard by itself. Nothing after a minute? See [Not seeing any data](https://supranalytics.app/docs/no-data.md).

---

This page on the web: https://supranalytics.app/docs/astro
Every documentation page: https://supranalytics.app/docs.md
