# Script do Google Tag Manager (gtm) bloqueado por CSP

**URL:** <https://meta.discourse.org/t/google-tag-manager-gtm-script-blocked-by-csp/270210>\
**Category:** Data & reporting\
**Tags:** analytics\
**Created:** [Junho 30, 2023, 11:26pm UTC](https://meta.discourse.org/t/google-tag-manager-gtm-script-blocked-by-csp/270210 "2023-06-30T23:26:29Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![tyf](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tyf/32/288655_2.png) [@tyf](https://meta.discourse.org/u/tyf)\
**Post date:** [Junho 30, 2023, 11:26pm UTC](https://meta.discourse.org/t/google-tag-manager-gtm-script-blocked-by-csp/270210/1 "2023-06-30T23:26:29Z")

</div>

Olá!

Estou tendo dificuldades para entender por que nosso script GTM está sendo bloqueado por nosso CSP:

 ![Screenshot 2023-06-30 at 4.16.51 PM](https://global.discourse-cdn.com/meta/original/4X/2/e/5/2e5c2a051275e7fccd062121c1801cbe84f194cb.jpeg)

Aqui está o script:

```html

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXX');</script>
<!-- End Google Tag Manager -->

```

Estou seguindo as instruções [aqui](https://meta.discourse.org/t/set-up-google-tag-manager-for-analytics-ga4/47335#discourse-7) para adicionar o GTM ao Discourse. Removi o ID do GA, conforme declarado no artigo, e também adicionei `https://www.googletagmanager.com` à nossa lista de permissões.

Alguma ideia?

---

_[View the full topic](https://meta.discourse.org/t/google-tag-manager-gtm-script-blocked-by-csp/270210)._
