Hey all,
I’m trying to extract a user action name where the action is triggered by a click on a shadow-dom object. Framework being used is Vaadin (https://vaadin.com/). The attribute I could use is the id of the shadow host element around it.
I’m trying the :host @id selector but doesn’t seem to work. Has anybody ever got it working with pages using shadow doms?
best,
Torsten
@TorstenHellwig in the past I tried to get this working with uanpi configuration but without any success. I also debugged the RUM code to find out it does not follow from shadow DOM. I think I even opened a product idea on that but I can’t find it anymore.
But my experience dates back ~3 years. Maybe this changed.
Ok, it seems not. I checked with 1.345 and the iteration when determining user action name is the same.
Generally, I would go the route of sending the user action name using dtrum (RUM classic) / dynatrace (Gen3 RUM) API if it fits your case, but this requires an app code change. On the other hand, you are ready to move to gen3 where you need to send the user action name from code anyway.
Hi Julius, thx for the quick reply. dtrum-JS SDK was my reccommendation too. Seems the the whole app is some sort of bought software/framework where they have limited possibilities. data-dtname attribute was a no-go.
They are still on managed - from reading I’d say with gen3 and new RUM open shadow dom may work but classic won’t.
@TorstenHellwig last time I needed, Gen3 did not have any option to reuse data-dt-name, Gen3 was designed that any modifications require use of APIs.
I was reading this in the Semantic Dictionary:
ui_element.xpath |
string[] |
experimental For web only. The xpath of the user interface element split as an array. If the element is inside a shadow DOM, only the outer part is considered. |
['//*[@id="cart"]', 'div', 'div'] |
Like this would be a data field I’d get from a RUM on Grail user interaction. But I’ll try this when they are migrated.
Sure, but that’s not the user action name, but it captures the xpath.
And that should contain the name I’m looking for. Inside the shadow dom it’s just ‘slot’. Outside there is an attribute. Btw. data-dt-name seem to have reappeared in gen3 RUM. That would have been fun with quite some customers if it didn’t work anymore.
You are right, you can use data-dt-name, but not any custom attribute anymore. Docs.