<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic User Tag with child CSS element in Real User Monitoring</title>
    <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Tag-with-child-CSS-element/m-p/212693#M4356</link>
    <description>&lt;P&gt;Hi there.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;I've read every topic on the forum and documentation on how to make User tagging work with CSS, and it seems I'm doing everything right but still, it doesn't fetch the users from the front end.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My actions are next:&amp;nbsp;&lt;BR /&gt;1) Inspect the element on the front page&lt;BR /&gt;2) Copy CSS selector where the username is&lt;BR /&gt;3) Paste it to the User tag&amp;nbsp;&lt;BR /&gt;my user tag looks like this :&amp;nbsp;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;#wrapper &amp;gt; div.navbarmaincontent &amp;gt; nav &amp;gt; ul &amp;gt; li.dropdown.open &amp;gt; ul &amp;gt; li:nth-child(1) &amp;gt; a&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;I tried to check it in the console with the command :&amp;nbsp;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;document.querySelector ('#wrapper &amp;gt; div.navbarmaincontent &amp;gt; nav &amp;gt; ul &amp;gt; li.dropdown.open &amp;gt; ul &amp;gt; li:nth-child(1) &amp;gt; a');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&amp;lt;a href=​"/​UserProfile"&amp;gt;​…​&amp;lt;/a&amp;gt;​&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;and it returns a particular HTML with a username. : |&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&amp;lt;a href="/username_prof"&amp;gt;&amp;lt;i class="fa fa-user fa-fw"&amp;gt;&amp;lt;/i&amp;gt; Username &amp;amp; Lastname &amp;lt;/a&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Did I miss something else? Any hints are highly appreciated.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 May 2023 13:13:47 GMT</pubDate>
    <dc:creator>Vakho</dc:creator>
    <dc:date>2023-05-22T13:13:47Z</dc:date>
    <item>
      <title>User Tag with child CSS element</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Tag-with-child-CSS-element/m-p/212693#M4356</link>
      <description>&lt;P&gt;Hi there.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;I've read every topic on the forum and documentation on how to make User tagging work with CSS, and it seems I'm doing everything right but still, it doesn't fetch the users from the front end.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My actions are next:&amp;nbsp;&lt;BR /&gt;1) Inspect the element on the front page&lt;BR /&gt;2) Copy CSS selector where the username is&lt;BR /&gt;3) Paste it to the User tag&amp;nbsp;&lt;BR /&gt;my user tag looks like this :&amp;nbsp;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;#wrapper &amp;gt; div.navbarmaincontent &amp;gt; nav &amp;gt; ul &amp;gt; li.dropdown.open &amp;gt; ul &amp;gt; li:nth-child(1) &amp;gt; a&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;I tried to check it in the console with the command :&amp;nbsp;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;document.querySelector ('#wrapper &amp;gt; div.navbarmaincontent &amp;gt; nav &amp;gt; ul &amp;gt; li.dropdown.open &amp;gt; ul &amp;gt; li:nth-child(1) &amp;gt; a');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&amp;lt;a href=​"/​UserProfile"&amp;gt;​…​&amp;lt;/a&amp;gt;​&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;and it returns a particular HTML with a username. : |&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&amp;lt;a href="/username_prof"&amp;gt;&amp;lt;i class="fa fa-user fa-fw"&amp;gt;&amp;lt;/i&amp;gt; Username &amp;amp; Lastname &amp;lt;/a&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Did I miss something else? Any hints are highly appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 13:13:47 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Tag-with-child-CSS-element/m-p/212693#M4356</guid>
      <dc:creator>Vakho</dc:creator>
      <dc:date>2023-05-22T13:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: User Tag with child CSS element</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Tag-with-child-CSS-element/m-p/213879#M4393</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;Without exact page it is very difficult to answer what is wrong.&lt;/P&gt;&lt;P&gt;Maybe the main reason of the problem that you try to catch this information from "&lt;STRONG&gt;form"&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Personally, from my experience, I try to avoid getting username from forms by CSS selector.&lt;/P&gt;&lt;P&gt;This is simple example with form:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Romanenkov_Al3x_0-1685632983371.png" style="width: 611px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/12036iC6D4004E4C7C3275/image-dimensions/611x81?v=v2" width="611" height="81" role="button" title="Romanenkov_Al3x_0-1685632983371.png" alt="Romanenkov_Al3x_0-1685632983371.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In this example - CSS selector = "#Email"&lt;/P&gt;&lt;P&gt;I would recommend looking for a global JS variable - which contains the username. The CSS selector works well if, for example, you have static content "Welcome, %username" in the "right" corner of the page.&lt;/P&gt;&lt;P&gt;Also you can try to use JS DTRUM API Javascript function (you supply the user name as the parameter):&lt;/P&gt;&lt;PRE&gt;dtrum.identifyUser("some@gmail.com")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Perhaps other colleagues have a positive experience of using CSS selector and will response differently than I.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alex Romanenkov&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 15:33:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Tag-with-child-CSS-element/m-p/213879#M4393</guid>
      <dc:creator>Romanenkov_Al3x</dc:creator>
      <dc:date>2023-06-01T15:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: User Tag with child CSS element</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Tag-with-child-CSS-element/m-p/213885#M4394</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/51881"&gt;@Romanenkov_Al3x&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;I'm sure for 90% that the problem with css selector is because JS (OneAgent) loads first and only after that css is loaded. So, css selector is trying to fetch before it's generated.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I agree that JS variable is the best way to get the user name, or maybe server-side requests will work better.&amp;nbsp;&lt;BR /&gt;Anyway, I assume it's a common problem based on the application architecture, so I will implement JS var, which will work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 17:07:16 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Tag-with-child-CSS-element/m-p/213885#M4394</guid>
      <dc:creator>Vakho</dc:creator>
      <dc:date>2023-06-01T17:07:16Z</dc:date>
    </item>
  </channel>
</rss>

