<?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>article Web applications: Sessions are not correctly tagged or metadata is missing in Troubleshooting</title>
    <link>https://community.dynatrace.com/t5/Troubleshooting/Web-applications-Sessions-are-not-correctly-tagged-or-metadata/ta-p/239375</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;DIV id="rum-trbl-metadata" class="sc-a56dfcea-0 kypGzI" data-testid="expand"&gt;
&lt;DIV class="sc-a56dfcea-4 dGsqsn"&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;If you notice your sessions aren't correctly tagged or if you have missing metadata, it's likely due to the application data privacy setting called&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Do Not Track&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;For this setting, the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Capture anonymous user-session data for "Do Not Track" enabled browsers&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;option is enabled by default, which is an important element of RUM data privacy. This option ensures that Dynatrace only captures anonymized sessions when the "Do Not Track" setting is detected in users' browsers.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;You can change the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Do Not Track&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;setting for your application. Note that if you select the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Disable Real User Monitoring for "Do Not Track" enabled browsers&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;option, RUM is turned off when the "Do Not Track" setting is detected in users' browsers.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;For detailed instructions, see&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-iGgWBj bKeKTL sc-8d216870-0 blGczQ" title="Learn about the privacy settings that Dynatrace provides to ensure that your web applications comply with the data-privacy regulations of your region." href="https://docs.dynatrace.com/docs/shortlink/configure-rum-privacy#do-not-track-gdpr" target="_self" data-testid="link"&gt;Configure data privacy settings for web applications | Do Not Track&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Check the following if some required metadata is missing for your &lt;A href="https://docs.dynatrace.com/docs/shortlink/web-applications-landing" target="_self"&gt;web applications&lt;/A&gt;. Also, check&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://community.dynatrace.com/t5/Troubleshooting/Web-applications-Sessions-are-randomly-split-into-shorter/ta-p/239479" target="_self"&gt;Web applications: Sessions are randomly split into shorter sessions&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-TOC indent="15" liststyle="disc" maxheadinglevel="2"&gt;&lt;/LI-TOC&gt;&lt;/P&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;DIV id="rum-trbl-metadata" class="sc-a56dfcea-0 kypGzI" data-testid="expand"&gt;
&lt;DIV class="sc-a56dfcea-4 dGsqsn"&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;&lt;SPAN&gt;Check whether RUM JavaScript can capture value right now&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="sc-6646062a-0 ivCgmd"&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;The RUM JavaScript offers the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;dtrum.getAndEvaluateMetaData()&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function that captures all the configured metadata and lists the current values. If the metadata was not captured, then the function lists a reason for that.&lt;/P&gt;
&lt;UL class="sc-jEACwC hZeaxZ"&gt;
&lt;LI class="sc-cPiKLX cTTNHO"&gt;
&lt;P class="sc-gEvEer lcacrh" data-testid="text"&gt;If the metadata expression is not listed, the page you are currently on might not be mapping to the correct application.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="sc-cPiKLX cTTNHO"&gt;
&lt;P class="sc-gEvEer lcacrh" data-testid="text"&gt;If the metadata expression shows the data you intended to capture, the data might not be available when the RUM JavaScript is capturing it. The data is captured whenever an action is finished, so if the data is only available afterwards, then the RUM JavaScript cannot capture these values.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="sc-6646062a-0 ivCgmd"&gt;Check if JS variable or DOM element is contained in Frame/IFrame&lt;/H2&gt;
&lt;P class="sc-gEvEer lcacrh" data-testid="text"&gt;&lt;SPAN&gt;IFrames and Frames have their own JavaScript context, so it's impossible to access variables that are only available in another frame. DOM elements must also be available in a Frame or IFrame in which the RUM JavaScript is injected because IFrames can have access restrictions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;You can use Chrome DevTools to verify JavaScript variable or DOM element capture. To do this, perform the desired action in the application. Then go to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Console&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;tab in Chrome DevTools, and then check the log for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;DOM Element value&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;Variable value&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;entries. Ensure that those entries have valid values.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;The following image shows a DOM Element access in the IFrame that contains the DOM Element.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rum-troubleshooting-cors-iframe2-1450-d5047b1014" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18176i58D429683E8A3B63/image-size/large?v=v2&amp;amp;px=999" role="button" title="rum-troubleshooting-cors-iframe2-1450-d5047b1014" alt="rum-troubleshooting-cors-iframe2-1450-d5047b1014" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;This image shows a DOM Element access in the IFrame that doesn't contain the DOM Element.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rum-troubleshooting-cors-iframe1-1449-1898b03c80" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18177i951C4A0352AC431A/image-size/large?v=v2&amp;amp;px=999" role="button" title="rum-troubleshooting-cors-iframe1-1449-1898b03c80" alt="rum-troubleshooting-cors-iframe1-1449-1898b03c80" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;H2 class="sc-gEvEer lcacrh" data-testid="text"&gt;Check if DOM selector is wrong or querySelector isn't available&lt;/H2&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;Perform the following actions to verify that the DOM selector is correct:&lt;/P&gt;
&lt;DIV class="sc-6646062a-0 ivCgmd"&gt;
&lt;UL class="sc-jEACwC hZeaxZ"&gt;
&lt;LI class="sc-cPiKLX cTTNHO"&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;Make sure&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;document.querySelector&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is available by typing it into the Chrome DevTools console. If it's not available, you won't be able to capture values in this browser. However, this is unlikely as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;document.querySelector&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is supported even by older browser versions.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="sc-cPiKLX cTTNHO"&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;Make sure&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;document.querySelector('yourselector')&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;returns the value you want to capture. If not, then your&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;queryselector&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is incorrect and the RUM JavaScript is not reporting data. See&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-gsFSXq dMCrLH sc-2d500c67-0 sc-8d216870-1 gPHVzu itVYXR" href="https://www.w3.org/TR/selectors-api/" target="_blank" rel="noopener noreferrer" data-testid="external-link"&gt;W3C Selectors API&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;for more information about&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;queryselector&lt;/CODE&gt;.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;To check the return value for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;document.querySelector&lt;/CODE&gt;, perform the desired action in the application. Then in Chrome DevTools, go to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Elements&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;tab, do a string search for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;document.querySelector&lt;/CODE&gt;, and verify the return value.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;The following image shows data correctly returned from&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;document.querySelector&lt;/CODE&gt;:&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rum-troubleshooting-cors-queryselector1-1458-58172f7419" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18178i5470503F4E738E3F/image-size/large?v=v2&amp;amp;px=999" role="button" title="rum-troubleshooting-cors-queryselector1-1458-58172f7419" alt="rum-troubleshooting-cors-queryselector1-1458-58172f7419" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;H2 class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;Check if cookies are using HttpOnly&lt;/H2&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;If the cookies have the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;HttpOnly&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;flag set, the RUM JavaScript can't access its values and the value isn't reported, as shown in the following image.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;You can check if the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;HttpOnly&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;flag is set for cookies in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Application&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;tab of Chrome DevTools.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rum-troubleshooting-cors-cookiehttponly-1448-a8555bf2fe" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18179i389D22553DDB3489/image-size/large?v=v2&amp;amp;px=999" role="button" title="rum-troubleshooting-cors-cookiehttponly-1448-a8555bf2fe" alt="rum-troubleshooting-cors-cookiehttponly-1448-a8555bf2fe" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;H2 class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Ensure cookies are set on correct domain&lt;/STRONG&gt;&lt;/H2&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;Sometimes cookies aren't set on the correct domain, even though they appear in Chrome DevTools. This means that you can see the cookie value in Chrome DevTools, but the cookie isn't accessible from the RUM JavaScript.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;To try this, you can search the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;document.cookie&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;string in the Chrome DevTools console and check if the return string contains the cookie you want to capture.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rum-troubleshooting-cors-cookiedomainpng-1782-dbc8d3f33b" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18180i366924B82BC578DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="rum-troubleshooting-cors-cookiedomainpng-1782-dbc8d3f33b" alt="rum-troubleshooting-cors-cookiedomainpng-1782-dbc8d3f33b" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 21 Mar 2024 08:00:00 GMT</pubDate>
    <dc:creator>maliborskaya</dc:creator>
    <dc:date>2024-03-21T08:00:00Z</dc:date>
    <item>
      <title>Web applications: Sessions are not correctly tagged or metadata is missing</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/Web-applications-Sessions-are-not-correctly-tagged-or-metadata/ta-p/239375</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;DIV id="rum-trbl-metadata" class="sc-a56dfcea-0 kypGzI" data-testid="expand"&gt;
