139
Views
7
Comments
Solved
Error handling using CSP
Application Type
Reactive

Hi All,

I'm working on CSP (Content Security Policy) for handling errors. I have enabled the CSP in my DEV environment and got an error ('https://www.google-analytics.com/analytics.js') in my application while adding script during loading the hope page. 

I know this can be handled in this. But how and what do I need to mention in the Base-Uri? Please advise me on this. Any help will be appreciated. 

Thanks

Prince

2020-09-18 09-37-36
Devendra Baghel
Solution

Hi Prince,

Use below settings to allow google analytics to render

script-src: https://www.google-analytics.com https://ssl.google-analytics.com
img-src: https://www.google-analytics.com
connect-src: https://www.google-analytics.com

Below is the documentation for same

https://developers.google.com/tag-platform/tag-manager/web/csp

Best Regards

Devendra

2024-06-24 04-49-49
Princi

Thanks for replying, Devendra.

Should I need to mention these settings in Base-Uri section.

Regards

Prince

2020-09-18 09-37-36
Devendra Baghel

Hi Prince,

No in CSP settings you have separate option for each section for example connect-src

 

Best Regards

Devendra

2024-06-24 04-49-49
Princi
2024-06-24 04-49-49
Princi

Should I need to add "self" before using any links here? Getting this while applying the changes.

2020-09-18 09-37-36
Devendra Baghel

Yes that would load all resources from self domain that is your current domain as well as your google analytics.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.