Summary: The post shows how to create CSS selector rules to capture usernames or IDs in Dynatrace RUM. It includes tips for validating selectors and ensuring consistent tag extraction.
Hey guys,
I’m in the midst of deploying Dynatrace Managed for a customer, and I’m not really familiar with the CSS part for user tagging. We have identified the CSS element that contains the user name, but I’m just not too sure if the configuration is correct. Could you help me verify?
Attached is a screenshot, and the highlighted part is the user name we want to capture. Would “#navTabButtonUserInfoText navTabButtonUserInfoWorker@title” work? As I will not be on-site until next week and the customer is new to the product, I’d just thought of getting opinions here first…
First, capture the correct CSS selector by selecting your element from the WebGUI, then click right and select Inspect. You have this option in Chrome and Firefox, not in IE.
In some cases, that may not be sufficient because you are capturing extra characters or strings. Then use a regex that you will put under the “Apply cleanup rule” option in the “User tag” rule of your Dynatrace application.
I followed the same instructions to copy the selector and this is what I input into the app config for user tagging. It still keep the User names in sessions as Anonymous:
#page-main-container > div.bmo-container > div:nth-child(1) > a > span
Am I missing something here which is not letting the user tag parse through?
Did you test the selector in the dev tools console as covered in the PPT above? I am no CSS expert, but you might want to try a selector of “.check-dirty user-name” and see if that works should be less “brittle” than the selector you are trying now.