Replit has its own analytics, called Project Analytics. You switch on Enable analytics in the Publishing pane, republish, and Replit adds the tracker for you. From then on, Tools → Growth shows visitors, top pages, referrers, countries, browsers and devices, over anything from six hours to 30 days.
It's a decent traffic view, with a few gaps. Replit's docs call the visitor counts approximate, since one person can show up as several across devices, and the window stops at 30 days. Custom events, like a sign-up or a purchase, and asking Agent about your funnels need a paid plan.
If you want people, funnels and campaigns over a longer stretch, add a second tool next to it. This guide uses Spreelytics, which is free up to 1 million events a month and keeps 13 months of data, with no server to run. There are seven steps:
- Get your snippet
- Ask Agent to add it to index.html
- Allow your app's domains
- Republish and check it works
- Tag the clicks that matter
- Identify people when they sign in
- Build your first funnel
We checked the Replit parts against docs.replit.com on 16 November 2026.
1. Get your snippet
Sign up for Spreelytics, create an audience for your app, and copy the snippet from Settings → Tracking script:
<script src="https://cdn.spreelytics.com/cdn/sdk/spreelytics-loader.js"></script>
<script>
Spreelytics.init({ client_key: "YOUR_CLIENT_KEY" });
</script>
Your client key sits in the second tag. It's public on purpose. It can only send data into its own audience.
2. Ask Agent to add it to index.html
Every web app Agent builds has a frontend that loads from an index.html, and where that file lives
depends on when the project was made. Agent knows, so let it find the file. Replit's prompting
guide asks for exact files and real code, so give it both:
Add these two script tags inside the
<head>of the web app'sindex.html, in this order, before any other scripts. Don't change anything else.
Paste your snippet after the prompt. Prefer to edit by hand? Open Files in the sidebar, find
index.html and paste the snippet into the <head>.
You don't need to touch the router. The app changes screens without reloading the page, and the script counts a page view each time the address changes.
This covers web apps. A mobile app that Agent built with Expo doesn't run a script tag, and Replit's own Project Analytics skips mobile apps too.
3. Allow your app's domains
Spreelytics only accepts data from the hostnames on the audience's Allowed domains list, in Settings → Details. Add each address your app is published on:
- your
replit.appaddress - your custom domain, if you connected one, with and without
wwwif you use both
Leave the development address off. While you build, the app runs at a private replit.dev address
that can change every time you reopen the project, and the script fires there too. With that hostname
missing from the list, those test visits are dropped.
4. Republish and check it works
Changes in the editor don't replace the live app, because the published version is a snapshot of it. Click Republish. The address stays the same.
Open the live app in a normal browser window and click through a few screens. Within seconds, Settings → Tracking script in Spreelytics turns to Tracking is live, and you appear on the Realtime page.
Nothing? First check that you republished. If you did, the usual suspects are a hostname missing from the domains list and the ad blocker in your own browser.
5. Tag the clicks that matter
Page views say where people went. Clicks say what they tried, and you can count them without writing
any tracking code. Give an element a data-spree-track attribute, and every click on it sends an event
named after the attribute's value. Ask Agent:
Add
data-spree-track="signup_clicked"to the sign-up button anddata-spree-track="checkout_started"to the upgrade button.
They appear on the Events page.
6. Identify people when they sign in
When your app has accounts, tell Spreelytics who signed in, and the visits that person made while anonymous join their profile along with everything after.
Right after a user signs in or signs up, call
window.Spreelytics?.identify(user.email)in the frontend. When they log out, callwindow.Spreelytics?.reset().
Each person gets a timeline that starts with the channel that first brought them. Identify users lists the extra details you can save.
7. Build your first funnel
Funnels in Spreelytics are chains of goals. Go to the Goals page and make one goal for each step,
either a page path like /pricing or an event from step 5, then line them up on the Funnels page:
- visited
/ signup_clickedcheckout_started
It counts back over events you already have, so the worst step shows on day one.
Final thoughts
Adding analytics to a Replit app takes seven steps:
- Get your snippet
- Ask Agent to add it to index.html
- Allow your app's domains
- Republish and check it works
- Tag the clicks that matter
- Identify people when they sign in
- Build your first funnel
Agent can set up Stripe through Replit's connector or with your own keys. Either way, connect the same Stripe account in Settings → Revenue and ask Agent to put the visitor id into the checkout session's metadata, and each payment is credited to the channel that brought the buyer. How to see which marketing channel earned each Stripe payment has the code.
Using another builder for your next app? How to add analytics to a vibe-coded app covers Lovable, Bolt, v0 and Base44.