# Как отследить, какие пользователи просматривали определённую тему?

**URL:** https://meta.discourse.org/t/how-to-track-which-users-viewed-a-particular-topic/161260
**Category:** Feature
**Created:** [18.Август.2020 10:57:06 UTC](https://meta.discourse.org/t/how-to-track-which-users-viewed-a-particular-topic/161260 "2020-08-18T10:57:06Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Monika\_Gupta](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/monika_gupta/32/164914_2.png) [@Monika\_Gupta](https://meta.discourse.org/u/Monika_Gupta)
#### Post date: [18.Август.2020 10:57:06 UTC](https://meta.discourse.org/t/how-to-track-which-users-viewed-a-particular-topic/161260/1 "2020-08-18T10:57:06Z")

</div>

Как мы можем отслеживать «список пользователей», просмотревших определённую тему?

---

<div class="post-metadata">

### Author: ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://meta.discourse.org/u/EricGT)
#### Post date: [18.Август.2020 11:17:58 UTC](https://meta.discourse.org/t/how-to-track-which-users-viewed-a-particular-topic/161260/2 "2020-08-18T11:17:58Z")

</div>

Два уточнения, которые я бы сделал, или, по крайней мере, в моём конкретном случае, заключаются в том, что это должно быть детализировано вплоть до поста, и должен быть установлен минимальный срок просмотра поста.

Хотя мне не нужен удобный графический интерфейс, так как, полагаю, имея административный доступ к базе данных PostgreSQL, можно выполнить запрос.

---

<div class="post-metadata">

### Author: ![Mevo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mevo/32/187732_2.png) [@Mevo](https://meta.discourse.org/u/Mevo)
#### Post date: [18.Август.2020 11:46:32 UTC](https://meta.discourse.org/t/how-to-track-which-users-viewed-a-particular-topic/161260/3 "2020-08-18T11:46:32Z")

</div>

Ответ от Hawk в другой теме, который, вероятно, также отвечает на ваш вопрос:

> [@HAWK](#):
>
> Подключите Google Analytics, и вы сможете получить более детальную информацию о путях пользователей.

Если вы это сделаете, возможно, потребуется решить вопрос с согласием на использование cookie.

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [18.Август.2020 11:50:12 UTC](https://meta.discourse.org/t/how-to-track-which-users-viewed-a-particular-topic/161260/4 "2020-08-18T11:50:12Z")

</div>

> [@EricGT](#):
>
> Хотя мне и не нужен удобный графический интерфейс, так как я предполагаю, что имея доступ администратора к базе данных PostgreSQL, можно выполнить запрос.

Да, и…

Это можно сделать с помощью #plugin:data-explorer

---

<div class="post-metadata">

### Author: ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://meta.discourse.org/u/EricGT)
#### Post date: [18.Август.2020 11:56:14 UTC](https://meta.discourse.org/t/how-to-track-which-users-viewed-a-particular-topic/161260/5 "2020-08-18T11:56:14Z")

</div>

> [@mcwumbly](#):
>
> Это можно было бы сделать с помощью #plugin:data-explorer

Спасибо.

Хотя у меня нет доступа к [Data Explorer](https://meta.discourse.org/t/32566?silent=true), я провёл проверку запросов и нашёл:

[Просмотры тем по дате](https://meta.discourse.org/t/topic-reads-by-date/153515)

или, как обратный индекс,  
[Возможно ли увидеть темы, которые просматривал пользователь?](https://meta.discourse.org/t/is-it-possible-to-see-the-topics-a-user-has-viewed/155413)

Кажется, есть ещё одна тема со списком полезных запросов для [Data Explorer](https://meta.discourse.org/t/32566?silent=true), но в данный момент я не могу её найти.

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [18.Август.2020 15:36:32 UTC](https://meta.discourse.org/t/how-to-track-which-users-viewed-a-particular-topic/161260/6 "2020-08-18T15:36:32Z")

</div>

Похоже, что в упомянутом вами посте действительно есть пример:

> [@ditatompel](#):
>
> # Кто (вошедший пользователь) просматривает конкретную тему
> 
> ```plaintext
> -- [params]
> -- int :topic_id = 1
> 
> SELECT
> title,
> viewed_at,
> tv.user_id
> FROM topics t
> LEFT JOIN topic_views tv
> ON t.id = tv.topic_id
> WHERE category_id IS NOT NULL
> AND tv.user_id IS NOT NULL
> AND t.id = :topic_id
> ORDER BY viewed_at DESC
> LIMIT 1000
> 
> ```

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [18.Август.2020 15:38:50 UTC](https://meta.discourse.org/t/how-to-track-which-users-viewed-a-particular-topic/161260/7 "2020-08-18T15:38:50Z")

</div>

Также связано:

> [@Delivered and read notifications?](https://meta.discourse.org/t/delivered-and-read-notifications/117931/14):
>
> Hmmm since this topic was last posted we did build this feature for group messages: So yeah, a lot of the mechanics are in core, its just a question of how many toggles we want to give people. I can see the appeal in personal messages that are not group messages to “know” that you were read, but there are privacy concerns and I am not sure how many toggles should be provided.

И:

> [@Publish group read state](https://meta.discourse.org/t/publish-group-read-state/142927):
>
> When in a group, knowing if another user reads a message can be quite useful. A couple of months ago we added the experimental “Publish read state” feature, which after a lot of tweaks is now ready to be safely used. As you may have noticed, this shows who read which post. It adds a new icon and the reader’s count just before the likes: [Screen Shot 2020-02-27 at 15.03.02] If you click the icon, you can also see the reader’s avatars (it works the same way that likes). You will only count as a…
