Skip to content
AI app builders

Replit app analytics with revenue attribution

2 min read · Updated · By the Reveata team

Short answerAsk the Replit Agent to add the Reveata script tag once to the file that renders every page's head, then republish. Connect the payment provider your Replit app uses and paste Reveata's prompt so the checkout carries the visitor id.

A Replit app can be anything from a Vite front end to a Flask or Express server, so there is no single file to edit. The Replit Agent knows your project, which is why the easiest install is a prompt.

What you get

  • Every page of the deployed app, including single-page navigation.
  • Revenue credited to visits from Replit's Stripe integration.
  • A first-party proxy in your own backend, because Replit apps have a server.
  • Goals added by the Agent on request.

How to install it

Ask the Agent to add the snippet exactly as written to the <head> of every page, by finding the one file that renders the head for all pages and adding it there once. The exact prompt is in the Replit install guide. The file depends on your stack:

Stack File
Vite or plain HTML index.html (React, Vue)
Next.js The root layout (Next.js)
Flask or Django The base template (Flask, Django)

Then publish, or Republish a live app. In Reveata, add the website with your custom domain or the .replit.app address. The workspace preview is another address and isn't counted. Replit's own docs are at docs.replit.com (opens in a new tab).

How payments are matched to visits

Replit's Stripe integration takes payments into your own Stripe account, a sandbox while you build and your live account once you publish:

  1. Connect the same live Stripe account in Reveata (Stripe revenue analytics).
  2. Paste the prompt from revenue in apps built with AI into the Agent. It sends window.reveata.metadata() with the checkout request and adds the visitor id to the checkout metadata.

If your backend records payments itself, it can post them to the Payments API instead. Sandbox payments are not imported from your live account.

A proxy in your own backend

Ask the Agent to follow the proxy guide for your server, such as Express or Flask. Store the proxy secret in Secrets as REVEATA_PROXY_SECRET. Replit puts your app behind its own proxy, so read the visitor's address from the first entry of X-Forwarded-For. Or use the managed proxy with a custom domain.

Frequently asked questions

The Agent put the snippet in a React component. Is that fine?

No. With useEffect the tag can be added twice or lose its attributes. Keep it as a plain tag in index.html or the root layout.

Why don't I see visits after editing?

The published app keeps the old code until you republish.

Does testing in the workspace count?

No. The workspace preview runs on another address. Test the published .replit.app address or your domain.

See it with your own numbersReveata ties every visit and sale to the source that brought it. Add your website in a minute.
Get started
Was this page useful?
IntegrationExpress.js analytics with a first-party proxyPaste the Reveata snippet into the layout, static HTML or front-end index.html your Express app serves. Two Express routes can serve the script from your own domain with your proxy secret, and your checkout route can copy the visitor id into the checkout metadata.IntegrationFlask analytics with ReveataPaste the Reveata snippet into the base Jinja template your Flask pages extend. Every page is tracked, two small Flask routes can serve the script from your own domain, and your checkout route can copy the visitor id into the payment's metadata.IntegrationStripe revenue analytics by traffic sourceReveata reads your Stripe payments, invoices, subscriptions, refunds and lost disputes through a read-only connection, then credits each payment to the visit that brought the buyer, so revenue sits next to traffic in every report.IntegrationBolt app analytics with revenue attributionAsk Bolt to add the Reveata script tag to the head of index.html, or the root layout for Next.js and Astro projects, then publish again. Connect your payment provider and paste Reveata's prompt so the checkout carries the visitor id.IntegrationLovable app analytics with revenue attributionAsk Lovable to add the Reveata script tag to the head of every page, in src/routes/__root.tsx for newer TanStack Start apps or index.html for older Vite apps, then publish. Connect your payment provider and paste Reveata's ready-made prompt so Lovable adds the visitor id to your checkout.Integrationv0 app analytics with ReveataAsk v0 to add the Reveata Script component to app/layout.tsx, then publish. Client-side navigation is counted, and after you connect your payment provider, Reveata's prompt has v0 put the visitor id into the checkout metadata so each payment has a source.