20 Sep 2018 10:26 PM - last edited on 30 Sep 2022 01:13 PM by MaciejNeumann
We are finding we get a lot of anonymous tags because the value is being picked up from the logon page where the real name is not available. We would like to exclude this page so a true ID can be picked up rather than the anonymous value. Would someone know if this is possible. As 99% of the visits are coming in as anonymous.
Solved! Go to Solution.
21 Sep 2018 08:15 AM
If you are seeing a lot of anonymous visits, you probably have picked a spot for your User Tag that not all users of the application visit in every session.
You should take the User Tag from a place that a high percentage of users visits every session, or something that is always set after login, e.g. a Javascript vaiable.
21 Sep 2018 02:32 PM
David D is asking about my application. The User Tag appears in the header of every page of our site except the login page, because we obviously don't know the username yet.
22 Sep 2018 03:55 PM
Thanks Patrick for your insight! Appreciate it. What Thom is running into is that he has a User Tag in the header of every page except for the login page. And yet Dynatrace insists on picking up the Anonymous of that login page, rather than once logged in using the User Tag from an other page that would have the ID in it. So I was looking to understand why this was, and a creative way to solve it for example if there was a way to exclude the login page.
Thanks,
David
24 Sep 2018 10:11 AM
Okay I get your problem now. There is no way to exclude certain pages from user tagging.
If there is no other way to define the user tag, you would have to either create an RFE or open a support case.
24 Sep 2018 07:35 PM
Optionally, you can go a cleaner route and use the dtrum function and pass the value in via JS. Here's an example of some JS code you can use with our DTRUM adk where it will only pass the username when the value is not the default. The DTRUM adk is already baked into the RUM agent, so you only need to add the function to your page. In the example below, the default value for user-accout.title is 'Login / Register'. What this does is evaluate the value, and if it does not contain the word Login, it passes the user name.
<script type="text/javascript" >
window.addEventListener("load", function(){
var username = $('.user-account').attr('title');
if (username.indexOf('Login')== -1){
username = username.replace('User: ','');
dtrum.identifyUser(username);
}
});
</script>
25 Sep 2018 08:29 PM
Thanks Patrick and Brian for your insight. This idea from Brian looks like it can have a lot of potential. I'll pass it to Thom if he hasn't seen it yet. Thanks again! really appreciate it!
David