Skip to content

Install on Bolt

Bolt scaffolds Vite projects: paste the tag into index.html, or the root layout for a Next.js app.

Bolt usually scaffolds a Vite project with a single HTML shell, and that file is where the tag goes. Because the shell is shared by every route, one paste covers the whole app.

Where it goes

Open index.html in the file tree and paste the tag inside <head>. If Bolt generated a Next.js app instead, follow Install on Next.js and use the root layout.

index.html
<head>
  <meta charset="UTF-8" />
  <title>Your startup</title>
  <script defer data-website-id="ws_XXXXXXXX" data-domain="yourstartup.com" src="https://statsy.co/js/script.js"></script>
</head>

You can also ask Bolt in the prompt box to add the tag to the head of index.html, exactly as written.

Confirm it works

Deploy to your own domain and open it, then check Live. Route changes in the app are counted automatically, because the script watches the History API. See Single-page apps and route changes.

The in-editor preview does not report

Bolt’s preview runs on its own sandbox host, and beacons from a host that is not your domain are dropped. That is convenient: you can build all day without polluting your numbers. Measurement starts when you deploy to the domain in data-domain.

Last updated · Markdown version