# Het aantal kijkers weten

**URL:** https://meta.discourse.org/t/knowing-the-number-of-watchers/190941
**Category:** Feature
**Tags:** data-explorer, sql-query
**Created:** [19 mei 2021 om 16:37 UTC](https://meta.discourse.org/t/knowing-the-number-of-watchers/190941 "2021-05-19T16:37:40Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![tkearsley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tkearsley/32/155788_2.png) [@tkearsley](https://meta.discourse.org/u/tkearsley)
#### Post date: [19 mei 2021 om 16:37 UTC](https://meta.discourse.org/t/knowing-the-number-of-watchers/190941/1 "2021-05-19T16:37:40Z")

</div>

I think I bought this up way back when I first started testing the platform.  
Will there ever be a way to know how many people are subscribing (watching) a particular topic?

I am being asked for this information more often these days.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [19 mei 2021 om 17:50 UTC](https://meta.discourse.org/t/knowing-the-number-of-watchers/190941/2 "2021-05-19T17:50:34Z")

</div>

This seems unlikely to ever be added as visible to non-administrators.

The freedom of individual users to choose how they want to consume the forum is important, and giving special consideration to Watching a topic by making the number visible to everyone is likely to create bad behavior patterns. (Number Go Up Syndrome is very powerful.)

You should be able to take a [Data Explorer](https://meta.discourse.org/t/32566?silent=true) query that gets this data and mark it as runnable by moderators or employees, if that’s who the requests are coming from.

---

<div class="post-metadata">

### Author: ![tkearsley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tkearsley/32/155788_2.png) [@tkearsley](https://meta.discourse.org/u/tkearsley)
#### Post date: [19 mei 2021 om 18:04 UTC](https://meta.discourse.org/t/knowing-the-number-of-watchers/190941/3 "2021-05-19T18:04:44Z")

</div>

We would never want this for non-admins. I will try this with the DE.

---

<div class="post-metadata">

### Author: ![tkearsley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tkearsley/32/155788_2.png) [@tkearsley](https://meta.discourse.org/u/tkearsley)
#### Post date: [19 juli 2021 om 17:23 UTC](https://meta.discourse.org/t/knowing-the-number-of-watchers/190941/4 "2021-07-19T17:23:08Z")

</div>

Was this ability ever added to Discourse reporting?

---

<div class="post-metadata">

### Author: ![tkearsley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tkearsley/32/155788_2.png) [@tkearsley](https://meta.discourse.org/u/tkearsley)
#### Post date: [22 juni 2022 om 20:38 UTC](https://meta.discourse.org/t/knowing-the-number-of-watchers/190941/5 "2022-06-22T20:38:41Z")

</div>

Were there any updates to this?

---

<div class="post-metadata">

### Author: ![MarkDoerr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markdoerr/32/549630_2.png) [@MarkDoerr](https://meta.discourse.org/u/MarkDoerr)
#### Post date: [22 juni 2022 om 21:23 UTC](https://meta.discourse.org/t/knowing-the-number-of-watchers/190941/7 "2022-06-22T21:23:15Z")

</div>

Hi Tom,

This has not been added as a default DE report. However I found a topic that provides a basic DE query to pull this information, maybe that will be helpful:

> [@Finding out how many users are watching or tracking?](https://meta.discourse.org/t/finding-out-how-many-users-are-watching-or-tracking/56900/2):
>
> There are “\_user” tables. category\_users, topic\_users, group\_users and tag\_users Each has a notification\_level field where the integer indicates a members preference - 0 Muted, 1 Normal, 2 Tracked, 3 Watched So a query something like this should work SELECT COUNT(id) FROM category\_users WHERE notification\_level = 3 GROUP BY category\_id to give you how many are Watching each category.

---

<div class="post-metadata">

### Author: ![tkearsley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tkearsley/32/155788_2.png) [@tkearsley](https://meta.discourse.org/u/tkearsley)
#### Post date: [22 juni 2022 om 21:59 UTC](https://meta.discourse.org/t/knowing-the-number-of-watchers/190941/8 "2022-06-22T21:59:42Z")

</div>

Hi Mark,

Thanks. So from this it looks like I cannot perform this function at the topic level. Is this correct?

---

<div class="post-metadata">

### Author: ![MarkDoerr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markdoerr/32/549630_2.png) [@MarkDoerr](https://meta.discourse.org/u/MarkDoerr)
#### Post date: [22 juni 2022 om 22:34 UTC](https://meta.discourse.org/t/knowing-the-number-of-watchers/190941/9 "2022-06-22T22:34:56Z")

</div>

Tom,

No, you can get that info at a topic level by swapping ‘topic’ for ‘category’ like this:

```plaintext
SELECT 
  COUNT(topic_id)
FROM 
  topic_users 
WHERE 
  notification_level = 3

```

Again, this is a very basic query that just returns a total count of watchers from…in this case…all topics. If you want to specify a particular topic, you could add to the WHERE clause, e.g:

```plaintext
WHERE 
  notification_level = 3
  AND topic_id = 29

```

---

<div class="post-metadata">

### Author: ![tkearsley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tkearsley/32/155788_2.png) [@tkearsley](https://meta.discourse.org/u/tkearsley)
#### Post date: [22 juni 2022 om 22:46 UTC](https://meta.discourse.org/t/knowing-the-number-of-watchers/190941/10 "2022-06-22T22:46:00Z")

</div>

This is great!

Thank you!

---

<div class="post-metadata">

### Author: ![NiceOldGuy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/niceoldguy/32/326207_2.png) [@NiceOldGuy](https://meta.discourse.org/u/NiceOldGuy)
#### Post date: [17 april 2024 om 17:27 UTC](https://meta.discourse.org/t/knowing-the-number-of-watchers/190941/11 "2024-04-17T17:27:29Z")

</div>

This is very useful, thanks @MarkDoerr. I modified the query to report on all four notification levels in one pass, and to take an array of `topic_id`s if needed.  
The full grid output table isn’t pretty but has all the info I need.

edit: of course as soon as I posted, Discourse kindly showed me six links with other ways of solving this! Query on!

```plaintext
SELECT 
  topic_id,
  notification_level,
  COUNT(CASE WHEN notification_level = 0 THEN topic_id END) AS Muted_0,
  COUNT(CASE WHEN notification_level = 1 THEN topic_id END) AS Normal_1,
  COUNT(CASE WHEN notification_level = 2 THEN topic_id END) AS Tracking_2,
  COUNT(CASE WHEN notification_level = 3 THEN topic_id END) AS Watching_3
FROM 
  topic_users 
WHERE 
  topic_id IN (9831, 9572, 9424, 7567) -- Add your topic_ids here
GROUP BY
  topic_id, notification_level

```
