07 Feb 2018 01:07 PM - last edited on 30 Sep 2022 01:30 PM by MaciejNeumann
Our application uses an HTML Input tag with a name of j_username on our login page. Is there any way to use the content of this element to identify users in the User Session view? I tried adding it as a javascript variable but the user was then identified as [object HTMLInputElement]. It really needs to access the .value property of the element in the DOM.
Solved! Go to Solution.
08 Feb 2018 09:45 AM
You should be able to use a css selector and get the attribute by using "@", just as described in the hint text below.
So in your case #j_username@value should work (in case the ID is set).
However I do not think it is a good idea to query this value as it might change dynamically, users might mistype their names and try to login and you'll end up with all sorts of incorrect usernames in Dynatrace.
It would be better to use the JS API to report the actual name after the login was successful.
Dominik
22 Nov 2022 08:43 PM
HI @richard_davis , I have exacly the same question from your post, where you able to solve it ?
is there any Tip that you can share with me ?
25 Nov 2022 07:10 PM
@Ignacio_Carrasqif your server side is monitored by OneAgent, you can use request attribute to capture the value when the form data is posted and then set it as the user tag source as described here.