Topic view tracking rules

Here’s how view tracking should work (but does not currently)

Given that we have either one of

  • a unique IP address
  • an account ID / username for a logged in user

… and we prefer account when we have it …

We shall count a “topic view” as a visit to the topic by this particular IP or account in the last 8 hours.

Thus, if the IP or account visits the topic again after 9 hours, that is another visit, and the view counter will increment for the topic.

The time interval will be controllable via a site setting that determines the number of hours before we consider a return visit another unique visit. This site setting will default to 8 hours.

This should work the same for all users, anonymous or logged in; obviously we won’t have accounts for the anonymous users, but we will have IPs.

2 Likes

Implemented per:

https://github.com/discourse/discourse/commit/09e470c98a0021dce1b9c1ac595f8340e7ff26d8

2 Likes