&lt;DIV class="sc-a56dfcea-4 dGsqsn"&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;If you notice your sessions aren't correctly tagged or if you have missing metadata, it's likely due to the application data privacy setting called&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Do Not Track&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;For this setting, the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Capture anonymous user-session data for "Do Not Track" enabled browsers&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;option is enabled by default, which is an important element of RUM data privacy. This option ensures that Dynatrace only captures anonymized sessions when the "Do Not Track" setting is detected in users' browsers.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;You can change the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Do Not Track&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;setting for your application. Note that if you select the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Disable Real User Monitoring for "Do Not Track" enabled browsers&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;option, RUM is turned off when the "Do Not Track" setting is detected in users' browsers.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;For detailed instructions, see&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-iGgWBj bKeKTL sc-8d216870-0 blGczQ" title="Learn about the privacy settings that Dynatrace provides to ensure that your web applications comply with the data-privacy regulations of your region." href="https://docs.dynatrace.com/docs/shortlink/configure-rum-privacy#do-not-track-gdpr" target="_self" data-testid="link"&gt;Configure data privacy settings for web applications | Do Not Track&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Check the following if some required metadata is missing for your &lt;A href="https://docs.dynatrace.com/docs/shortlink/web-applications-landing" target="_self"&gt;web applications&lt;/A&gt;. Also, check&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://community.dynatrace.com/t5/Troubleshooting/Web-applications-Sessions-are-randomly-split-into-shorter/ta-p/239479" target="_self"&gt;Web applications: Sessions are randomly split into shorter sessions&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-TOC indent="15" liststyle="disc" maxheadinglevel="2"&gt;&lt;/LI-TOC&gt;&lt;/P&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;DIV id="rum-trbl-metadata" class="sc-a56dfcea-0 kypGzI" data-testid="expand"&gt;
&lt;DIV class="sc-a56dfcea-4 dGsqsn"&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;&lt;SPAN&gt;Check whether RUM JavaScript can capture value right now&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="sc-6646062a-0 ivCgmd"&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;The RUM JavaScript offers the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;dtrum.getAndEvaluateMetaData()&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function that captures all the configured metadata and lists the current values. If the metadata was not captured, then the function lists a reason for that.&lt;/P&gt;
&lt;UL class="sc-jEACwC hZeaxZ"&gt;
&lt;LI class="sc-cPiKLX cTTNHO"&gt;
&lt;P class="sc-gEvEer lcacrh" data-testid="text"&gt;If the metadata expression is not listed, the page you are currently on might not be mapping to the correct application.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="sc-cPiKLX cTTNHO"&gt;
&lt;P class="sc-gEvEer lcacrh" data-testid="text"&gt;If the metadata expression shows the data you intended to capture, the data might not be available when the RUM JavaScript is capturing it. The data is captured whenever an action is finished, so if the data is only available afterwards, then the RUM JavaScript cannot capture these values.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="sc-6646062a-0 ivCgmd"&gt;Check if JS variable or DOM element is contained in Frame/IFrame&lt;/H2&gt;
&lt;P class="sc-gEvEer lcacrh" data-testid="text"&gt;&lt;SPAN&gt;IFrames and Frames have their own JavaScript context, so it's impossible to access variables that are only available in another frame. DOM elements must also be available in a Frame or IFrame in which the RUM JavaScript is injected because IFrames can have access restrictions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;You can use Chrome DevTools to verify JavaScript variable or DOM element capture. To do this, perform the desired action in the application. Then go to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Console&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;tab in Chrome DevTools, and then check the log for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;DOM Element value&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;Variable value&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;entries. Ensure that those entries have valid values.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;The following image shows a DOM Element access in the IFrame that contains the DOM Element.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rum-troubleshooting-cors-iframe2-1450-d5047b1014" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18176i58D429683E8A3B63/image-size/large?v=v2&amp;amp;px=999" role="button" title="rum-troubleshooting-cors-iframe2-1450-d5047b1014" alt="rum-troubleshooting-cors-iframe2-1450-d5047b1014" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;This image shows a DOM Element access in the IFrame that doesn't contain the DOM Element.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rum-troubleshooting-cors-iframe1-1449-1898b03c80" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18177i951C4A0352AC431A/image-size/large?v=v2&amp;amp;px=999" role="button" title="rum-troubleshooting-cors-iframe1-1449-1898b03c80" alt="rum-troubleshooting-cors-iframe1-1449-1898b03c80" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;H2 class="sc-gEvEer lcacrh" data-testid="text"&gt;Check if DOM selector is wrong or querySelector isn't available&lt;/H2&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;Perform the following actions to verify that the DOM selector is correct:&lt;/P&gt;
&lt;DIV class="sc-6646062a-0 ivCgmd"&gt;
&lt;UL class="sc-jEACwC hZeaxZ"&gt;
&lt;LI class="sc-cPiKLX cTTNHO"&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;Make sure&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;document.querySelector&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is available by typing it into the Chrome DevTools console. If it's not available, you won't be able to capture values in this browser. However, this is unlikely as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;document.querySelector&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is supported even by older browser versions.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="sc-cPiKLX cTTNHO"&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;Make sure&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;document.querySelector('yourselector')&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;returns the value you want to capture. If not, then your&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;queryselector&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is incorrect and the RUM JavaScript is not reporting data. See&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-gsFSXq dMCrLH sc-2d500c67-0 sc-8d216870-1 gPHVzu itVYXR" href="https://www.w3.org/TR/selectors-api/" target="_blank" rel="noopener noreferrer" data-testid="external-link"&gt;W3C Selectors API&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;for more information about&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;queryselector&lt;/CODE&gt;.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;To check the return value for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;document.querySelector&lt;/CODE&gt;, perform the desired action in the application. Then in Chrome DevTools, go to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Elements&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;tab, do a string search for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;document.querySelector&lt;/CODE&gt;, and verify the return value.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;The following image shows data correctly returned from&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;document.querySelector&lt;/CODE&gt;:&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rum-troubleshooting-cors-queryselector1-1458-58172f7419" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18178i5470503F4E738E3F/image-size/large?v=v2&amp;amp;px=999" role="button" title="rum-troubleshooting-cors-queryselector1-1458-58172f7419" alt="rum-troubleshooting-cors-queryselector1-1458-58172f7419" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;H2 class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;Check if cookies are using HttpOnly&lt;/H2&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;If the cookies have the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;HttpOnly&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;flag set, the RUM JavaScript can't access its values and the value isn't reported, as shown in the following image.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;You can check if the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;HttpOnly&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;flag is set for cookies in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Application&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;tab of Chrome DevTools.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rum-troubleshooting-cors-cookiehttponly-1448-a8555bf2fe" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18179i389D22553DDB3489/image-size/large?v=v2&amp;amp;px=999" role="button" title="rum-troubleshooting-cors-cookiehttponly-1448-a8555bf2fe" alt="rum-troubleshooting-cors-cookiehttponly-1448-a8555bf2fe" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;H2 class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;&lt;STRONG class="sc-bf977b27-0 hNpJEd"&gt;Ensure cookies are set on correct domain&lt;/STRONG&gt;&lt;/H2&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;Sometimes cookies aren't set on the correct domain, even though they appear in Chrome DevTools. This means that you can see the cookie value in Chrome DevTools, but the cookie isn't accessible from the RUM JavaScript.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;To try this, you can search the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;document.cookie&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;string in the Chrome DevTools console and check if the return string contains the cookie you want to capture.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rum-troubleshooting-cors-cookiedomainpng-1782-dbc8d3f33b" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18180i366924B82BC578DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="rum-troubleshooting-cors-cookiedomainpng-1782-dbc8d3f33b" alt="rum-troubleshooting-cors-cookiedomainpng-1782-dbc8d3f33b" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Mar 2024 08:00:00 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/Web-applications-Sessions-are-not-correctly-tagged-or-metadata/ta-p/239375</guid>
      <dc:creator>maliborskaya</dc:creator>
      <dc:date>2024-03-21T08:00:00Z</dc:date>
    </item>
  </channel>
</rss>

