See who viewed topic

Is there a way to see all users that viewed a topic? Just curious who is viewing and not replying.

if there is a way, can it be locked to a certain security group?

1 Like

This data is in the database but there is no UI to view it.

1 Like

This could be a nice item for the admin/wrench menu some day…

2 Likes

Since this is not an ability to use via the UI. Should this topic be moved over to the suggestions category?

Thanks for replying, awesome support. Very much appreciate everyone here. Its crazy how awesome support is compared to all other companies, this is what sets Discourse apart from others on top of the forum itself. great , great, great!!!

2 Likes

We are looking at this for personal messages, specifically, where staff can check to see who has seen important messages.

7 Likes

I see there’s be no message traffic on this post for some time. And, there is still no ability to see who has viewed posts. I can understand why this might be a bit unwieldy is lots of people viewed a particular topic, but if the list was small, it would be good a moderator to be able to see who looked and did nothing more. IMHO.

I don’t know how much work, if any, has gone into making this a feature. But if you use the Data Explorer plugin you can query the topic_users table to find out who has seen a topic. Maybe JOIN with the posts table to see who has visited the topic and who has posted a reply in it?

Hi,Jeff,
Someway,how can we see what topic some user have viewed?
thank you

Yes, you can do this with the Data Explorer Plugin; which means, only staff can do it.

4 Likes

thanks,it helps me。:smiley:

I’ve got a Data Explorer query for this (which shows username to enable csv / groups / pms stuff):

-- Who viewed this topic? https://meta.discourse.org/t/see-who-viewed-topic/29277/11
-- [params]
-- int :topic_id
SELECT tu.user_id, u.username, total_msecs_viewed/1000 AS seconds_viewed
FROM topic_users tu
JOIN users u ON tu.user_id  = u.id
WHERE tu.topic_id = :topic_id
    AND total_msecs_viewed > 0
GROUP BY tu.user_id, u.username, tu.total_msecs_viewed
ORDER BY tu.total_msecs_viewed desc

If it is okay in your context to reveal email addresses, then I suggest this one instead:

-- Who viewed this topic? With emails. https://meta.discourse.org/t/see-who-viewed-topic/29277/11
-- [params]
-- int :topic_id
SELECT tu.user_id, email, total_msecs_viewed/1000 AS seconds_viewed
FROM topic_users tu
JOIN user_emails ue ON tu.user_id  = ue.user_id
WHERE tu.topic_id = :topic_id
    AND total_msecs_viewed > 0
GROUP BY tu.user_id, ue.email, tu.total_msecs_viewed
ORDER BY tu.total_msecs_viewed desc
1 Like