Google 태그 매니저가 작동하지 않아요

안녕하세요!

우리 포럼(https://forum.warthunder.com/)에서 GTM을 설정할 수 없습니다.

확인하실 수 있듯이 콘텐츠 보안 정책(CSP)에 관한 오류가 발생하고 있습니다.

Refused to execute inline script because it violates the following Content Security Policy directive: "script-src https://forum.warthunder.com/logs/ https://forum.warthunder.com/sidekiq/ https://forum.warthunder.com/mini-profiler-resources/ https://forum.warthunder.com/assets/ https://forum.warthunder.com/brotli_asset/ https://forum.warthunder.com/extra-locales/ https://forum.warthunder.com/highlight-js/ https://forum.warthunder.com/javascripts/ https://forum.warthunder.com/plugins/ https://forum.warthunder.com/theme-javascripts/ https://forum.warthunder.com/svg-sprite/ https://www.googletagmanager.com/gtm.js 'nonce-857b78b0187f8ee53100212842747417' 'sha256-HZxBMVZe6P3MvHDZlFai9cUmLH+qwX6BNT3qTwNPATg='". Either the 'unsafe-inline' keyword, a hash ('sha256-93qwY4D574Ysts67Kmc0jpUYGBwBuG9q6hhQl+Kk9us='), or a nonce ('nonce-...') is required to enable inline execution.

CSP 헤더의 URL들은 정상이고 nonce도 정확합니다.

문제가 무엇일지 아시는 분 계신가요?

감사합니다.

안녕하세요 @Nikolaos_SP :wave: Meta에 오신 것을 환영합니다 :slight_smile:

아래 토픽을 한번 살펴보세요

Lilly님 안녕하세요

그 기사를 포함해 이 포럼의 다른 많은 글들을 읽어 보았지만, 아무것도 도움이 되지 않았습니다 :frowning:

메인 페이지에 CSP 헤더를 올바르게 설정했고, script src에 gtm 주소가 포함되어 있습니다. nonce도 있지만, 브라우저가 여전히 어떤 이유에서인지 스크립트 로딩을 차단하고 있습니다.

CSP, 즉 Report-only 모드를 사용하지 않으면 어떤 일이 발생합니까?

관리자 패널에서 콘텐츠 보안 정책(CSP)을 비활성화하면 정상적으로 작동합니다.
하지만 그렇게 하면 보안 위험이 발생하게 됩니다.

사실 그건 큰 위험이 아니에요. CSP는 매우 신뢰할 수 없는 방법이고, 시스템이 정상적으로 작동하려면 거의 모든 것을 허용해야 하므로 결국 보안은 무너질 수밖에 없거든요.

하지만 당신에게는 꽤 간단한 딜레마입니다. 그 추가 보안 계층이 정말 필요한가요, 아니면 Google 태그가 필요한가요? 아니면 Matomo를 대신 사용할 수 있는 건가요?

@Nikolaos_SP

googletagmanager.com 도메인을 SCP 화이트리스트에 추가했는데, 제 환경에서는 잘 작동했습니다.