# Topic view tracking rules

**URL:** https://meta.discourse.org/t/topic-view-tracking-rules/25996
**Category:** Feature
**Tags:** rfc, spec
**Created:** [March 5, 2015, 1:32am UTC](https://meta.discourse.org/t/topic-view-tracking-rules/25996 "2015-03-05T01:32:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 5, 2015, 1:32am UTC](https://meta.discourse.org/t/topic-view-tracking-rules/25996/1 "2015-03-05T01:32:39Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 5, 2015, 4:25am UTC](https://meta.discourse.org/t/topic-view-tracking-rules/25996/2 "2015-03-05T04:25:59Z")

</div>

Implemented per:

[https://github.com/discourse/discourse/commit/09e470c98a0021dce1b9c1ac595f8340e7ff26d8](https://github.com/discourse/discourse/commit/09e470c98a0021dce1b9c1ac595f8340e7ff26d8)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 5, 2015, 4:26am UTC](https://meta.discourse.org/t/topic-view-tracking-rules/25996/3 "2015-03-05T04:26:12Z")

</div>


