GTM סירב לטעון את הסקריפט מכיוון שהוא מפר את ה-Content Security Policy

סיכום מבוסס בינה מלאכותית

The discussion revolves around integrating Google Tag Manager (GTM) with a Discourse forum, where a Content Security Policy (CSP) blocks GTM scripts. narayanan reports an error indicating that the GTM script is blocked due to CSP restrictions. neil explains that external scripts like GTM must be allowed in the CSP and references a guide for integrating GTM. narayanan then asks about integrating Twitter analytics, suggesting further discussion on external script integration.

Hi,

I’m trying to add new GTM container to discourse. We get

Refused to load the script "https://forums.techsoup.org/_Incapsula_Resource?SWJIYLWA=719d34d31c8e3a6e6fffd425f7e032f3&ns=1&cb=1660101200' because it violates the following Content Security Policy directive: "script-src https://forums.techsoup.org/logs/ https://forums.techsoup.org/sidekiq/ https://forums.techsoup.org/mini-profiler-resources/ https://forums.techsoup.org/assets/ https://forums.techsoup.org/brotli_asset/ https://forums.techsoup.org/extra-locales/ https://forums.techsoup.org/highlight-js/ https://forums.techsoup.org/javascripts/ https://forums.techsoup.org/plugins/ https://forums.techsoup.org/theme-javascripts/ https://forums.techsoup.org/svg-sprite/ https://www.googletagmanager.com/gtm.js 'nonce-0cac1a2cef90863cc692ed7f68c5f4f0'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback"

You need to add new scripts to your content security policy.

Can you let us know how to integrate with Twitter analytics.