# GTM usage error

**URL:** https://meta.discourse.org/t/gtm-usage-error/139232
**Category:** Data & reporting
**Tags:** analytics
**Created:** [January 20, 2020, 8:57pm UTC](https://meta.discourse.org/t/gtm-usage-error/139232 "2020-01-20T20:57:22Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Tomiikcz](https://avatars.discourse-cdn.com/v4/letter/t/7ba0ec/32.png) [@Tomiikcz](https://meta.discourse.org/u/Tomiikcz)
#### Post date: [January 20, 2020, 8:57pm UTC](https://meta.discourse.org/t/gtm-usage-error/139232/1 "2020-01-20T20:57:22Z")

</div>

Hello to everyone,

when I use prepared _gtm container id_ in our settings in app with correctly GTM ID (f.e. GTM-XYZXYZ) and of course I add specific domain to white list (according to [Integrate Google Tag Manager with Google Analytics](https://meta.discourse.org/t/setup-google-tag-manager-for-analytics/47335) manual) then I have a problem with loading and fetching [https://d1i8vaoc4ts7hj.cloudfront.net/5e3fcb4db448a78908a4671b6fb685c7acd13fa3\_10854/dist/js-extra/VisitorAPI.js](https://d1i8vaoc4ts7hj.cloudfront.net/5e3fcb4db448a78908a4671b6fb685c7acd13fa3_10854/dist/js-extra/VisitorAPI.js) script called from gtm.js core script with message `GET https://d1i8vaoc4ts7hj.cloudfront.net/5e3fcb4db448a78908a4671b6fb685c7acd13fa3_10854/dist/js-extra/VisitorAPI.js net::ERR_FAILED` and `{message: "remote script failed https://d1i8vaoc4ts7hj.cloudf…fb685c7acd13fa3_10854/dist/js-extra/VisitorAPI.js"}`.

Second same problem with this is called from NetworkFirst.mjs `(Uncaught (in promise) no-response: no-response :: [{"url":"https://d1i8vaoc4ts7hj.cloudfront.net/5e3fcb4db448a78908a4671b6fb685c7acd13fa3_10854/dist/js-extra/VisitorAPI.js"}])`.

Could someone give me advice?

Thx a lot.  
T

---

<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: [January 20, 2020, 9:46pm UTC](https://meta.discourse.org/t/gtm-usage-error/139232/2 "2020-01-20T21:46:05Z")

</div>

Can you try adding `'unsafe-inline'` as [Google’s support doc says](https://developers.google.com/tag-manager/web/csp)? If it works, I can add it to our howto instructions.

---

<div class="post-metadata">

### Author: ![Tomiikcz](https://avatars.discourse-cdn.com/v4/letter/t/7ba0ec/32.png) [@Tomiikcz](https://meta.discourse.org/u/Tomiikcz)
#### Post date: [January 21, 2020, 10:55am UTC](https://meta.discourse.org/t/gtm-usage-error/139232/3 "2020-01-21T10:55:48Z")

</div>

So I should insert `'unsafe-inline' https://www.googletagmanager.com` to **content security policy script src** array?

Maybe I don’t understand your reply. But it doesn’t work for me.

---

<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: [January 21, 2020, 3:08pm UTC](https://meta.discourse.org/t/gtm-usage-error/139232/4 "2020-01-21T15:08:56Z")

</div>

Yes, that’s what their doc says needs to be added.

 ![2020-01-21_10-03](https://global.discourse-cdn.com/meta/original/3X/1/c/1cb262894140d5c28dab1c411b78d148dcfa18dc.png)

If that’s not permissive enough, you can try allowing anything starting with “https”.

 ![image.png](https://global.discourse-cdn.com/meta/original/3X/3/5/35741fb9a1b5d9bd8abcb63e079894e97a25232f.png)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [January 21, 2020, 6:31pm UTC](https://meta.discourse.org/t/gtm-usage-error/139232/5 "2020-01-21T18:31:56Z")

</div>

I had this problem recently and that’s what I did to fix it. I didn’t quite understand why it appeared. I added `https:` and `unsafe-inline`. Having it be so permissive seemed to be bypassing something that seems like it should be important, but this is what solved the problem.

It would seem like if Google requires this then the plugin should do it automatically. If my site broke, then I’d think that every site will break (when they upgrade again?).

---

<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: [January 21, 2020, 8:11pm UTC](https://meta.discourse.org/t/gtm-usage-error/139232/6 "2020-01-21T20:11:43Z")

</div>

GTM support isn’t a plugin, it’s a setting in core Discourse. There’s currently a note about CSP in the setting description.

But I’m guessing you’re thinking of the ad plugin, which is another story. It includes multiple ad options, all of them disabled when you install the plugin. Each setting should probably have a note about CSP so people know about it.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [January 21, 2020, 8:18pm UTC](https://meta.discourse.org/t/gtm-usage-error/139232/7 "2020-01-21T20:18:08Z")

</div>

> [@neil](#):
>
> But I’m guessing you’re thinking of the ad plugin, which is another story.

I’m guessing so too! I’ve tried not to learn about this. I don’t know the difference between GTM, Adsense, and DFP. 😉

> [@neil](#):
>
> Each setting should probably have a note about CSP so people know about it.

Maybe so. All I know is that a site had the Google Ads working and then there was an upgrade and then the stopped working. I got blamed.

If Google [ad manager|dfp|ad plugin|gtm] requires some CSP setting to change because [Google|Discourse] changed something, it’d be nice to, maybe, create one of those annoying Dashboard notices about it?

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [December 3, 2023, 7:04am UTC](https://meta.discourse.org/t/gtm-usage-error/139232/8 "2023-12-03T07:04:05Z")

</div>


