Add analytics and revenue tracking to your Lovable app
Lovable builds and hosts the app. It doesn't show where your visitors come from or which of them paid. A tag in the page and a read-only key do.
Updated Dec 4, 2026.
The short answer.
Put the Appsdash script tag inside the <head> of your Lovable app: paste the prompt below into the Lovable chat, or edit the file in Code mode (src/routes/__root.tsx on TanStack Start projects, index.html on older React + Vite ones). Publish, open the live URL once, and the visit shows up. Then connect the Stripe or Paddle account behind the app with a read-only key to see revenue next to traffic.
The tag for Lovable.
Add your app to Appsdash first: its install step shows this tag with your own id in place of YOUR_SITE_ID.
<script defer src="https://appsdash.co/v/s.js" data-site="YOUR_SITE_ID" /><script defer src="https://appsdash.co/v/s.js" data-site="YOUR_SITE_ID"></script>Rather not touch the code? Paste this into the Lovable chat, with YOUR_SITE_ID replaced by your id:
Add this analytics script tag to my app. On TanStack Start it goes inside <head> in src/routes/__root.tsx, written as JSX; on React + Vite it goes inside <head> in index.html. 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>Which file holds the head
Lovable projects created since May 13, 2026 use TanStack Start: the page's <head> is in src/routes/__root.tsx, and the tag goes inside it in the JSX form shown on this page. Older projects use React + Vite, where the head is index.html at the root of the project.
The chat prompt covers both, so you don't need to know which one you have. Editing files yourself in Code mode needs a paid Lovable plan; on the Free plan, the chat makes the change for you.
Connect the money
Lovable takes payments two ways. With built-in payments (paid plans), Lovable creates a Paddle or Stripe account for the project, and you open it from the Payments tab (a Stripe account once you have claimed it). Or you connect your own Stripe account with a key, and payments go straight to it.
Both ways the account is yours, so make a separate read-only key for Appsdash in it and leave the one Lovable uses alone. Stripe: 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. Paddle: an API key from the live account with Read on Transactions, Subscriptions, Adjustments and Products (sandbox keys don't work). Appsdash reads every 15 minutes and never writes.
To see which source paid, the checkout has to carry the visit id: as client_reference_id when your app starts a Stripe checkout, or in customData when a Paddle checkout opens. Ask the Lovable chat to make that change, with the code lines on this page as the example.
Check that it works
Click Publish, then Publish changes: the live site is a snapshot and keeps the old head until you do. Then open your live address (the lovable.app one or your own domain) once, with any ad blocker off. The editor preview runs on another address, so its visits don't count.
The Appsdash install step waits for that first visit and says Counting when it lands. You can also press Check installation in the app's Settings in Appsdash: it opens your home page and sends a test visit, so you know the tag is live before anyone comes.
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.
- Add the app. Type its live address, the lovable.app one or your own domain. Appsdash gives you the tag with your site id filled in.
- Put the tag in the head. Paste the prompt from this page into the Lovable chat, or edit __root.tsx or index.html yourself in Code mode.
- Publish and visit. Publish, then Publish changes, and open the live address once. The install step turns to Counting.
- Connect payments. A read-only key from the Stripe or Paddle account behind the app. Revenue, MRR and paying customers show beside the visitors.
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.
Paddle.Checkout.open({
items: [{ priceId: "pri_...", quantity: 1 }],
customData: { appsdash_visit: window.appsdash?.visit?.() ?? "" },
});Keep any customData you already send (like product): add appsdash_visit beside it. Paddle copies it onto renewals.
// 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.
- Visits in Lovable's editor preview don'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 in the checkout, 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.
Do I need a paid Lovable plan?
Not for the tag: on the Free plan the chat can add it, since only hand edits in Code mode need a paid plan. Lovable's built-in payments need a paid plan; your own Stripe key doesn't.
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.
Does it set cookies?
One first-party cookie that links a returning visitor's visits, never shared or sold, and IP addresses are never stored. An app can go without it with a Settings switch plus data-remember="off" on the tag.
Can Appsdash change anything in my Stripe or Paddle?
No. It asks for a read-only or restricted key and only reads.
Read next.
- Add analytics and revenue tracking to your Bolt app
- Add analytics and revenue tracking to your Replit app
- Revenue per traffic source
- Stripe revenue in Appsdash
- Paddle revenue in Appsdash
- All guides
Sources, checked Dec 4, 2026
- Lovable: FAQ (TanStack Start since May 13, 2026)
- Lovable: Upgrade a project to TanStack Start
- Lovable: Code mode
- Lovable: Quick start (Publish changes)
- Lovable: Payments
- Lovable: Stripe
- TanStack Router: Document head management
Spotted something wrong? Write to younes@appsdash.co and it gets fixed.
See which app and which channel pays.
14 days free · no card