Cost
Phantom Users: When Bot Traffic Inflates Your Product Analytics Bill
Our product analytics vendor bills by monthly tracked users, and midway through the month the trend line said we would blow through our contracted ceiling. The fastest-growing "users" turned out not to be people. This is how a line on an invoice became a dashboard, a repeatable forensics runbook, and a hard lesson about where you verify from.
The situation
Metered vendor billing has a property that per-seat billing doesn't: the meter counts whatever shows up, and it doesn't care whether what shows up is a customer. A monthly tracked user is any distinct identity that fires one analytics event. A human using the product is one tracked user. A crawler that loads one page and leaves is also one tracked user. A crawler fleet that loads a hundred thousand pages with a hundred thousand fresh anonymous identities is a hundred thousand tracked users, indistinguishable on the invoice from a hundred thousand new customers.
We had been through this once before, months earlier: an anonymous bot wave, caught late, fixed with a client-side bot filter and an interaction gate that holds events until a visitor actually scrolls or clicks. Usage fell by more than a third and stayed down. But the deeper problem hadn't been fixed, because the deeper problem was ownership. Nobody watched the number. The vendor's console will show you usage if you go look, and nobody's job was to go look.
So when a new crawler generation showed up (a major platform's AI-training crawler that executes JavaScript and scrolls, behaving just human enough to defeat the interaction gate), the meter climbed for weeks before anyone noticed. By the time we did, the projection was about twenty percent past the ceiling with a four-figure overage fee attached, poised to recur every month the traffic continued. The crawler had ramped from roughly 20 devices a week to tens of thousands in about six weeks, a curve no human adoption ever draws, and it was roughly half the month's tracked users.
The constraint
I set out to build two artifacts, deliberately separate. First, a dashboard that makes the contract visible: current month's tracked users against the contracted limit, an end-of-month projection from the current daily pace, a warning banner at 85% of the ceiling, and a red one when the projection crosses it. The overage conversation should start when the projection goes red, weeks before the invoice does. Second, a runbook that makes the forensics repeatable. The first investigation was a day of improvised queries. I didn't want the second one to be, so the whole diagnostic path is encoded as a skill my tooling runs on demand, including prior incident patterns, the exact queries, and the gotchas that cost me time the first time.
The explicit non-goals: this is not a bot-management platform and it is not real-time defense. It's an early-warning instrument plus a diagnosis procedure. Blocking sophisticated bots is a different product category, and part of the dashboard's value is telling me whether we've reached the point of needing to buy one.
What I did
The runbook runs four phases, each narrowing the cause:
- Fresh numbers. Capture usage, pace, projection, and the per-source split.
- Daily additions. Break the month into per-day new tracked users, split anonymous versus identified. This is where the signature shows. A doubling of anonymous additions with flat identified users is not growth, it's infestation. Our healthy baseline is single-digit thousands of anonymous additions a day. During the spike we saw two to three times that.
- User-agent forensics in the data warehouse. Classify anonymous events by user-agent, count distinct identities per class per day, and look for the bot fingerprint: events roughly equal to devices, zero engagement, every identity brand new. Then trace the ramp backwards to find when it started.
- Health-check the filter stack layer by layer, browser first. Our defense is a chain: a feature flag holding the bot denylist, client-side delivery of that flag, a compiled-in fallback list, and the interaction gate. Every link gets checked, from the browser's vantage point, not the management console's. That rule was earned the hard way, below.
Round one: the toggle that lied. The first mitigation was textbook. Add the crawler to the denylist in the feature flag. Config only, no deploy, live immediately. The console showed the change saved. The server-side SDK showed the new list. Everyone moved on. Verification 48 hours later showed zero drop. Not a partial drop, zero.
The layer-by-layer check found it: the flag had client-side availability switched off, and had since the day it was created months earlier. The server rendered pages with the right values, but the browser's own SDK fetched its flag set directly, this flag wasn't in it, and the client silently fell back to the default list compiled into our shared front-end library. That fallback happened to match the flag's old value, which is why the gap stayed invisible for half a year. The two lists agreed, so nothing looked wrong. The moment we changed the flag they diverged, and every browser on earth kept using the old list while every server-side check insisted the new one was live. The only check that told the truth was evaluating the flag from the browser's vantage point, the same endpoint the running client code actually calls. Verify from where the code runs, not from where the config lives.
Round two: right fix, wrong surface. With delivery fixed and verified from the browser this time, the numbers still didn't move. Splitting the crawler's traffic by surface explained why. One hundred percent of it was hitting a legacy public surface that runs a raw analytics snippet with no bot filter at all, and none of it touched the modern app where the filter stack lives. The legacy snippet fires an automatic pageview on load, once per crawler visit, before any filtering could apply. Our fix was correct, delivered, and pointed at an app the bot never visits.
That reframed the problem from "our filter has a gap" to "this traffic needs to be stopped upstream of the app entirely." The real fix, a block at the edge for that crawler on the legacy surface, belonged to a different team, so my deliverable became a ticket with the evidence attached rather than a config change of my own.
What's happened so far
The edge block is live. As I write this I'm about two days into the verification window, watching for daily anonymous additions to fall by roughly half, the crawler's device count on the legacy surface to go to approximately zero, and the month to land under the ceiling. All three checks are queries the runbook already contains.
An honest flag: the drop is not yet verified. If the numbers don't step down, the leading explanation is bots spoofing normal browser user-agents, which no denylist can catch, and that makes the "buy a dedicated bot-management layer" decision live.
One wrinkle that is already certain: tracked users can't be un-counted. The crawler's visits from the first half of the month are banked against the ceiling forever, so even with the block holding, this month lands close to the limit rather than comfortably under it. The real payoff is every month after this one, which is also the honest argument for the dashboard. The cheapest overage is the one you catch in week one.
Two verified wins along the way. The second and third forensics passes each took about an hour against a full day for the improvised first one, and they independently reached the same conclusion, which is exactly what a runbook should make possible. And the runbook caught a fix that wasn't one: our data team was excluding the crawler from warehouse queries, which cleans the dashboards but does nothing for the bill, because the vendor counts the user at ingestion, before the data lands in the warehouse. Left unflagged, that would have let everyone believe the overage was handled when only the charts were.
What I'd do differently
- Give every metered contract an owner on the day it's signed. The entire incident was possible because watching the number was nobody's job. The dashboard exists now. It should have existed the day the meter started running.
- Verify from the receiving end the first time, not the second. The 48-hour re-check was scheduled, and that discipline saved us. But the first verification looked at the console and the server SDK, the places that were easiest to check, not the browser where the control actually runs. A control confirmed only from the control plane is a control you haven't confirmed.
- Audit flag delivery when a flag is created, not when it fails. One browser-consumed flag spent months not reaching browsers. The audit of every other flag our front-end reads is on the list now. It should have been a creation-time checklist item all along.
- Inventory the unfiltered surfaces before the next crawler generation ships. The legacy snippet still fires an unfiltered pageview for whatever crawls it next, and a milder version of the same auto-pageview behavior exists in our modern app's initialization. Both are filed. Filters age. Surface inventory is what stays true.
Take what helps
Any vendor bill that scales on a countable unit (tracked users, events, seats, tokens) deserves three things: an owner, a chart with the contract limit drawn on it, and a written procedure for the day the line bends. The meter doesn't distinguish customers from crawlers. Someone on your side has to. The same argument, applied to the AI providers themselves, is its own playbook.
The operational lesson I'll keep the longest is the smallest one. Every control plane in this story reported success while the actual behavior was unchanged. The console said the list was updated, and the browsers never saw it. The filter said it was running, and the bot was on a different surface. Verify from where the code runs. It's cheap, it's unglamorous, and both times it was the only thing that told the truth.
Take what helps, skip what doesn't.