Add analytics and revenue tracking to your Bolt app

Bolt puts the app live at a bolt.host address. To see which channel sends visitors and which of them pay, add a tag to the page and a read-only key.

Updated Dec 4, 2026.

The short answer.

Paste the prompt below into the Bolt chat, or open Code view and put the Appsdash tag inside the page's <head> yourself: index.html at the project root in a Vite project, app/layout.tsx in a Next.js one. Click Publish or Update, open the live address once, and the visit counts. Connect the Stripe account behind Bolt's checkout with a restricted read-only key to see revenue per app.

The tag for Bolt.

Add your app to Appsdash first: its install step shows this tag with your own id in place of YOUR_SITE_ID.

index.html (Vite), inside <head>html
<script defer src="https://appsdash.co/v/s.js" data-site="YOUR_SITE_ID"></script>
app/layout.tsx (Next.js), inside <head>tsx
<script defer src="https://appsdash.co/v/s.js" data-site="YOUR_SITE_ID" />

Rather not touch the code? Paste this into the Bolt chat, with YOUR_SITE_ID replaced by your id:

Bolt chat
Add this analytics script tag to my app. In a Vite project it goes inside <head> in index.html; in a Next.js project inside <head> in app/layout.tsx, written as JSX. Keep it a plain <script> tag with these exact attributes (no npm package, no tag manager, no component that adds it later) and change nothing else.

<script defer src="https://appsdash.co/v/s.js" data-site="YOUR_SITE_ID"></script>

Where the tag goes in a Bolt project

The quickest way is the chat prompt: Bolt finds the right file for your project. To do it yourself, open Code view with the <> icon at the top of the screen. In a Vite project the head is index.html at the top of the Files list; in a Next.js project it is app/layout.tsx (src/app/layout.tsx with a src folder), where the tag takes the JSX form shown on this page.

Paste the tag inside <head>, then save with Cmd+S or Ctrl+S. In Safari or on a phone the files are read-only, so use the chat there.

Revenue from Bolt's Stripe integration

Bolt's Stripe integration runs on your own Stripe account: you click the project name, then Integrations, then Stripe, and add a secret key; Bolt writes the checkout code for you. Appsdash needs its own key, not that one. Settings > Revenue in Appsdash has a link that opens Stripe with the right Read permissions already ticked: create the key there and paste it back.

Appsdash then reads payments, subscriptions and refunds every 15 minutes and shows revenue, MRR and paying customers next to the visitors. One Stripe account can feed several apps, each counting only the products you pick for it.

For revenue per source, the Stripe checkout needs the visit id as its client_reference_id. Ask the Bolt chat to make that change, with the code lines on this page as the example.

Check that it works

Changes reach the live site only when you click Publish (the first time) or Update in the Publish menu; both are free, while asking the chat to publish spends tokens. Then open the live address, bolt.host or your own domain, once with any ad blocker off. The preview inside Bolt runs on another address, so it doesn't count.

The Appsdash install step says Counting when the first visit lands. Check installation, in the app's Settings in Appsdash, opens your home page and sends a test visit through the tag.

How to set it up.

14 days of everything, no card. Then from $29 a month for up to 5 apps, up to $99 for 50, every feature on each.

  1. Add the app. Type its live address. Appsdash gives you the tag with your site id filled in.
  2. Paste the prompt. Into the Bolt chat. Or, in Code view, paste the tag inside <head> of index.html or app/layout.tsx.
  3. Publish or Update. Use the Publish menu, then open the live address once. The install step turns to Counting.
  4. Connect Stripe. A restricted read-only key from the Stripe account behind the app, in Settings > Revenue.

Tie each sale to its visit.

Optional: revenue counts without it. With it, every sale shows the source, page and campaign of the visit that bought.

Stripe Checkout: Your checkout route (server)js
// browser: send the visit id with the request that makes the session
fetch("/api/checkout", { method: "POST", body: JSON.stringify({ priceId, visit: window.appsdash?.visit?.() ?? "" }) });

// server
const session = await stripe.checkout.sessions.create({
  mode: "subscription", // or "payment"
  line_items: [{ price: priceId, quantity: 1 }],
  client_reference_id: visit || undefined,
  success_url, cancel_url,
});

Already use client_reference_id? Put it in metadata: { appsdash_visit: visit } instead. The key needs Checkout Sessions read.

What it doesn't do.

  • The preview inside Bolt doesn't count: only the address you added and its subdomains do.
  • Some ad blockers stop analytics scripts, so a few visitors won't show.
  • Without the visit id on the checkout session, a sale still counts, but is matched to a visit only if exactly one person was on the site in the 30 minutes before it.

Questions.

Does editing the file cost Bolt tokens?

No. Editing in Code view doesn't use tokens, and neither do the Publish and Update buttons. Asking the chat to make the change does.

Can I reuse the Stripe key I gave Bolt?

Better not. Make a separate restricted key with only Read permissions for Appsdash, so each one can be revoked on its own.

Will it slow the app down?

No. The script is under 2 KB and loads after the page, so the page never waits for it.

See which app and which channel pays.

Try Appsdash free

14 days free · no card