# Finding the login count of my users

**URL:** <https://community.auth0.com/t/finding-the-login-count-of-my-users/96925>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [December 21, 2022, 7:11pm UTC](https://community.auth0.com/t/finding-the-login-count-of-my-users/96925 "2022-12-21T19:11:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kilian3005](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kilian3005/32/42113_2.png) [@Kilian3005](https://community.auth0.com/u/Kilian3005)\
**Post date:** [December 21, 2022, 7:11pm UTC](https://community.auth0.com/t/finding-the-login-count-of-my-users/96925/1 "2022-12-21T19:11:27Z")

</div>

Hello, i am a new user and would like to find the login count of a user so that i can send a welcome email to my new users. I have read about var loginCount = ctx.stats.loginsCount but don’t really know how that works and i’m also using koa so idk if it works with that. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![narayanak](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/narayanak/32/33791_2.png) [@narayanak](https://community.auth0.com/u/narayanak)\
**Post date:** [December 21, 2022, 9:18pm UTC](https://community.auth0.com/t/finding-the-login-count-of-my-users/96925/2 "2022-12-21T21:18:58Z")

</div>

You can have an action as part of the Login Flows and capture this detail.

```auto
exports.onExecutePostLogin = async (event, api) => {

if (event.stats.logins_count == 1) {
    /* what would you like to do? */
  }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [January 4, 2023, 9:19pm UTC](https://community.auth0.com/t/finding-the-login-count-of-my-users/96925/3 "2023-01-04T21:19:31Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
