Problem with Content Security Policy on App Service
We are hosting WordPress on the App Service. We would like to have google analytics but it seems that the default Content Security Policy on App Service blocks the google analytics request. We get the following error:
Refused to load the script 'https://www.googletagmanager.com/gtag/js?id=UA-14354' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'unsafe-inline' *.msecnd.net *.google.com *.gstatic.com". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
Can someone tell me where I can change Content Security Policy on App Service? I was trying to add the following code
<httpProtocol>
<customHeaders>
<add name="Content-Security-Policy" value="default-src 'self';"/>
</customHeaders>
</httpProtocol>
in web.confing file via Kudo but every time I get the following error:
The page cannot be displayed because an internal server error has occurred.
I will appreciate for help.
Samo