← Store

Django module Planned

Analytics

Know who really visits your Django site, with nothing sent to anyone else. Page views kept in your own database, crawlers and your own visits left out, and reports that tell a person from a script.

What it does

  • Counts each page your Django site serves, from inside Django. No script on your pages, and nothing goes to anyone else's server
  • Keeps the rows in your own database: the address, the time, the site that sent the visitor, the browser's name, the visitor's IP address, and the account if they were signed in
  • Leaves out what isn't a visitor: programs that say they're bots, probes for wp-login.php and .env files, the calls your pages make in the background, and your own visits by address. It can leave out hosting companies' address ranges too, as askrobots.com does
  • Marks those rows instead of counting them, and keeps only a sample of bot visits (one in a hundred on askrobots.com; you set the number), so a crawler can't fill your database. It was written after one added about 500,000 rows a day to askrobots.com's
  • A dashboard for a day, a week, a month, a quarter or a year: page views, visitors and conversions against the period before, top pages with their share, and browsers
  • A live page, refreshed every few seconds: the latest visits with their country, and the visits that got an error or a refusal (a 404 or a 403) with the code they got
  • Visits from other sites, by day and by hour, so after you post a link you can see how many came. Apps that send no referrer, Reddit's among them, are counted beside the rest
  • Every page with its views and visitors, with /ja/about/ and /about/?x=1 merged into one page, and the list exported as CSV or JSON
  • Tells reading from scripting: sessions with several pages, and any over 100 pages marked as a likely script (marked, never hidden)
  • Where people go next, from your newest 2,000 visitor sessions, and one visitor's timeline page by page
  • Reports stop after 20 seconds with a short page, so one slow report can't hold your database

Tested, not only written

Code is quick to write now, by a person or an AI. Knowing it's right is the slow part, and it's what you're buying.

  • More than 260 tests cover it today, inside askrobots.com's own code. They are what turns into the module's tests; run them yourself before you trust it
  • They ran on Django 6.1 with Python 3.14 here today; two of them need PostgreSQL (the report time limit and the merging of language and ?query addresses) and weren't run in that check
  • Written from real trouble, not from a plan: a crawler that wrote half a million rows a day, a polling call that was 22% of a month's views, and /pt/ pages that counted apart from the same pages

What you bring

Nothing to start with. For the country in the live page, a location file: the kind Geo Gate reads (MaxMind GeoLite2 City or DB-IP City Lite). Without one the page just leaves the country out.

Where it comes from

It counts askrobots.com's visitors today. Everything listed here runs there, in askrobots.com's own code. It hasn't been taken out as a module yet, so there's no price and no date. Leave your address and it moves up the list.

Questions

What does it keep about a visitor?

The address they visited, the time, the page that sent them, their browser's name and IP address, and a cookie id from your own site (the cookie is called session_id and lasts a year). Whether you need a notice or consent where your visitors live is for you and your lawyer to decide; we can't say.

Does it slow my site?

It writes one row per counted page, after the page is ready. If counting fails, the error is logged and the page is still served. With the bot sample set low, a crawler's visits are mostly not written at all.

Can it tell every bot?

No. It goes by the browser's name, odd addresses, background calls and, if you list them, hosting companies' address ranges. A bot that looks like a person counts as one; the page of long sessions is there so you can look yourself.

Which database?

It's built for PostgreSQL. Merging /ja/about/ with /about/ and the 20-second report limit need it; on another database the reports show exact addresses.

An older Django?

It ran on Django 6.1 with Python 3.14 today, and older versions are next. Say which one you run in the box when you leave your email, and that version moves up.

Something else?

Get in touch.