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.
The discussion revolves around whether Discourse will display the number of users watching a topic publicly. riking explains that this feature is unlikely to be exposed to non-admins due to privacy and behavioral concerns (e.g., ‘Number Go Up Syndrome’). However, admins and moderators can use Data Explorer (DE) SQL queries to retrieve this data. tkearsley initially seeks this functionality and later confirms they only need it for internal use. MarkDoerr provides a basic DE query to count watchers across all topics, which tkearsley clarifies can be scoped to a specific topic by filtering topic_id. MarkDoerr confirms this and provides an example. NiceOldGuy enhances the query to report all four notification levels (Muted, Normal, Tracking, Watching) across multiple topics in one pass, using conditional aggregation and an IN clause for topic IDs. The community acknowledges the utility of these queries, and while no official report exists, DE offers a flexible workaround for moderators and admins needing watcher metrics.
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.
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 query that gets this data and mark it as runnable by moderators or employees, if that’s who the requests are coming from.
We would never want this for non-admins. I will try this with the DE.
Was this ability ever added to Discourse reporting?
Were there any updates to this?
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:
Hi Mark,
Thanks. So from this it looks like I cannot perform this function at the topic level. Is this correct?
Tom,
No, you can get that info at a topic level by swapping ‘topic’ for ‘category’ like this:
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:
WHERE
notification_level = 3
AND topic_id = 29
This is great!
Thank you!
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_ids 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!
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