<?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 dtrum or javascript agent not available for Cordova application in Troubleshooting</title>
    <link>https://community.dynatrace.com/t5/Troubleshooting/dtrum-or-javascript-agent-not-available-for-Cordova-application/ta-p/202168</link>
    <description>&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;P&gt;In some cases, we are going to need to use the&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://www.npmjs.com/package/@dynatrace/cordova-plugin/v/1.255.1#manual-instrumentation" target="_blank" rel="noopener"&gt;JavaScript Agent interface&lt;/A&gt; for our instrumentation e.g. user tagging (dtrum.identifyUser), create custom action, etc. The&amp;nbsp;&lt;/SPAN&gt;interface will be provided by the JavaScript Agent, it can be used everywhere in your application by simply calling&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;dtrum.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;However, due to some factors then the interface might not be available and will cause some issues during instrumentation. You may face errors like "dtrum is undefined".&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Here are some sanity checks we can perform to figure out why dtrum is not available:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;1. We need to check if there are no errors in the build logs.&amp;nbsp; You can refer to these&amp;nbsp;&lt;A href="https://community.dynatrace.com/t5/Troubleshooting/How-to-get-the-cordova-build-logs/ta-p/200405" target="_blank" rel="noopener"&gt;instructions&lt;/A&gt;&amp;nbsp;on how to get the logs. You need to check for errors pertaining to the javascript url. See screenshot for an example:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-01-11 at 9.47.34 am.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/9359i29A44452C5737037/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-01-11 at 9.47.34 am.png" alt="Screenshot 2023-01-11 at 9.47.34 am.png" /&gt;&lt;/span&gt;
&lt;P&gt;If you see an error similar to this then we need to make sure that our configuration (dynatrace.config.js) is correct. Specifically, we need make sure&amp;nbsp;that the js url is valid/correct and has a valid &lt;A href="https://www.dynatrace.com/support/help/shortlink/token" target="_blank" rel="noopener"&gt;access tokens.&lt;/A&gt;&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-01-11 at 10.33.56 am.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/9360iEF8DB66F71AB2ED1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-01-11 at 10.33.56 am.png" alt="Screenshot 2023-01-11 at 10.33.56 am.png" /&gt;&lt;/span&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;2. Even if we ruled out number 1, we can still face issues when running the application. So we need to make sure that the javascript agent (ruxitagentjs) is actually inserted in the the web application (html page). In this step, we need to check the HAR file from the webviews. You can follow the instructions to &lt;A href="https://community.dynatrace.com/t5/Troubleshooting/How-to-get-HAR-files-for-webviews/ta-p/200413" target="_blank" rel="noopener"&gt;check the webview&lt;/A&gt;.&lt;BR /&gt;- check the elements tab and see if the script is inserted to the html page:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-01-11 at 10.45.04 am.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/9366i8B7F7A18FE897D4B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-01-11 at 10.45.04 am.png" alt="Screenshot 2023-01-11 at 10.45.04 am.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;If the script is not inserted then you need to check the build logs for any errors.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;- check if the js agent code is downloaded successfully by going to the networks tabs. The response should be http 200 (OK).&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-01-11 at 10.43.48 am.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/9367i5A7B6578615FB749/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-01-11 at 10.43.48 am.png" alt="Screenshot 2023-01-11 at 10.43.48 am.png" /&gt;&lt;/span&gt;&lt;BR /&gt;
&lt;P&gt;If the js agent is not downloaded successfully then you need to check for any environmental factors that may affect this. In most cases, there might be some middle layers that are affecting this. See this documentation&amp;nbsp;&lt;A href="https://www.dynatrace.com/support/help/shortlink/rum-firewall" target="_blank" rel="noopener"&gt;https://www.dynatrace.com/support/help/shortlink/rum-firewall&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;In some cases, if your machine or network does not allow download of the js agent. Then you can add the snippet locally into your machine.&amp;nbsp;&lt;A href="https://community.dynatrace.com/t5/Troubleshooting/Download-the-javascript-agent-locally-and-build-the-cordova/ta-p/201926" target="_blank"&gt;https://community.dynatrace.com/t5/Troubleshooting/Download-the-javascript-agent-locally-and-build-the-cordova/ta-p/201926&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What to do next?&lt;BR /&gt;&lt;/STRONG&gt;After all the checks and we still see the same problem then you can provide the build logs (from #1) and the HAR file (from #2) to the support ticket (create a new ticket if none yet).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Wed, 12 Apr 2023 03:11:40 GMT</pubDate>
    <dc:creator>yngwie_lucero</dc:creator>
    <dc:date>2023-04-12T03:11:40Z</dc:date>
    <item>
      <title>dtrum or javascript agent not available for Cordova application</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/dtrum-or-javascript-agent-not-available-for-Cordova-application/ta-p/202168</link>
      <description>&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;P&gt;In some cases, we are going to need to use the&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://www.npmjs.com/package/@dynatrace/cordova-plugin/v/1.255.1#manual-instrumentation" target="_blank" rel="noopener"&gt;JavaScript Agent interface&lt;/A&gt; for our instrumentation e.g. user tagging (dtrum.identifyUser), create custom action, etc. The&amp;nbsp;&lt;/SPAN&gt;interface will be provided by the JavaScript Agent, it can be used everywhere in your application by simply calling&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;dtrum.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;However, due to some factors then the interface might not be available and will cause some issues during instrumentation. You may face errors like "dtrum is undefined".&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Here are some sanity checks we can perform to figure out why dtrum is not available:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;1. We need to check if there are no errors in the build logs.&amp;nbsp; You can refer to these&amp;nbsp;&lt;A href="https://community.dynatrace.com/t5/Troubleshooting/How-to-get-the-cordova-build-logs/ta-p/200405" target="_blank" rel="noopener"&gt;instructions&lt;/A&gt;&amp;nbsp;on how to get the logs. You need to check for errors pertaining to the javascript url. See screenshot for an example:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-01-11 at 9.47.34 am.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/9359i29A44452C5737037/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-01-11 at 9.47.34 am.png" alt="Screenshot 2023-01-11 at 9.47.34 am.png" /&gt;&lt;/span&gt;
