AI

AI Chatbot Analytics: What to Track Before You Sell It

A practical measurement guide for chatbots and WhatsApp CTAs: separate a button tap from a received message, a qualified enquiry and a client, keep QA traffic out, and treat referrers and "How did you find me?" answers with care.

Hamza El Haissouf

8 min readUpdated EN

A laptop and a phone showing funnel and bar charts in grey and lime, next to a printed report with highlighted rows.

Key takeaways

  • Count a form lead only after your API confirms the record was saved, not when the browser fires a submit event.
  • Write your fit criteria down before you count a single qualified enquiry.
  • Keep development hosts, previews, admin pages and your own devices out of the numbers, and label test leads as QA.
  • Report "direct / unknown" as its own line and put UTM tags on every link you control.
  • Store the "How did you find me?" answer in its own field, next to technical attribution, and report both side by side.

Short answer

Track four stages separately: a WhatsApp button click, a message actually received, a qualified enquiry and a client. Analytics can only prove the click. Confirm messages by hand or with a provider webhook, and keep qualified enquiries and clients as statuses on a lead record, never as analytics events.

Why most chatbot and WhatsApp numbers are misleading

The most common measurement mistake on a small business site is counting one thing and reporting another. A dashboard may label button taps as "WhatsApp conversions", even though all it recorded was clicks. Some of those people never sent a message. Fewer still were a good fit. Fewer again became clients.

Four stages from a tap to a client: a WhatsApp button click is only a tap; a message received is confirmed by hand or by a provider webhook; a qualified enquiry meets criteria agreed in advance; a client has an accepted quote, paid deposit or signed contract.
Fewer people reach each next stage, so agree on what proves each one before you start counting.

Before choosing tools or event names, agree on what each stage means and what evidence proves it. This guide walks through the four stages to keep separate, then the traps that distort them: internal traffic, missing referrers and self-reported attribution.

The four stages, and what proves each one

StageWhat it meansEvidenceCan analytics prove it?
WhatsApp button clickSomeone tapped a link that opens WhatsAppA click event in the browserYes, but only the tap
Message receivedA WhatsApp message actually arrivedThe message in your WhatsApp inbox, or a provider event if you use the WhatsApp Business PlatformNo, not from the click
Qualified enquiryA real conversation that meets fit criteria you agreed on in advanceA human (or a documented rule) reviewing the conversationNo
ClientAn agreement exists and a project has startedSigned quote, deposit, contract or project status in your CRMNever

1. WhatsApp button click: only a tap

A click event tells you that a visitor tapped a link to wa.me or a WhatsApp app link. That is all. After the tap, WhatsApp opens, and the visitor can close it, edit the prefilled text, or never press send. Your website cannot see what happens inside WhatsApp.

Treat clicks as an intent signal, useful for comparing pages and buttons, but never report them as enquiries or leads.

2. Message received: needs confirmation, not inference

A message counts as received only when it actually arrives. There are two honest ways to know:

  • Manual confirmation: someone checks the inbox and marks the click as matched or not matched.
  • A provider event: if you use the WhatsApp Business Platform (Cloud API) or a provider built on it, an inbound message webhook is real evidence that a message arrived.

To connect a message back to a click, one practical method is a short reference code in the prefilled text (for example "Réf. WA-7KQ2MX"). If a chat arrives starting with that code, you can link it to the click and its source. If the visitor deletes the code, the match is lost; do not guess it from timing alone.

3. Qualified enquiry: an actual conversation that meets agreed criteria

Write the fit criteria down before you start counting. For example: the person describes a real project, it is a service you offer, the budget range and timeline are workable, and they are the decision-maker or can reach one. A message that says only "hi" or "price?" is a received message, not a qualified enquiry, until the conversation shows fit.

Qualification is a judgement on a conversation. Record it where you record conversations (a CRM, a spreadsheet, an admin table), not as an analytics event fired from the browser.

4. Client: agreement and project status, never an analytics event

A client is someone who has agreed to work with you: an accepted quote, a paid deposit, a signed contract. That status belongs in your CRM or project records. No page view, click or form submission can tell you someone became a client, so never infer it from analytics. If you want to report "clients by source", join your client records back to the attribution you stored for that lead, and say how the match was made.

The names below are an example you can adapt, not a standard. What matters is that each name describes only what it can prove.

EventFired whenWhat it does not prove
page_viewA page loadsInterest or intent
visit_startFirst event of a sessionIdentity of the visitor
whatsapp_clickA WhatsApp link is tappedThat a message was sent
lead_form_submitA lead form submit is triggeredThat the server saved it
chat_message_sentA visitor sends a chatbot messageThat the conversation was useful
whatsapp_message_receivedConfirmed manually or by a provider webhookThat the enquiry is qualified

Keep "qualified enquiry" and "client" out of the event stream entirely. They are statuses on a lead record, set by a person or a reviewed rule, with a date and who set it.

For forms, there is a similar gap: a submit event in the browser proves intent, not success. Count a form lead only after your API confirms the record was saved, and report any ads conversion at that point too.

Separate QA and internal activity from real traffic

Your own testing will pollute every number if you let it. You click your own WhatsApp buttons to check them, submit test forms, and browse from your phone. A few rules:

  • Do not track non-production hosts. Local development and preview deployments should not send events to production reports.
  • Do not track admin pages. The dashboard where you review leads should not count as visits.
  • Tag your own devices. For example, a URL parameter such as ?internal=1 that sets a flag in the browser, so your analytics tool can label or filter that traffic as internal.
  • Label test leads explicitly. Test form submissions and test WhatsApp messages should be marked as QA in the lead record, not silently deleted, so totals can be audited.
