<?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 Browser monitors: Issues with Content Security Policy in Troubleshooting</title>
    <link>https://community.dynatrace.com/t5/Troubleshooting/Browser-monitors-Issues-with-Content-Security-Policy/ta-p/233048</link>
    <description>&lt;P&gt;&lt;LI-TOC indent="15" liststyle="disc" maxheadinglevel="2"&gt;&lt;/LI-TOC&gt;&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;Summary&lt;/H2&gt;
&lt;P&gt;&lt;A href="https://dt-url.net/q1e1pkl" target="_blank" rel="noopener"&gt;Content Security Policy (CSP)&lt;/A&gt; is a security layer that helps detect and mitigate specific types of attacks, such as Cross-Site Scripting (XSS) and data-injection attacks.&lt;/P&gt;
&lt;P&gt;Unfortunately, the applied CSP settings are likely to prevent the browser from sending monitoring data to the Dynatrace Cluster.&lt;/P&gt;
&lt;H2&gt;Preferred solution: Monitor settings&lt;/H2&gt;
&lt;P&gt;As a first and preferred method to bypass the CSP of any monitored pages in your single-URL browser monitor or browser clickpath, enable &lt;STRONG&gt;Bypass Content Security Policy (CSP) of monitored pages&lt;/STRONG&gt; in monitor settings. You can do this in &lt;STRONG&gt;Additional options&lt;/STRONG&gt; when creating a browser monitor or in &lt;STRONG&gt;Advanced setup&lt;/STRONG&gt; in monitor settings in edit mode.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bypass CSP in browser monitor settings" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/16537i8129B1525D99CD50/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bypass-csp-browser-monitor.png" alt="bypass-csp-browser-monitor.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you're unable to use this option for some reason, refer to the advanced methods for bypassing CSP below.&lt;/P&gt;
&lt;H2&gt;Advanced methods to bypass CSP&lt;/H2&gt;
&lt;P&gt;Your CSP rules, such as the following, prevent Dynatrace from sending requests to a path relative to the page URL.&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;"Content-Security-Policy: default-src https: data: 'unsafe-inline' 'unsafe-eval'"&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;If you use custom JavaScript events, you may see the following JavaScript error.&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed&lt;/CODE&gt;. To avoid this, your page needs to allow &lt;CODE&gt;script-src unsafe-eval&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;In other cases, you must modify the page to allow connections relative to the URL. The following are example scenarios.&lt;/P&gt;
&lt;H3&gt;Example 1&lt;/H3&gt;
&lt;P&gt;CSP settings specified by using the &lt;CODE&gt;&amp;lt;meta&amp;gt;&lt;/CODE&gt; tag are likely to prevent the browser from sending monitoring data to Dynatrace Cluster.&lt;/P&gt;
&lt;P&gt;To resolve this issue, you can either set up a CSP HTTP header by replacing any existing CSP &lt;CODE&gt;&amp;lt;meta&amp;gt;&lt;/CODE&gt; tag or add your environment URL to CSP, as shown below.&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&amp;lt;meta
 http-equiv="Content-Security-Policy" content="default-src 'self'; 
connect-src 'self' https://{your environment id}.live.dynatrace.com"&amp;gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;H3&gt;Example 2&lt;/H3&gt;
&lt;P data-unlink="true"&gt;A page loaded from &lt;CODE&gt;http://www.mydomain.com&lt;/CODE&gt; returns no data in the UI because the CSP settings specify &lt;CODE&gt;connect-src https://&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;In such a case, you can try either of the following.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;-Add &lt;CODE&gt;http://&lt;/CODE&gt; to &lt;CODE&gt;connect-src&lt;/CODE&gt;.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px" data-unlink="true"&gt;-Switch the test to load &lt;CODE&gt;https://www.mydomain.com&lt;/CODE&gt; instead of &lt;CODE&gt;http://www.mydomain.com&lt;/CODE&gt;.&lt;/P&gt;
&lt;H3&gt;Example 3&lt;/H3&gt;
&lt;P data-unlink="true"&gt;A page loaded from &lt;CODE&gt;http://www.mydomain.com&lt;/CODE&gt; returns no data in the UI because the CSP rules specify &lt;CODE&gt;connect-src http://*.mydomain.com&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;In this case, add &lt;CODE&gt;http://&lt;/CODE&gt; to &lt;CODE&gt;connect-src&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;What's Next&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;If none of the previous steps resolved the issue, open a chat and provide a link to your Browser Monitor, and the troubleshooting steps you have already completed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can find further troubleshooting tips for Synthetic in the&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://community.dynatrace.com/t5/Troubleshooting/Synthetic-Troubleshooting-Map/ta-p/250426" target="_blank" rel="noopener"&gt;Synthetic Troubleshooting Map&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Nov 2025 12:52:51 GMT</pubDate>
    <dc:creator>nandini_balakri</dc:creator>
    <dc:date>2025-11-18T12:52:51Z</dc:date>
    <item>
      <title>Browser monitors: Issues with Content Security Policy</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/Browser-monitors-Issues-with-Content-Security-Policy/ta-p/233048</link>
      <description>&lt;P&gt;Standard and advanced methods for bypassing CSP so your browser monitors can send monitoring data to the Dynatrace Cluster&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2025 12:52:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/Browser-monitors-Issues-with-Content-Security-Policy/ta-p/233048</guid>
      <dc:creator>nandini_balakri</dc:creator>
      <dc:date>2025-11-18T12:52:51Z</dc:date>
    </item>
  </channel>
</rss>

