Guide ·

How to add analytics to a website made with AI

Once the site is online, you want to know whether anyone sees it. Analytics tells you: visits, where they came from, which pages are popular, which buttons get clicked. On a static site it is a small script on every page — a job for your AI agent.

The main options

CookiesWhat you set upGood for
Google Analytics 4YesA Google account and a measurement IDDetailed reports, links with Google Ads
Cloudflare Web AnalyticsNoA Cloudflare account and a scriptSimple visitor numbers
Plausible, Fathom, UmamiNoAn account and a scriptSimple dashboards that respect privacy

Cookies and consent

In the EU and the UK, analytics that uses cookies generally needs the visitor's consent first, which means a consent banner. Tools that work without cookies are often used without one, but the rules differ from country to country, so check what applies to you.

How to install it

  1. Create an account with the service and add your site's address. You get a snippet of code or an ID.
  2. Give it to the agent: "Add this analytics snippet to the head of every page of the site."
  3. Update the site, open it, and check that your visit shows up in the service's real-time view.

Say "every page". Otherwise an agent may add it to index.html only.

Measure what matters

Page views alone do not tell you whether the site works. What matters is how many people did the thing the site is for: called, wrote on WhatsApp, booked. Ask the agent to track clicks on those buttons as events — in Google Analytics they are called events, in Plausible, goals. Then you know how many visitors actually got in touch.

If you share the site in several places, add UTM tags to the links, as described in the link-in-bio guide. The analytics will show which place brings visitors.

Keep it to one tool

Every analytics script adds weight and requests. One tool is enough for a landing page; two just give you two sets of slightly different numbers.

Your AI agent made a website? Let it publish it. Plans start at €7 a month, and the first 14 days are free, no card needed.

Get started
← All posts