Checklist to keep tests out of real traffic: do not track development or preview hosts, do not track admin pages, tag your own devices with ?internal=1, label test leads as QA instead of deleting them, check surprising numbers against real conversations.
Internal filters are never perfect: a new phone, a cleared browser or a colleague's device will slip through.

Internal filters are never perfect: a new phone, a cleared browser or a colleague's device will slip through. When a number looks surprisingly good, check it against real conversations first.

Missing referrers: "direct / unknown" is not a channel

A lot of traffic arrives with no referrer at all. Analytics tools usually call it "direct", but it really means "unknown". Common causes:

  • Links opened from messaging apps, email clients, PDFs or QR codes
  • Privacy settings, browser extensions and strict referrer policies
  • Mobile apps, including AI assistants, that open links without passing a referrer
  • People typing the URL or using a bookmark

AI assistants are a specific case. Some send a referrer or add a tag such as utm_source to links, and some open links in a way that strips the referrer entirely. A visit that came from an AI answer can therefore land in "direct / unknown" with no way to tell from the technical data alone.

Practical consequences:

  • Report "direct / unknown" as its own line, and do not reassign it to whichever channel you would like to grow.
  • Use UTM tags on every link you control (social bios, email signatures, ad campaigns, directory listings), so those visits never depend on a referrer.
  • Do not compare channels by click counts if one channel systematically loses its referrer.

"How did you find me?" is useful, but unverified

Asking people directly is one of the best ways to recover what referrers lose. It catches word-of-mouth, AI assistants and offline recommendations that no tag will ever see. It also has limits:

  • People misremember. They saw you on Instagram last month and searched your name today.
  • They pick the closest option, or the first one in the list.
  • They may give the answer they think you want.
  • It only exists for people who filled in the form or told you in chat.
Comparison of two sources. Technical source: UTMs, click IDs and referrer; catches every link you control; misses visits with no referrer; example direct / unknown. What they say: catches word-of-mouth, AI assistants and offline recommendations; people misremember; example ChatGPT.
When the two disagree, that disagreement is itself useful information, so never overwrite one with the other.

So store the answer in its own field, separate from technical attribution (UTMs, click IDs, referrer, landing page). Keep both, and report them side by side: "technical source: direct / unknown; says: ChatGPT" is more honest than overwriting one with the other. When the two disagree, that disagreement is itself useful information.

How this portfolio handles it today

To keep this concrete, here is what the code on this site currently does. It is a description, not a promise of results:

  • First-party events go to Cloudflare D1. The site sends selected events, such as visit_start, whatsapp_click and form submissions, to its own endpoint, which stores them in a D1 database. High-volume events like page_view and generic clicks are not sent there.
  • Only the production host is tracked, and admin pages are excluded.
  • WhatsApp clicks are labelled as clicks. The click alert says explicitly that it is a click only, not a confirmed enquiry. Links to my WhatsApp number get a short visible reference code in the prefilled message, and a click is marked as "chat received" or "no message" by hand, once I have checked the inbox.
  • Firebase is used for lead records, such as contact form submissions, not as the store for all of these analytics events.
  • The lead form asks "How did you find me?" and keeps the answer in its own field next to the technical attribution data.
  • Microsoft Clarity is injected only with consent. It has no consent mode of its own, so the script is added to the page only after the consent banner allows it.

A short checklist

  1. Write down the four stages and what evidence proves each one.
  2. Name events after what they can prove, nothing more.
  3. Confirm WhatsApp messages manually or with a provider webhook; never infer them from clicks.
  4. Write qualification criteria before you count qualified enquiries.
  5. Keep client status in your CRM, never in analytics.
  6. Exclude development, previews, admin pages and your own devices.
  7. Report "direct / unknown" honestly and tag every link you control.
  8. Store "How did you find me?" separately from technical attribution.

Frequently asked questions

Is a WhatsApp button click a lead?

No. A click only shows that someone tapped a link that opens WhatsApp. They can close it, edit the prefilled text or never press send, so treat clicks as an intent signal for comparing pages and buttons, never as enquiries or leads.

How can I tell which WhatsApp click turned into a message?

Put a short reference code in the prefilled text, for example "Réf. WA-7KQ2MX". If a chat arrives starting with that code, you can link it to the click and its source. If the visitor deletes the code, the match is lost: do not guess it from timing alone.

Why does so much of my traffic show as direct?

Many visits arrive with no referrer: links opened from messaging apps, email clients, PDFs or QR codes, privacy settings, mobile apps, and people typing the URL. Analytics tools call it "direct", but it really means "unknown".

Can analytics show visits that come from ChatGPT and other AI assistants?

Only partly. Some AI assistants send a referrer or add a tag such as utm_source, and some open links in a way that strips the referrer entirely. Those visits land in "direct / unknown", so asking "How did you find me?" helps recover them.

How do I keep my own tests out of my analytics?

Don't track local development or preview hosts, don't track admin pages, and tag your own devices, for example with a URL parameter such as ?internal=1. Mark test form submissions and test WhatsApp messages as QA in the lead record instead of deleting them.

Can I trust the answers to "How did you find me?"

Use them, but treat them as unverified. People misremember, pick the closest or first option, or give the answer they think you want. Keep the answer in its own field next to UTMs, click IDs, referrer and landing page, and report both.

Portrait of Hamza El Haissouf

Hamza El Haissouf

Full-stack developer for 6 years · Morocco

I build WhatsApp assistants and websites for private clinics and logistics companies. Remote, in English and French.

See my workAbout meLinkedIn

Related reading