Antlytics logoAntlytics
← Blog
4

Add Analytics to Your Vibe-Coded App in 60 Seconds

You built your app with AI. Now add analytics with one command — no config files, no tracking plans, no momentum break.

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 script tag or install command 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 a single script tag. Add this to the <head> of your app:

<!-- Antlytics: get your tracking ID from the dashboard -->
<script>
(function(){
  var t="YOUR_TRACKING_ID",
      u="https://www.antlytics.com/api/ingest/pageview",
      k="ant_sid";
  function sid(){
    try{var s=sessionStorage.getItem(k);if(s)return s;
    s=crypto.randomUUID();sessionStorage.setItem(k,s);return s;}
    catch(e){return crypto.randomUUID();}
  }
  function send(){
    fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},
    keepalive:true,body:JSON.stringify({tracking_id:t,
    pathname:location.pathname,referrer:document.referrer||undefined,
    session_id:sid()})}).catch(function(){});
  }
  send();
  window.addEventListener("popstate",send);
})();
</script>

Replace YOUR_TRACKING_ID with the UUID from your Antlytics dashboard under Settings → Tracking Snippet.

That is it. You now have privacy-friendly analytics. No cookie banner required.

What to track on a fresh MVP

When you first launch, do not overthink your analytics setup. You need four things:

  1. Are people coming? — Total visitor count in the first 24–48 hours.
  2. What do they look at? — Top pages by pageview count. Which features are people finding?
  3. How did they find you? — Referrer breakdown. Which announcement post or social share drove traffic?
  4. 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 handles SPA navigation automatically. See the full Next.js App Router guide.

Plain HTML

Add the 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 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 script tag to the main HTML template or layout component. The simplest approach is always the script tag.

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:

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 it to app/layout.tsx. In a plain HTML site, add it 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.

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 tracker script to this project with tracking ID [your-uuid]." The install is simple enough that AI tools handle it correctly.

What if I am using Bolt.new or Lovable? Add the 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