Analytics for builders
Add analytics to a Lovable, v0 or Bolt site with one prompt
By Nora Blake 路 Oct 17, 2026 路 8 min read
You built the site by describing it. You probably do not want to learn how its build step, its hosting or its routing work just to find out whether anyone showed up. You do not have to. Analytics for this kind of site is one line of HTML, and the builder's agent can place it for you.
Most small sites never get that line. As of Oct 14, 2026, W3Techs reports that 42.7% of the websites it monitors use none of the traffic analysis tools it tracks, and 47.2% use Google Analytics. The rest is spread thin.
Source: W3Techs, Usage statistics and market share of traffic analysis tools for websites, Oct 14, 2026. Retrieved Oct 14, 2026.
W3Techs counts only the tools it can detect on a page, so the 42.7% is a floor on how many sites could be unmeasured, not an exact count of sites with no numbers anywhere. The point stands: the default state of a new site is that nobody knows what it is doing.
What you are adding
One script tag with a site key. From the Peeko install docs, as of Oct 2026:
<script defer src="https://usepeeko.com/t.js" data-site="YOUR_SITE_KEY"></script>
Peeko sets no cookie, so there is no consent banner to build on top of the site. No IP address is ever stored. A visitor is the first part of a one-way keyed hash of their address and browser string, and the address itself is never written to a database or a log. The hash behind the People number mixes in the date and is re-salted every day, so nobody can be followed from one day to the next.
You get the site key when you create a site. The trial is fourteen days with no card, it starts when you create your account, and it covers one site, which is enough for this exercise.
The prompt
Open the chat of your project and paste this, with your real key in place of YOUR_SITE_KEY:
Add this exact script tag inside the <head> of the app's HTML so it loads on every page:
<script defer src="https://usepeeko.com/t.js" data-site="YOUR_SITE_KEY"></script>
Rules:
- In a Vite or React project, edit index.html in the project root.
- In a Next.js project, put it in the root layout, using the framework's own way of loading an external script.
- Do not install a package, do not add a cookie banner, and do not change anything else.
- When you are done, tell me which file you edited and the exact line you added.
The last rule matters. Agents in prompt-based builders sometimes rewrite more than you asked. Asking for the file name and the line gives you something to compare against what actually changed.
The Peeko dashboard and the command line also print a longer version of this prompt that connects the MCP server too, so the same agent can read your numbers later. The short one above is enough to start counting.
Publish, because editing is not shipping
The tag only counts once it is on the live site. All three builders separate the edit from the deploy.
Lovable. Its docs say publishing deploys "a snapshot to a URL you can share" and that "later changes are not automatically pushed live." A dot on the Publish button signals unpublished changes. After the agent edits the file, publish again.
v0. Publishing promotes the current work through the project's configured Git and Vercel workflow. You open Publish, review the deployment and select Publish Changes. With GitHub connected, the docs say Publish creates or reuses a pull request, merges it into the chat's base branch and waits for the production deployment. Every project keeps a stable production URL, so the address you shared does not change.
Bolt. New projects publish to a free .bolt.host domain with no third-party account. Publish again after the edit. Bolt's hosting page links a section on publishing changes to your live site.
Check it in two minutes
Do not trust the agent's "done." Check three things, in this order.
- View the live source. Open your published URL, view the page source and search for
usepeeko.com/t.js. If it is missing, the edit did not reach the published version. Publish again. - Send a test beacon. This confirms your machine can reach the endpoint:
curl -sS -o /dev/null -w "%{http_code}\n" -X POST "https://usepeeko.com/a" -H "content-type: application/json" --data '{"k":"YOUR_SITE_KEY","p":"/pricing","r":"https://news.ycombinator.com/","sw":1512,"sh":982,"vw":1512,"vh":860,"cs":"dark"}'
You should see 204. Read that result carefully. The ingest endpoint answers 204 to every well-formed beacon, valid key or not, so a tracker can never leak whether a key is real. A 204 proves the request arrived. It does not prove your key is right.
3. Load a page and look for it. Visit the live site, click to a second page, and open the dashboard. Your visit appearing is the only check that covers the key, the tag and the publish together.
Single-page apps change the URL without reloading, which is how most prompt-built sites route. Lovable's own analytics says it counts moves between pages inside the app, but the Peeko install docs do not cover route changes, so test it: after the second click, look for both paths in the page list. If only the first path shows, tell the agent exactly that.
When your visit has appeared, open your site with ?me=1 once. That tags your browser, badges your visits "You" and excludes them from every number unless you turn on "Count my own visits" in site settings. Do this after the check, not before, or you will not see yourself.
What your builder already gives you
Lovable has analytics built in. Its docs say it is included on all plans and starts counting once you publish, with no setup. It shows visits, page views, views per visit, visit duration and bounce rate, split by channel, with top pages and sources. Three limits from the same page:
- A visit is a browsing session, not a person.
- Your own visits count.
- Custom date ranges must fall within the last 90 days, and the page does not say whether bot traffic is filtered out.
If you want a week of visit counts and nothing more, Lovable's built-in view is the shorter path, and you can stop reading here. The tag earns its place when you want an answer the session count cannot give. A goal is a definition rather than a counter, so a goal written today counts over months before it was written, and a site can hold twenty of them. Five kinds of click are recorded with no code: outbound, phone, email, whatsapp and form. A funnel follows a person rather than a visit, holds two to five steps and covers at most 90 days. Page views, events and crawler hits are kept three years by default, and the site owner can set that anywhere from 30 days to ten years.
Lovable also offers a Google Analytics connector. Its docs describe it as send-only, so Lovable cannot read your reports, and the page does not mention consent or cookie banners. If you are weighing that route, Peeko vs Google Analytics 4 on cost, cookies and data covers the trade.
What a script tag cannot see
A tag runs in a browser, so it only counts visitors whose browser runs JavaScript. AI crawlers do not. They fetch your pages from a server and never run your script, so a tag alone reports none of them.
Peeko handles this on a separate server-side path. The @usepeeko/bot-track middleware is ESM only, needs Node 20 or newer, has zero runtime dependencies and weighs under 3 KB gzipped. It matches a crawler user agent against a curated list of 55 agents from 21 companies and files each recognized hit under AI answers, Search indexing, AI training or Other AI bots. No address and no visitor hash exist on that path, and crawler hits are never billed.
The limit for this post is plain. Middleware needs a server you control. If your builder hosts the site and you cannot add Node code to it, you get no crawler hits from this path, and the tag is all you have. Moving the project to a host where you can run Node 20 is a separate job. The first 30 days of AI crawlers on a new site shows what that data looks like once you have it.
One thing does work with the tag alone. Visits that arrive from ChatGPT, Claude, Perplexity, Copilot and Gemini are counted from ordinary page views by their referrer, with no middleware involved. Counting visits from AI assistants by referrer explains what that number does and does not mean, and following an AI referral to a signup without cookies picks it up from there.
Let the agent read the numbers
The reason to put this in a builder's chat is that the same chat can answer the next question. Peeko hosts an MCP server at usepeeko.com/api/mcp. It is read only except for one tool that creates a site, it is reached with a bearer API key, and it is scoped by construction to the sites of the teams you belong to. The command line needs no install: npx @usepeeko/cli speaks the same MCP endpoint an agent does, so a command and a tool call return the same numbers.
That lets you ask your agent, in the same project where it wrote the page, which pages got visits yesterday, rather than opening a dashboard.
Limits of this setup
- The key in the prompt is a site key that ends up in your page source. That is how a browser tag works, and it is why the ingest endpoint answers 204 whether or not a key is real.
- A new page does not appear in search on the day you ship it. If the question for week one is when Google first visits, timing Google's first crawl of a new page on your own site covers how to measure it.
- Nothing here was measured on a Lovable, v0 or Bolt project by us. The builder behavior above comes from each builder's own documentation, read on Oct 14, 2026. Builders change their publish flows, so if a step differs on your screen, trust the screen and keep the order: edit, publish, load, look.
The whole job
Create the site, copy the key, paste the prompt, publish, load the live page, and see your own visit in the dashboard. After that, open the site with ?me=1 so your own clicks stop counting. Ship the site and measure it before the day ends.