# Record time\_read in user\_visits?

**URL:** https://meta.discourse.org/t/record-time-read-in-user-visits/61405
**Category:** Support
**Created:** [April 21, 2017, 7:40pm UTC](https://meta.discourse.org/t/record-time-read-in-user-visits/61405 "2017-04-21T19:40:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sagar](https://meta.discourse.org/u/sagar)
#### Post date: [April 21, 2017, 7:40pm UTC](https://meta.discourse.org/t/record-time-read-in-user-visits/61405/1 "2017-04-21T19:40:46Z")

</div>

I’ve been digging around in our db to get some metrics for our users. I see a user\_visits table that keeps track of posts\_read in that visit.

Is there some value in adding time\_read to this, to get how much time the user spent in that visit? Is there some plugin that does this already?

(I know this is possible with Google Analytics; I was just curious if there was a way to get those numbers in the discourse db)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 21, 2017, 7:48pm UTC](https://meta.discourse.org/t/record-time-read-in-user-visits/61405/2 "2017-04-21T19:48:49Z")

</div>

We have `time_read` (along with many others like `days_visited`, `posts_read_count`, `topics_entered`, etc) in the `user_stats` table. But this is overall, not by visit.

---

<div class="post-metadata">

### Author: ![sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sagar](https://meta.discourse.org/u/sagar)
#### Post date: [April 21, 2017, 8:33pm UTC](https://meta.discourse.org/t/record-time-read-in-user-visits/61405/3 "2017-04-21T20:33:42Z")

</div>

Hmm. yeah. The overall time\_read can be useful, but not if we want to look at user behavior over time.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [April 22, 2017, 12:18am UTC](https://meta.discourse.org/t/record-time-read-in-user-visits/61405/4 "2017-04-22T00:18:03Z")

</div>

There is the `topic_users` table that has `last_visited_at` and `total_msecs_viewed`  
I don’t see how progress through an individual topic could be graphed over time because AFAIK `total_msecs_viewed` Is cumulative.  
But I think the table could be used to get an imperfect hint at reading activity across topics over time.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [October 17, 2022, 1:55pm UTC](https://meta.discourse.org/t/record-time-read-in-user-visits/61405/7 "2022-10-17T13:55:54Z")

</div>


