# How to determine what device was used for login in post-login action

**URL:** <https://community.auth0.com/t/how-to-determine-what-device-was-used-for-login-in-post-login-action/88283>\
**Category:** Get Help\
**Created:** [August 5, 2022, 9:37pm UTC](https://community.auth0.com/t/how-to-determine-what-device-was-used-for-login-in-post-login-action/88283 "2022-08-05T21:37:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryan.liszewski](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ryan.liszewski/32/33314_2.png) [@ryan.liszewski](https://community.auth0.com/u/ryan.liszewski)\
**Post date:** [August 5, 2022, 9:37pm UTC](https://community.auth0.com/t/how-to-determine-what-device-was-used-for-login-in-post-login-action/88283/1 "2022-08-05T21:37:14Z")

</div>

Is there an easy way to determine what type of device was used within the `event` or `api` object in a post-login action? A couple of use cases would be to:

1. Add that device info to an analytics login event
2. Count the number of user logins on desktop vs mobile for a web app.

The only field that I see that might work would be the `event.request.user_agent` but I’m not sure how consistent that is and looks like that would require some string parsing to determine mobile vs desktop. I’ve also seen `isMobile` present in the log details but haven’t seen any way in accessing those via an Action.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [August 5, 2022, 11:00pm UTC](https://community.auth0.com/t/how-to-determine-what-device-was-used-for-login-in-post-login-action/88283/2 "2022-08-05T23:00:48Z")

</div>

Hello @ryan.liszewski welcome to the community!

> [@ryan.liszewski](#):
>
> Is there an easy way to determine what type of device was used within the `event` or `api` object in a post-login action?

I’m unfortunately not seeing much either outside of `user_agent` like you mentioned - This could be a good candidate for a [feedback request](https://community.auth0.com/c/feedback/95) if you’d like.

Outside of the context of an Action, [Log Streams](https://auth0.com/docs/customize/log-streams) might be something of interest in terms of gathering analytics.

> **[Log streaming: What it is and why it matters](https://auth0.com/blog/log-streaming--what-it-is-and-why-it-matters/)**
>
> Learn the business value of log streaming services and how third-party solutions from Auth0 Marketplace can help you enable real-time mon...

---

<div class="post-metadata">

**Author:** ![shannon.paige](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shannon.paige/32/13031_2.png) [@shannon.paige](https://community.auth0.com/u/shannon.paige)\
**Post date:** [August 15, 2022, 11:03pm UTC](https://community.auth0.com/t/how-to-determine-what-device-was-used-for-login-in-post-login-action/88283/4 "2022-08-15T23:03:26Z")

</div>

We’ve been passing info in via params to the request and then can access them actions, for example `event?.request?.query?.device_id`

At a higher level, we set up our ios, android and web logins to be separate connections, so that helps distinguish them as well.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [August 24, 2022, 1:42am UTC](https://community.auth0.com/t/how-to-determine-what-device-was-used-for-login-in-post-login-action/88283/5 "2022-08-24T01:42:28Z")

</div>

Thanks for sharing with the community @shannon.paige, very helpful! 😄

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [September 8, 2022, 1:43am UTC](https://community.auth0.com/t/how-to-determine-what-device-was-used-for-login-in-post-login-action/88283/6 "2022-09-08T01:43:07Z")

</div>

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