Repository navigation
Show page views of people, with a switch to include bots - #120
Merged
Merged
Conversation
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
force-pushed
the
analytics-bot-views
branch
from
October 14, 2026 12:00
39982da to
628b637
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
How it works
VisitTallycounts 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 newbot_viewscolumn in every analytics table (V2__Bot_views.sql) and returned asbotViewsbesideviewsin totals, days and every breakdown (API and the MCPanalyticstool).lambda-analytics-bots). It is a labelledrole="switch": the words toggle it too.Days already counted
V2 fills in what can be told: each day's totals and devices from the devices'
bot/otherrows, 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 andCLAUDE.md.Tests
PagesProgramsOpenedAreCountedApartFromPeoples: people and programs opening pages, checking totals, days, pages, countries, devices and browserstranslations check: 0 errorsFour new sentences, translated into all 12 languages.
🤖 Generated with Claude Code