Skip to content

Show page views of people, with a switch to include bots - #120

Merged
Kaliumhexacyanoferrat merged 1 commit into
mainfrom
analytics-bot-views
Oct 14, 2026
Merged

Kaliumhexacyanoferrat merged 1 commit into
mainfrom
analytics-bot-views

Conversation

@Kaliumhexacyanoferrat

@Kaliumhexacyanoferrat Kaliumhexacyanoferrat commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Page views counted crawlers and programs among people. On genhttp.org, 279 of the 1,244 page views were bots'. Now the editor shows the pages people opened, and a switch beside the time ranges puts the bots back in.

People only (default) Include bots
off on
Dark, bots included Phone
dark phone

How it works

  • Counted apart: VisitTally counts a view by anything the classifier doesn't take for a person (crawlers, and agents that name no browser) as a bot view as well. It is stored in a new bot_views column in every analytics table (V2__Bot_views.sql) and returned as botViews beside views in totals, days and every breakdown (API and the MCP analytics tool).
  • Instant switch: the editor works out the people's figures from the one answer, so toggling changes the figure, its chart, the % change and the page views' cards at once, with no request. The switch is off by default and remembered in the browser (lambda-analytics-bots). It is a labelled role="switch": the words toggle it too.
  • Says what it counts: while bots are included, the Page views figure and the group heading carry an "incl. bots" mark, and the Pages card says "people and bots", so a screenshot is never ambiguous.
  • Where visitors come from stays people's either way: a bot names no page it came from, so it would land in "Typed in, a bookmark or an app".
  • Requests and crawlers count every request, as before.

Days already counted

V2 fills in what can be told: each day's totals and devices from the devices' bot/other rows, and the crawlers as bots. For genhttp.org that gives 958 page views by people. The pages, referrers and countries of those days can't be split any more and keep their bots among their people. This is checked against sample rows, and noted in the migration, the README and CLAUDE.md.

Tests

  • PagesProgramsOpenedAreCountedApartFromPeoples: people and programs opening pages, checking totals, days, pages, countries, devices and browsers
  • Full suite: 832 passed. The frontend builds; translations check: 0 errors
  • Checked in the browser against a local server: toggling, remembering across a reload, clicking the label, light and dark mode, phone width

Four new sentences, translated into all 12 languages.

🤖 Generated with Claude Code

Base automatically changed from analytics-visitors-open-pages to main October 14, 2026 11:59
Page views counted crawlers and programs among people: 279 of
genhttp.org's 1,244 page views were bots'. The views of programs are now
counted apart (bot_views in every analytics table, botViews in the
answer), and the editor shows the pages people opened unless the owner
switches on "Include bots" beside the time ranges. The switch is worked
out from the one answer, so it changes the figure, its chart and the
page views' cards at once, and is remembered in the browser. Where
visitors came from stays people's either way.

V2 fills in the days already counted where it can: their totals and
devices from the devices' bots and others, the crawlers as bots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kaliumhexacyanoferrat
Kaliumhexacyanoferrat merged commit 734d9ef into main Oct 14, 2026
2 checks passed
@Kaliumhexacyanoferrat
Kaliumhexacyanoferrat deleted the analytics-bot-views branch October 14, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant