# Hoe te vinden hoe lang een gebruiker een onderwerp heeft bekeken/wie nieuwe onderwerpen heeft geplaatst/land van gebruikers

**URL:** https://meta.discourse.org/t/how-to-find-how-long-a-user-has-viewed-a-topic-who-has-posted-new-topics-country-of-users/287604
**Category:** Data & reporting
**Created:** [5 december 2023 om 16:55 UTC](https://meta.discourse.org/t/how-to-find-how-long-a-user-has-viewed-a-topic-who-has-posted-new-topics-country-of-users/287604 "2023-12-05T16:55:35Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![jericson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jericson/32/116215_2.png) [@jericson](https://meta.discourse.org/u/jericson)
#### Post date: [5 december 2023 om 21:30 UTC](https://meta.discourse.org/t/how-to-find-how-long-a-user-has-viewed-a-topic-who-has-posted-new-topics-country-of-users/287604/2 "2023-12-05T21:30:58Z")

</div>

I assume you have [Data Explorer installed](https://meta.discourse.org/t/discourse-data-explorer/32566).

> [@Maayan\_Mizrahi](#):
>
> How long do users stay on the page of specific topic? Can I get the information from post\_timings table? or should I take it from other source?

It looks like you can get it from `post_timings`:

```plaintext
select topic_id,
       count(user_id) users,
       round(sum(msecs/(60*1000.0)),2)/count(user_id) avg_minutes
from post_timings
group by topic_id
order by avg(msecs) desc

```

I should note that only includes people who registered. You might want to use Google Analytics to get all readers.

> [@Maayan\_Mizrahi](#):
>
> Where can I find the data of users who have posted new topic?

I’m not sure what data you are looking for. Here’s how to find each user’s first post:

```plaintext
select p.id post_id
from posts p
where p.id = (select min(id) from posts where user_id = p.user_id)

```

Add `and post_number = 1` if you want to find users who started by posting a new topic rather than starting by replying to an existing topic. Not sure if either of these are helpful.

> [@Maayan\_Mizrahi](#):
>
> Where can I get the country of the user?

People can enter their location, which might even be recognizable as a country:

```plaintext
select user_id, location
from user_profiles

```

In my experience, people don’t usually bother. So Google Analytics might be more useful.

There’s also `ip_address` in the `users` table, which can be used to look up location data.

---

_[View the full topic](https://meta.discourse.org/t/how-to-find-how-long-a-user-has-viewed-a-topic-who-has-posted-new-topics-country-of-users/287604)._
