Woon J. avatar image
Woon J. asked ·

Configuring User Tag on Dynatrace Managed

Hi all,

I would like to configure user tag on dynatrace managed.

The thing I want to capture is the email address used for login on this page

I have gone through the document

However, I could not understand the document very well.

Appreciate if someone could help me.



documentationuser tagging
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Alexander S. avatar image
Alexander S. answered ·

As Julius has already mentioned, you can try to identify users by capturing values by looking at cookies, meta-tags, global JS variables or CSS selectors.
While this sounds the better approach, as you don't need to touch the html source, it might not work for every application and it might break if for example the CSS selector id is changed. Using the JavaScript API function "dtrum.identifyUser("")" is the most flexible way.
Please look at the global settings - web and mobile monitoring - custom user actions and download the documentation and samples for our JavaScript API if you want to use the JavaScript API.
Keep in mind that only finished user session (timeout is 30 minutes after the last user action) are visible in the UI. For testing, you can end a user session by entering the following line in the console of your browser: dtrum.endSession();
After this call it last about 2,3 minutes till you see your user session within the UI.

3 comments Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Hi Alex,

Thanks for answering, and emailing me. I have replied you through email, regarding my issue. Appreciate your reply.


0 Likes 0 · ·

Hi Alexander,

can you please provide the exact code block that must be added to identify the user? Also an example/code block for the endSession() usage would be great

I suppose it should also include a check that the dtrum library is there, right?

We want to pass this information to the development team.

Thank you,


0 Likes 0 · ·

Just download the JavaScript API samples and API docs from your tenant. This includes examples of user tagging as well as endSession and many other API usage situations.

It's available from your tenant in Settings -> Web & mobile monitoring -> Custom user actions.

You should definitely check if the dtrum object is available, so no error is thrown in case monitoring is disabled or the dynatrace script failed to load for some reason.

0 Likes 0 · ·
Julius L. avatar image
Julius L. answered ·

There are actually two different options to accomplish this. First is described in the URL and it's just a matter of configuration in Dynatrace UI. When you open the application settings, you can specify the user tag. With this option you can specify username based on four different options (Cookie name, Meta tag, Javascript variable or CSS selector) - all is done by the ruxitagent javascript code and you don't have to change anything in the page source code.

Second approach is to call the Javascript function (you supply the user name as the parameter):


With this approach you will need to modify the page source code to call this function.

I recommend to try the first option if possible. Use the second option only if the username cannot be obtained by on the the four methods above.

Please be aware that there is some user tag persistence across sessions the the UI. I'd recommend to clear your cookies when testing the user tag definition, since your sessions might have the AnonymousXXXXX tag even if your user tag definition is correct. (Happened to me few times). The usertag will correctly assigned for new sessions.

10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Space Topics

mobile monitoring dotnet synthetic monitoring reports iis chat kubernetes servicenow amazon web services mysql mainframe rest api errors cassandra dashboard oneagent sdk cmc application monitoring openkit smartscape request attributes monitoring developer community user tagging log monitoring services ufo syntheticadvisory activegate ip addresses auto-detection high five award oracle hyperion webserver uem usql iib test automation license web performance monitoring ios news migration management zones index ibm mq web services custom event alerts notifications sso host monitoring knowledge sharing reports browser monitors java hybris sap vmware maintenance window user action naming javascript appmon ai synthetic classic availability tipstricks automation extensions diagnostic tools session replay permissions davis assistant faq documentation problem detection http monitors server easytravel apdex aws-quickstart network docker tags and metadata cloud foundry google cloud platform synthetic monitoring process groups account usability dynatrace saas gui paas openshift key user actions administration user actions postgresql synthetic locations oneagent security Dynatrace Managed user management custom python technologies mongodb openstack user session monitoring continuous delivery citrix configuration alerting NGINX timestamp action naming linux nam installation masking error reporting database mission control jmeter recorder apache mobileapp RUM php threshold azure purepath davis scripting agent aix nodejs android