Add Analytics to Your Vibe-Coded App in 60 Seconds
You just spent 20 minutes building a complete app with Cursor. You deployed it. It's live. Someone asks: "How many people are using it?"
And you realise you forgot analytics entirely.
This is the 60-second fix.
The vibe coder's analytics gap
AI coding tools are excellent at building functional software fast. They handle authentication, database schema, UI components, and deployment configuration. They almost never add analytics.
This is a gap in the workflow, not a flaw in the tools. You did not ask for analytics. The AI did not add it. Now you are flying blind.
The consequence: you launch, you get your first wave of visitors, and you have no data. You do not know how many people came, where they came from, or what they did. You spend your launch day watching Vercel logs instead of watching real visitor data.
Key idea: AI coding tools build your app fast but skip analytics. One hosted script tag or SDK install adds privacy-friendly tracking in under a minute. Track visitors, top pages, and referrers — enough to know if your MVP is getting traction.
One command to fix it
The fastest path to analytics is the hosted tracker. Add this to the <head> of your app:
<!-- Antlytics: get your tracking ID from the dashboard -->
<script
defer
src="https://www.antlytics.com/tracker.js"
data-tracking-id="YOUR_TRACKING_ID"
data-api-host="https://www.antlytics.com"
></script>
Replace YOUR_TRACKING_ID with the UUID from your Antlytics dashboard under Settings → Tracking Snippet. See Quick start.
That is it. You now have privacy-friendly analytics. No cookie banner required. The tracker handles SPA navigations via History API patches and popstate.
What to track on a fresh MVP
When you first launch, do not overthink your analytics setup. You need four things:
- Are people coming? — Total visitor count in the first 24–48 hours.
- What do they look at? — Top pages by pageview count. Which features are people finding?
- How did they find you? — Referrer breakdown. Which announcement post or social share drove traffic?
- Did they do the thing? — Set up one conversion goal for your primary action: sign up, subscribe, contact, or download.
You do not need a full tracking plan. You need these four numbers. Everything else is noise until you have enough traffic to ask more specific questions.
Framework-specific quick tips
Next.js (recommended: SDK)
npm install @antlytics/analytics
// app/layout.tsx
import { Analytics } from "@antlytics/analytics/next"
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<Analytics trackingId="your-uuid" />
</body>
</html>
)
}
The SDK loads the hosted tracker and handles SPA navigation automatically. See the full Next.js App Router guide.
Plain HTML
Add the hosted script tag from above to the <head> of every page. Works with any HTML site — including Bolt.new exports, static sites, and traditional multi-page apps.
React or Vite (without Next.js)
Add the hosted script tag to your index.html <head>. Paste it directly — no package install needed.
Bolt.new, Lovable, v0
These tools typically output HTML or React apps. Add the hosted tracker.js script tag to the main HTML template or layout component.
Using your analytics from your AI coding tool
The Antlytics Model Context Protocol (MCP) server allows AI coding tools to query your analytics data directly. When connected, you can ask your AI tool:
- "How many visitors did my site get today?"
- "Which page has the most traffic this week?"
- "What is my top referrer?"
This turns your analytics from a separate dashboard into an integrated part of your AI-assisted development workflow. See the AI coding tools guide for setup instructions.
Common mistakes
Forgetting the tracking ID — The script requires a real UUID from your dashboard. The placeholder text YOUR_TRACKING_ID will not cause an error, but data will not be collected correctly.
Blocking your own traffic with extensions — If you test with an ad blocker or privacy extension, the request may be blocked. Confirm analytics is working by checking the network tab in your browser dev tools.
Installing on only one page — In a multi-page app, the script needs to run on every page. In Next.js, add the SDK to app/layout.tsx. In a plain HTML site, add the script to each page's <head>.
Not setting up a conversion goal — Adding a first conversion goal takes two minutes and gives you instant signal on whether your launch is working. Do it before you go live.
Letting the AI invent an ingest IIFE — If your tool generates a custom fetch to /api/ingest/pageview, replace it with the hosted script or official SDK.
FAQ
Do I need analytics on an MVP? Yes. You need to know if anyone is visiting and what they are doing. Without it, you are building blind.
Will analytics slow down my app? The Antlytics tracker is lightweight and loads asynchronously, so it is not in the critical rendering path. In typical setups this has negligible impact on page speed — use Lighthouse before and after install to verify for your specific setup.
Can I add analytics by prompting Cursor or Claude Code?
Yes. Prompt your AI tool: "Add the Antlytics hosted tracker.js script to this project with tracking ID [your-uuid]." Or for Next.js: install @antlytics/analytics and add <Analytics /> from @antlytics/analytics/next.
What if I am using Bolt.new or Lovable? Add the hosted script tag to your main HTML template or layout component. Both platforms let you edit the HTML output.
Do I need to set up goals right away? Start with pageview tracking. Add one conversion goal for your primary action before launch. Add more later when you have specific questions.
What's the first-party proxy and do I need it? It routes analytics through your domain to bypass ad blockers. Optional for an MVP. Set it up if accurate visitor counts become important. See first-party proxy docs.
Can I use Antlytics across multiple AI-built projects? Yes. Antlytics Starter includes unlimited sites. Add each project as a separate site with its own tracking ID.
Related: What analytics data do you actually need? · Privacy-first analytics explained · Next.js analytics setup guide