&lt;P&gt;If you see an error similar to this then we need to make sure that our configuration (dynatrace.config.js) is correct. Specifically, we need make sure&amp;nbsp;that the js url is valid/correct and has a valid &lt;A href="https://www.dynatrace.com/support/help/shortlink/token" target="_blank" rel="noopener"&gt;access tokens.&lt;/A&gt;&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-01-11 at 10.33.56 am.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/9360iEF8DB66F71AB2ED1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-01-11 at 10.33.56 am.png" alt="Screenshot 2023-01-11 at 10.33.56 am.png" /&gt;&lt;/span&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;2. Even if we ruled out number 1, we can still face issues when running the application. So we need to make sure that the javascript agent (ruxitagentjs) is actually inserted in the the web application (html page). In this step, we need to check the HAR file from the webviews. You can follow the instructions to &lt;A href="https://community.dynatrace.com/t5/Troubleshooting/How-to-get-HAR-files-for-webviews/ta-p/200413" target="_blank" rel="noopener"&gt;check the webview&lt;/A&gt;.&lt;BR /&gt;- check the elements tab and see if the script is inserted to the html page:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-01-11 at 10.45.04 am.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/9366i8B7F7A18FE897D4B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-01-11 at 10.45.04 am.png" alt="Screenshot 2023-01-11 at 10.45.04 am.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;If the script is not inserted then you need to check the build logs for any errors.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;- check if the js agent code is downloaded successfully by going to the networks tabs. The response should be http 200 (OK).&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-01-11 at 10.43.48 am.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/9367i5A7B6578615FB749/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-01-11 at 10.43.48 am.png" alt="Screenshot 2023-01-11 at 10.43.48 am.png" /&gt;&lt;/span&gt;&lt;BR /&gt;
&lt;P&gt;If the js agent is not downloaded successfully then you need to check for any environmental factors that may affect this. In most cases, there might be some middle layers that are affecting this. See this documentation&amp;nbsp;&lt;A href="https://www.dynatrace.com/support/help/shortlink/rum-firewall" target="_blank" rel="noopener"&gt;https://www.dynatrace.com/support/help/shortlink/rum-firewall&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;In some cases, if your machine or network does not allow download of the js agent. Then you can add the snippet locally into your machine.&amp;nbsp;&lt;A href="https://community.dynatrace.com/t5/Troubleshooting/Download-the-javascript-agent-locally-and-build-the-cordova/ta-p/201926" target="_blank"&gt;https://community.dynatrace.com/t5/Troubleshooting/Download-the-javascript-agent-locally-and-build-the-cordova/ta-p/201926&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What to do next?&lt;BR /&gt;&lt;/STRONG&gt;After all the checks and we still see the same problem then you can provide the build logs (from #1) and the HAR file (from #2) to the support ticket (create a new ticket if none yet).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Apr 2023 03:11:40 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/dtrum-or-javascript-agent-not-available-for-Cordova-application/ta-p/202168</guid>
      <dc:creator>yngwie_lucero</dc:creator>
      <dc:date>2023-04-12T03:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: dtrum or javascript agent not available for Cordova application</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/dtrum-or-javascript-agent-not-available-for-Cordova-application/tac-p/212132#M217</link>
      <description>&lt;P&gt;great write up&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/24673"&gt;@yngwie_lucero&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 19:30:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/dtrum-or-javascript-agent-not-available-for-Cordova-application/tac-p/212132#M217</guid>
      <dc:creator>ChadTurner</dc:creator>
      <dc:date>2023-05-12T19:30:04Z</dc:date>
    </item>
  </channel>
</rss>

