AI app builders
Add nextanalytica's tag to an app built with Lovable, Bolt, v0 or Replit: one prompt in the builder's chat, then your own agent reads the numbers.
Updated
An AI app builder writes and hosts your app from a chat: Lovable, Bolt, v0 and Replit are the best known. To count the app's visits, add nextanalytica's tag once, in the layout every page shares. The fastest way is to ask the builder's chat to do it, with your own tag line.
Where does the tag go in each builder?
| Builder | What it builds | Where the tag goes |
|---|---|---|
| Lovable | TanStack Start; older apps React with Vite | Ask in chat. Older apps: index.html |
| Bolt | Most often React with Vite | index.html, inside <head> |
| v0 | Next.js with React | app/layout.tsx |
| Replit | Any stack Replit Agent chose | Depends on the stack: ask in chat |
How do you add it from the chat?
Copy your tag line from Site in nextanalytica, then paste this into the builder's chat, with your line in place of the example:
Add this script tag inside <head> on every page, in the root layout, exactly as written. Don't change it and don't add anything else:
<script async src="https://t.nextanalytica.app/t.js" data-project="na_…"></script>na_… is your project's key. Never let the builder write the line from memory: a made-up key counts nothing. Then publish the app, since the tag only counts the published version.
Why not the builder's own analytics?
Lovable, Bolt and Replit count visits to apps they host, and v0 apps can use Vercel's. They answer "how many people came". nextanalytica adds what that leaves out:
- Your own agent reads it. Claude, Cursor or Codex answers in chat, over MCP, instead of a dashboard you open.
- Conversions and revenue: sign-ups and orders by channel, page and campaign.
- AI assistants as their own channel: visits from ChatGPT, Perplexity and Claude, apart from search.
- It stays when you move: the same project keeps counting if you leave the builder's hosting.
You can keep both.
How do you check it works?
Publish the app and open it once in your browser. Within about a minute, Site shows the domain as live. If your agent is connected, ask it "Check my nextanalytica setup": check_setup lists the hosts that sent something and what to do next.
How do you count sign-ups and other actions?
The tag counts visits and pages on its own. Actions only your app knows about, such as a sign-up, need one line where they happen. Ask the builder's chat to add it after the sign-up succeeds:
window.nextanalytica?.track("signup_completed", { plan: "team" });Then tell your agent which events count as conversions, and it reads conversion rates by channel and page. See Custom events.
Do you need a cookie banner?
Not for the tag. It counts without cookies until a visitor agrees, so people who never answer a banner are still counted. If your app has a banner, pass the answer with window.nextanalytica?.consent(true) or consent(false). See Cookieless counting and consent.
What can you ask your agent?
Connect your own agent (Claude, Cursor, Codex) to nextanalytica once, and ask in plain words:
- "How many people visited the app this week, and from where?"
- "Which channel brings sign-ups?"
- "I deployed a new version. Did I break anything?"
See Your agent to connect it.
Next steps
- Add the tag to any other site
- Analytics for apps built with AI
- Custom events