# Install on Bolt

> Add Reveata to an app built with Bolt, by prompt or in the code editor.

Bolt usually builds web apps with Vite, which serve every page from the `index.html` at the root of the project. The snippet goes in its `<head>` once. If your Bolt project is a Next.js app, follow [Install on Next.js](https://reveata.com/docs/nextjs) instead; for Astro, [Install on Astro](https://reveata.com/docs/astro).

Copy the snippet from your Reveata dashboard (it contains your website’s tracking id):

```html
<script
  defer
  data-website-id="ws_your_tracking_id"
  src="https://reveata.com/js/script.js"
></script>
```

## Add it to your app

Either ask Bolt in the chat, for example:

> Add this script tag exactly as written to the `<head>` of the HTML file that every page of this app loads (`index.html` for a Vite app, the root layout for Next.js or Astro). Don’t bundle it, don’t change its attributes, and change nothing else: (paste the snippet)

Or open `index.html` in Bolt’s code view and paste the snippet before `</head>` yourself.

Then **Publish** again: the published app doesn’t change until you do. In Reveata, add the website with the address visitors use: your custom domain, or the `.bolt.host` address Bolt published the app to (or your Netlify address, if you publish there). Visits to other addresses, such as the preview inside Bolt, are not counted.

Page changes in the app go through the browser’s History API, which the script follows, so every page is counted. If the app’s routes come after a `#` (`/#/settings`), add `data-hash="true"` to the tag.

## Check it works

Open your published app in a private window, then check that the visit appears in your Reveata dashboard. If it doesn’t, follow [Verify your installation](https://reveata.com/docs/verify-your-installation). A quick check is to view the page source of the published app and search for `data-website-id`.

## Goals

Ask Bolt to add `data-reveata-goal="signup"` to your signup button, or to call `window.reveata?.('goal', 'signup')` after a successful signup. See [Custom goals](https://reveata.com/docs/custom-goals).

## Serve it from your own subdomain

With a custom domain, use the [managed proxy](https://reveata.com/docs/managed-proxy): add one DNS record (for example `stats.example.com`) and paste the new snippet Reveata gives you. If you publish to Netlify, you can also proxy with redirects: see [Netlify](https://reveata.com/docs/self-hosted-proxy#netlify).

## Revenue

Bolt’s Stripe integration uses your own Stripe secret key and writes the checkout as functions in your project (Bolt Database or Supabase edge functions), so Bolt can change them:

1. Connect the same Stripe account in Reveata under **Settings → Payments** ([restricted key](https://reveata.com/docs/stripe-restricted-key) or [Connect with Stripe](https://reveata.com/docs/stripe-connect)).
2. Paste the prompt from [Revenue in apps built with AI](https://reveata.com/docs/revenue-ai-builders) into the Bolt chat. It sends `window.reveata.metadata()` from the browser with the request that creates the checkout, and puts the visitor id in the checkout metadata on the server.

Other providers: [Connect a payment provider](https://reveata.com/docs/connect-a-payment-provider).

## Common pitfalls

- **Not republished.** The published app keeps the old code until you publish again.
- **Testing in the preview.** Bolt’s preview runs on another address; test the published app.
- **A bundled tag.** If the snippet is moved into a `.ts` file or imported, it loses its `data-website-id`. Keep the plain tag in `index.html`.
- **Hash routes.** If the app’s addresses look like `/#/settings`, add `data-hash="true"`.
