# In User Session Tab some of the usernames are appearing as Anonymous

**URL:** <https://community.dynatrace.com/t/in-user-session-tab-some-of-the-usernames-are-appearing-as-anonymous/18760>\
**Category:** Real User Monitoring\
**Tags:** user-sessions\
**Created:** [December 10, 2018, 4:11am UTC](https://community.dynatrace.com/t/in-user-session-tab-some-of-the-usernames-are-appearing-as-anonymous/18760 "2018-12-10T04:11:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsam2](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@jsam2](https://community.dynatrace.com/u/jsam2)\
**Post date:** [December 10, 2018, 4:11am UTC](https://community.dynatrace.com/t/in-user-session-tab-some-of-the-usernames-are-appearing-as-anonymous/18760/1 "2018-12-10T04:11:13Z")

</div>

In User Session Tab some of the usernames are appearing as Anonymous, any workaround/resolution for this?

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [December 10, 2018, 7:02am UTC](https://community.dynatrace.com/t/in-user-session-tab-some-of-the-usernames-are-appearing-as-anonymous/18760/2 "2018-12-10T07:02:03Z")

</div>

It will work like this if for those sessions user tag will be unavaiilable. You have to be sure that all anonymous are logged in. Another thing it’s that if you are taking user tag value from place that is not accessed by all singed in users, it also be like in you case. What rule you are using?

Regards,

Sebastian

---

<div class="post-metadata">

**Author:** ![jsam2](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@jsam2](https://community.dynatrace.com/u/jsam2)\
**Post date:** [December 11, 2018, 5:19am UTC](https://community.dynatrace.com/t/in-user-session-tab-some-of-the-usernames-are-appearing-as-anonymous/18760/3 "2018-12-11T05:19:36Z")

</div>

![19134-css-rule.png](https://global.discourse-cdn.com/dynatrace/original/2X/e/e3cdc479a77f1514aa2991b873aa41ab6b132c7a.png)

PFA screenshot of rule I’m using

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [December 11, 2018, 11:10am UTC](https://community.dynatrace.com/t/in-user-session-tab-some-of-the-usernames-are-appearing-as-anonymous/18760/4 "2018-12-11T11:10:14Z")

</div>

This rule will only work for users that has this element available and have value in it. If some of them are not signed in etc their sessions will be anonymous.

---

<div class="post-metadata">

**Author:** ![pahofmann](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pahofmann/32/17076_2.png) [@pahofmann](https://community.dynatrace.com/u/pahofmann)\
**Post date:** [December 12, 2018, 10:17am UTC](https://community.dynatrace.com/t/in-user-session-tab-some-of-the-usernames-are-appearing-as-anonymous/18760/5 "2018-12-12T10:17:01Z")

</div>

The most reliable solution to always get a user tag is to call _dtrum.identifyUser(“YourUserTag”)_ via the [JavaScript API](https://www.dynatrace.com/support/help/shortlink/user-tagging#user-tagging-via-the-dynatrace-javascript-api) of the agent.

If you use a CSS Selector that is only on a specific page for example, the user tag is only picked up if the user visits that page.

Using JavaScript variable that is always present would be another option.
