# GTM Refused to load the script because it violates the Content Security Policy

**URL:** https://meta.discourse.org/t/gtm-refused-to-load-the-script-because-it-violates-the-content-security-policy/194058
**Category:** Data & reporting
**Created:** [June 16, 2021, 1:06pm UTC](https://meta.discourse.org/t/gtm-refused-to-load-the-script-because-it-violates-the-content-security-policy/194058 "2021-06-16T13:06:41Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [June 16, 2021, 1:46pm UTC](https://meta.discourse.org/t/gtm-refused-to-load-the-script-because-it-violates-the-content-security-policy/194058/2 "2021-06-16T13:46:07Z")

</div>

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

> [@Integrate Google Tag Manager with Google Analytics](https://meta.discourse.org/t/setup-google-tag-manager-for-analytics/47335):
>
> bookmark This guide will help you set up Google Tag Manager and use it with Google Analytics on your Discourse site. Additionally, it covers configuring variables, triggers, and tags in Google Tag Manager to track page views. information_source This guide covers setting up Google Tag Manager. If you only want to enable Google Analytics for your site, set the G-Tag in the ga universal tracking code site setting. Our settings may still refer to all analytics as universal, but this is a legac…

> [@Integrate Google Tag Manager with Google Analytics](https://meta.discourse.org/t/integrate-google-tag-manager-with-google-analytics/47335/1):
>
> For security reasons, all up to date Discourse installs have a Content Security Policy that blocks all non-Discourse scripts. This means that if you add external scripts to your GTM integration, you might have to allowlist their domains in order for the scripts to be allowed to run.

---

_[View the full topic](https://meta.discourse.org/t/gtm-refused-to-load-the-script-because-it-violates-the-content-security-policy/194058)._
