Analytics for vibe coded apps.
You described a site, an agent built it, and it is live. Now you want to know if anyone uses it. Here is how to add analytics to an app built with Cursor or Claude Code, what agents tend to get wrong, and the shortest prompt that gets it right. It is a setup that suits indie hackers and solo founders: one line, no team needed.
4 sources, each one read in October 2026 and linked at the bottom.
THE SHORT ANSWER
The quick version.
Adding analytics to a site built with an AI coding agent is a small job, and agents can make it big. The cheapest setup is one script tag in the head of every page, then opening the live site to check that your own visit shows up. Most of the trouble comes from skipping that last check.
THE NUMBERS
How many people build this way.
February 2025
is when Andrej Karpathy posted the phrase "vibe coding" on X. He described asking an AI for what you want and accepting its changes without reading them. The word stuck. Andrej Karpathy on X
84 in 100
developers who answered the Stack Overflow 2025 survey were using or planning to use AI tools in their work. That was up from 76 in 100 the year before. Stack Overflow
51 in 100
professional developers in the same survey used AI tools every day. Stack Overflow
15 in 100
said vibe coding is part of their professional work, at least somewhat. 77 in 100 said it is not. So most developers still read what the agent wrote, and the people shipping without reading it are a minority at work. Stack Overflow
1 in 4
startups in Y Combinator's Winter 2025 batch had codebases that were 95 in 100 written by AI, according to managing partner Jared Friedman. He said the figure left out library imports, and that these founders were technical. TechCrunch
66 in 100
developers in the Stack Overflow survey named "AI solutions that are almost right, but not quite" as their top frustration. Analytics code is a good place for almost right, because nothing visibly breaks when it does not work. Stack Overflow
WHAT TO CHANGE
Why it happens, and the fix for each.
01Nobody checked that data arrives
This is the most common failure and the easiest to miss. The agent writes the code, the build passes, the site looks fine, and no visit was ever counted. The page gives you no sign.
TRY THISAsk the agent to open the live site after the change and confirm one visit shows up in your dashboard. Or do it yourself: open the site and watch for the first visit. An ad blocker can hide your own visit, so try a window without one.
02Only the first page counts
A React or Next.js app does not reload when someone clicks a link. It swaps the page in place. A tag that only fires on page load sees the first page and misses the rest. Google Analytics has a setting for this. It listens for pushState, popState and replaceState, the browser calls an app makes when it changes the address. Google Analytics Help
TRY THISUse a tracker that follows those calls. The Moxel script does. It starts a new page view whenever the path changes, so Next.js links count. A change to only the query string, like ?tab=2, does not. Click through three pages on your own site and check that three show up.
03The agent picks a heavy tool for a team
Asked to add analytics, an agent may reach for whatever it has seen most. That can be a full product-analytics package with an SDK, an event schema and logins for teammates. You have no teammates. There is no study on how often this happens, so treat it as a pattern to watch for, not a measured rate.
TRY THISName the tool and the method in the prompt. Say "paste this one script tag, add no packages". A tag in the head is one line to read and one line to remove.
04Cookies arrive, then a consent banner
Some analytics code stores something in the visitor's browser. Then the site needs a banner asking permission, and the agent adds one. Your page now has a popup over the first screen that nobody asked for.
TRY THISPick a tool that stores nothing in the browser, and say so in the prompt. Moxel sets no cookies and keeps nothing in the visitor's browser. If you use another tool, read what it stores before the agent writes a banner.
05Event names drift
Ask an agent for custom events in three sessions and you can get signup, Signup and user_signed_up. They count as three different things, and none adds up to the number you wanted.
TRY THISSkip custom events at first. Page views, forms and clicks cover most early questions. If you add one, write the name once in the prompt and tell the agent to reuse it. Moxel names forms and fields from what is already on the page, so there is nothing for the agent to invent.
06The key ends up in the wrong place
Some tools have two keys. One is public and belongs in the page. One is secret and belongs on a server. An agent can paste the secret one into front-end code, where anyone can read it.
TRY THISPut only the public site key in the script tag. Keep a secret key, if you use one, in an environment variable on the server and never in a file the browser loads. In Moxel, the key inside the script tag is the public one.
ON YOUR OWN SITE
Pick how much to track, in one word.
The prompt below needs one setting. Chill counts visits and forms. Vibey adds clicks and scroll. Feral adds timing and errors for each form field.
Coffee, roasted Tuesday.
Shipped Wednesday. Ground to order, never sat in a warehouse.
Card
Hero dwell time, CTA taps, form attempts, and where they ghost the checkout.
Events so far
0
6 of 11 signals
Moxel works on a site built by an agent today, with one script tag. Copy the line from your dashboard and paste this into Cursor, Claude Code, Lovable, Bolt, v0 or Replit: "Add this script tag to the head of every page, before the closing head tag. Add no packages. Then open the live site, click through two pages, and confirm the visits show up in my Moxel dashboard." The Install page in the dashboard turns green on the first visit. To go further, give your agent the Moxel skill file at https://www.getmoxel.com/skills/moxel/SKILL.md. It installs the getmoxel package, names your forms, and adds a goal where a signup or order actually finishes. Moxel has no session recordings, no heatmaps and no visitor locations, so it will not replace a tool that has them.
THE LIMITS
What this cannot tell you.
The adoption figures come from a survey of developers who chose to answer and from one investor's estimate about one batch of startups. They show that AI-assisted building is common, not how many sites ship without analytics. We found no sourced count for that, so we have not given one. The list of mistakes comes from how these tools work, not from a study of agent output, and agents change quickly. Check the result on your own site.
QUESTIONS
Asked a lot.
- What is the best analytics for vibe coded apps?
- The best choice is the one your agent can add in a single step and you can check in a minute. A hosted tool that takes one script tag fits that. Moxel is one, built for a person running a site alone. If you need session recordings or heatmaps, pick a tool that has them.
- How do I add analytics to an app built with Cursor or Claude Code?
- Copy the script tag from your analytics dashboard, then tell the agent to paste it into the head of every page and add no packages. Ask it to open the live site and confirm a visit arrives. In a Next.js app, that means the root layout. Moxel follows route changes, so every page you click through is counted.
- How to add analytics to a site built with Cursor or Claude Code if it is React or Next.js?
- Use a tag that watches the browser history, because these apps change pages without reloading. Moxel does this and starts a new page view when the path changes. Click through a few pages after you deploy and check that each one shows up. The getmoxel npm package has a React component that does the same.
- What is the best analytics for indie hackers and solo founders?
- One that takes minutes to install, needs no team to read, and says in plain words what to change. Moxel is aimed at that person: it sets no cookies, explains each number in a sentence, and ranks fixes. It starts with a 30 day free trial.
SOURCES
Where the numbers came from.
- There's a new kind of coding I call "vibe coding"Andrej Karpathy on X, Andrej Karpathy, 2 February 2025.
- 2025 Developer Survey, AIStack Overflow, 2025. A survey of developers who chose to answer, so it leans toward people active on Stack Overflow.
- A quarter of startups in YC's current cohort have codebases that are almost entirely AI-generatedTechCrunch, March 2025. Reports a claim by Y Combinator partner Jared Friedman. Y Combinator invests in AI companies, and the figure is a rough estimate, not an audit.
- Enhanced measurement eventsGoogle Analytics Help. Product documentation, describing Google's own tag.
Read in October 2026. Studies get updated, so follow the link for today's figures.
KEEP READING
More from the field guide.
- Why people leave in ten seconds
- Why people abandon forms
- Why people abandon checkout
- How far people really scroll
- What rage clicks really mean
- Your website stats in plain English
- Analytics without a cookie banner
- How to track form abandonment
- Shopify traffic but no sales
- Where people drop off in checkout
- Should the phone field be required?
How Moxel records all of this is in the docs. What it never records is on the privacy page.