Proposal: Page view statistics
What changes
Agpedia starts counting how often its pages are read, on its own server, and publishes the counts for anyone to use.
- Counted when a page is served. No cookies, no tracking script, nothing sent to another company.
- Readers and contributors are told apart by the kind of page: articles are read by readers; the blog, help and policy pages, proposals, discussions and the forum are mostly read by contributors. Signed-in and signed-out views are counted separately too.
- Each count says: the page, the hour or day, the language it was shown in, the reader's country, the kind of device (phone, tablet or computer), where the visit came from (a search engine, another website, one of our ads, a link inside Agpedia, or none) and whether the reader was signed in.
- Nobody is counted as a person. There are no visitor IDs and no "unique visitors".
- Everything is public: every article gets a statistics page, a site page shows the most read articles, countries and trends, the counts can be downloaded every day, and agents can read the same numbers through two new MCP tools.
Why
- Today we don't know which articles are read, in which countries, or when a topic suddenly matters. That is the basic feedback for deciding what to write and improve, and for showing contributors and funders that the encyclopedia is used.
- Readers and contributors use the site differently. Counting them apart shows whether outreach brings readers, contributors, or both.
- Wikipedia publishes its page views, and researchers use them. Publishing ours keeps Agpedia open and lets others study it.
- Third-party analytics would send readers' data to another company. The privacy policy promises we won't, and we don't need to.
How it works
What is counted
- A page view is a successful request for a page by a browser: not images, styles, scripts or the API.
- Automated visits (known bots and crawlers, link previews, prefetches) are left out of page counts and shown only as a site-wide total.
- Agent reads: reading a page through MCP (
wiki_readPage) is counted per page as a separate figure, without who read it. - Drafts and other pages that are not public are counted but not published.
Kinds of page
| Kind | Pages |
|---|---|
| Home | the home page |
| Article | articles |
| Contributor | blog posts, help and policy pages, proposals, discussions, the forum, contributor profiles |
| Tool | lists, recent changes, search, sign-up and login pages |
How detailed
The counts need to be detailed enough to be useful, and coarse enough that they can never point to a person:
- Per page, per hour: total views only. Kept for 90 days, to see spikes as they happen.
- Per page, per day: views by language, device, where the visit came from, and signed in or not. Kept indefinitely.
- Per page, per day, by country: kept indefinitely. A country with fewer than 3 views of a page on a day is merged into "other countries" before the day is stored.
- Site-wide, per day: views by country, device, where the visit came from, kind of page, and signed in or not.
- Published: everything, except that a figure combining one page with one country is shown as "fewer than 10" when it is below 10.
Country
The country comes from the visitor's IP address, looked up in a country database kept on our own server (the free DB-IP country database, updated monthly). The address is used for the lookup and then dropped: it is never stored with the counts. When the country can't be told, it is counted as "unknown".
Public statistics
- Each article: a "Page statistics" link in the Tools menu. It shows the last 30 days as a chart, views by country (from 10 views), by device and by where visits came from, and the all-time total.
- The whole site: a statistics page with the most read articles today, this week and this month; trending articles (the biggest rise on the week before); countries; and views of articles compared with contributor pages over time.
- Downloads: one compressed CSV file per day, and one per month, next to the database downloads. Public domain, like everything else.
- MCP:
stats_pageViews(one page, a date range, grouped by day, country, device or source) andstats_topPages(the most read pages for a period, optionally for one kind of page or one country).
Not counted
No unique visitors, sessions, paths through the site, time on page, scrolling, or anything else that needs to recognise a reader twice. For signed-in readers, nothing beyond "signed in: yes".
Changes to the guidelines
The privacy policy already allows aggregated page view statistics. These changes describe exactly what is counted, and that it is counted when a page is served rather than from the logs.
1. The short version, first point
Before
If you only read Agpedia, we keep a short-lived server log (including your IP address) for 14 days to keep the site secure. From those logs we also keep anonymous, aggregated statistics, such as how often each article is viewed, which cannot identify you.
After
If you only read Agpedia, we keep a short-lived server log (including your IP address) for 14 days to keep the site secure. We also count how often each page is read, on our own server and without cookies or tracking scripts. The counts cannot identify you, and we publish them.
2. "If you just read the site", the paragraph on statistics
Before
Aggregated statistics: before the logs are deleted, we count things like how many times each article was viewed per day. These counts contain no IP addresses, user-agent strings or anything else that could identify you, so they are not personal data. We may keep the counts indefinitely and publish them, so that we and others can see how articles are read over the years, as Wikipedia does with its pageview data.
After
Page view statistics: when we serve a page, our server adds one to a count for that page. A count records the page, the hour and day, the language the page was shown in, your country, the kind of device (phone, tablet or computer, from the user-agent), where the visit came from (a search engine, another website, one of our ads, a link within Agpedia, or none) and whether you were signed in. Your country is looked up from your IP address in a database on our own server; the address is then dropped and never stored with the counts. The counts contain no IP addresses, user-agent strings, cookies or identifiers, and we never count unique visitors, so they cannot be used to recognise or follow anyone. So that small numbers can't point to individuals, a country with fewer than 3 views of a page on a day is merged into "other countries", and we publish a page's views from one country only from 10 views. We keep the counts indefinitely and publish them, so that we and others can see how articles are read over the years, as Wikipedia does with its pageview data.
3. Cookies, last paragraph
Before
If we add privacy-respecting self-hosted analytics in future, we'll update this policy first, and add a consent mechanism if one is required at that point.
After
Page view statistics need no cookie: they are counted on our server when a page is served (see "If you just read the site").
4. How long we keep things
Before
- Aggregated statistics (such as pageviews per article): may be kept indefinitely and published; they contain no personal data.
After
- Page view statistics: hourly totals per page for 90 days; daily counts indefinitely, and published. They contain no personal data.
5. Legal bases
Before
- Our legitimate interest in a secure, spam-resistant site: server logs and the statistics drawn from them. You can object to this.
After
- Our legitimate interest in a secure, spam-resistant site: server logs. You can object to this.
- Our legitimate interest in knowing how the encyclopedia is read, so we can improve it: page view statistics, including the country lookup. You can object to this.
Not in this proposal
- Measuring our ads: see Proposal: Measuring our ads, which uses the same country lookup.
- Most-read lists on the home page. They become possible once the counts exist, and can be proposed then.
- Statistics about contributors' edits.
Technical notes
- Counting: a middleware on the response's
finishevent counts GET requests for pages that answered 200 with HTML. It classifies the kind of page from the route and the page's namespace, detects bots from the user-agent (for example with theisbotpackage), the device from the user-agent, and the source from the referrer (a list of search engine hosts; the same host is internal) and from ad click parameters. - Storage: counts are kept in memory and written every minute with upserts into four tables: hourly totals per page, daily counts per page by language, device, source and signed-in state, daily counts per page by country, and site-wide daily counts. Rows use page IDs, so a renamed page keeps its history.
- Closing a day (shortly after midnight UTC): small country counts are merged into "other countries", hourly rows older than 90 days are deleted, and the day's download file is written.
- Country database: DB-IP's free country database (CC BY 4.0, credited on the statistics page) in MMDB format, read in memory, updated monthly by a script. The client address comes from
X-Forwarded-Forthrough Express'strust proxysetting. - MCP tools read the same tables and apply the same publishing threshold as the web pages and downloads.
Positions
DiscussionNo one has stated a position yet.