# Counting Pageviews for users (non-staff, non-crawler)

**URL:** <https://meta.discourse.org/t/counting-pageviews-for-users-non-staff-non-crawler/157071>\
**Category:** Data & reporting\
**Created:** [July 7, 2020, 7:24pm UTC](https://meta.discourse.org/t/counting-pageviews-for-users-non-staff-non-crawler/157071 "2020-07-07T19:24:14Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [July 7, 2020, 9:23pm UTC](https://meta.discourse.org/t/counting-pageviews-for-users-non-staff-non-crawler/157071/5 "2020-07-07T21:23:06Z")

</div>

The Page Views report queries the `application_requests` table. That table doesn’t give any data for filtering out staff views though. What it returns is a sum of the number of requests of each type per day. The `req_type` is returned as an integer. The integers are mapped to the type of request with the following rules:

```plaintext
"http_total"=>0,
"http_2xx"=>1,
"http_background"=>2,
"http_3xx"=>3,
"http_4xx"=>4,
"http_5xx"=>5,
"page_view_crawler"=>6,
"page_view_logged_in"=>7,
"page_view_anon"=>8,
"page_view_logged_in_mobile"=>9,
"page_view_anon_mobile"=>10

```

The `topic_views` table that your query is using returns a maximum of one entry per user or IP address per day per topic. This data can’t be used for tracking page views - there could be multiple application requests for a single topic view.

---

_[View the full topic](https://meta.discourse.org/t/counting-pageviews-for-users-non-staff-non-crawler/157071)._
