# Counting users that returned to the website

**URL:** <https://discuss.elastic.co/t/counting-users-that-returned-to-the-website/234454>\
**Category:** Elasticsearch\
**Created:** [May 27, 2020, 4:19am UTC](https://discuss.elastic.co/t/counting-users-that-returned-to-the-website/234454 "2020-05-27T04:19:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Hendrik\_Muhs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hendrik_muhs/32/25802_2.png) [@Hendrik\_Muhs](https://discuss.elastic.co/u/Hendrik_Muhs)\
**Post date:** [May 27, 2020, 7:23am UTC](https://discuss.elastic.co/t/counting-users-that-returned-to-the-website/234454/2 "2020-05-27T07:23:12Z")

</div>

This goes into the same direction as your last [question](https://discuss.elastic.co/t/calculate-daily-new-users-never-seen-before-to-a-website/234404).

Having an entity centric index helps again. If in addition to `min(ts)`, which corresponds to "user first seen" you add a `max(ts)`, which would be "user last seen", you can use a scripted metric to check whether `max - min` is above a threshold you define for "returning user".

---

_[View the full topic](https://discuss.elastic.co/t/counting-users-that-returned-to-the-website/234454)._
