# Google Ads Not Displaying

**URL:** https://meta.discourse.org/t/google-ads-not-displaying/116175
**Category:** Support
**Created:** [April 28, 2019, 3:29pm UTC](https://meta.discourse.org/t/google-ads-not-displaying/116175 "2019-04-28T15:29:35Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![agentpoyo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/agentpoyo/32/139542_2.png) [@agentpoyo](https://meta.discourse.org/u/agentpoyo)
#### Post date: [April 28, 2019, 3:29pm UTC](https://meta.discourse.org/t/google-ads-not-displaying/116175/1 "2019-04-28T15:29:35Z")

</div>

I’m seeing the following error when verifying why google ads are not displaying.

`Refused to load the script 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js' because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'report-sample'`

I’m not a coder or anything. I’ve tried some suggestions for adding meta tags for Content Security Policy but those seem to break the entire site even more.

Any suggestions? I’m using the default Light theme with a version 2.3.0.beta9 that is used on Digital Ocean marketplace.

---

<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: [April 28, 2019, 5:11pm UTC](https://meta.discourse.org/t/google-ads-not-displaying/116175/2 "2019-04-28T17:11:24Z")

</div>

Did you install [https://meta.discourse.org/t/official-discourse-advertising-plugin-not-showing-adsense-ads/50962](https://meta.discourse.org/t/official-discourse-advertising-plugin-not-showing-adsense-ads/50962) or are you trying to create ads some other way?

---

<div class="post-metadata">

### Author: ![agentpoyo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/agentpoyo/32/139542_2.png) [@agentpoyo](https://meta.discourse.org/u/agentpoyo)
#### Post date: [April 28, 2019, 5:15pm UTC](https://meta.discourse.org/t/google-ads-not-displaying/116175/3 "2019-04-28T17:15:46Z")

</div>

I’ve tried both. I installed the official ads plugin and added my own google script code in the /head under customizations.

I just discovered the `content_security_policy` setting as well and disabled it, was still getting errors but that was with my script in the /head, disabling that now and trying with the plugin settings.

---

<div class="post-metadata">

### Author: ![agentpoyo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/agentpoyo/32/139542_2.png) [@agentpoyo](https://meta.discourse.org/u/agentpoyo)
#### Post date: [April 28, 2019, 5:19pm UTC](https://meta.discourse.org/t/google-ads-not-displaying/116175/4 "2019-04-28T17:19:33Z")

</div>

Seems the errors are gone. Do I have to create ad units to throw in the ad unit # or if I set these as responsive should they start loading by chance?

---

<div class="post-metadata">

### Author: ![agentpoyo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/agentpoyo/32/139542_2.png) [@agentpoyo](https://meta.discourse.org/u/agentpoyo)
#### Post date: [April 28, 2019, 5:24pm UTC](https://meta.discourse.org/t/google-ads-not-displaying/116175/5 "2019-04-28T17:24:22Z")

</div>

Ah, looks like it’s now loading some ads. I think I found the magic fix. 🙂

---

<div class="post-metadata">

### Author: ![agentpoyo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/agentpoyo/32/139542_2.png) [@agentpoyo](https://meta.discourse.org/u/agentpoyo)
#### Post date: [April 28, 2019, 6:35pm UTC](https://meta.discourse.org/t/google-ads-not-displaying/116175/6 "2019-04-28T18:35:04Z")

</div>

For anyone who runs into the same issues, steps to get ads going seems to be:

1. Disable content\_security\_policy
2. Make sure the official Ad plugin is installed and active.
3. Create ad unit’s for mobile and desktop to place in the ad settings for use.

Seems if you try doing `meta http-equiv="Content-Security-Policy"` in your head tags, it still complains about the policies if the security policy is enabled in the admin settings.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 29, 2019, 2:34am UTC](https://meta.discourse.org/t/google-ads-not-displaying/116175/7 "2019-04-29T02:34:43Z")

</div>

Note that you make your site vulnerable to hackers if you disable CSP entirely.

---

<div class="post-metadata">

### Author: ![agentpoyo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/agentpoyo/32/139542_2.png) [@agentpoyo](https://meta.discourse.org/u/agentpoyo)
#### Post date: [April 29, 2019, 12:28pm UTC](https://meta.discourse.org/t/google-ads-not-displaying/116175/8 "2019-04-29T12:28:40Z")

</div>

Yes.

In my case my own CSP in my head tags were being overwritten by the CSP being enabled.

Disable in admin settings, setup CSP in headers or configure your own within nginx, etc.

---

<div class="post-metadata">

### Author: ![Logan\_Douglas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/logan_douglas/32/150990_2.png) [@Logan\_Douglas](https://meta.discourse.org/u/Logan_Douglas)
#### Post date: [July 26, 2019, 1:51am UTC](https://meta.discourse.org/t/google-ads-not-displaying/116175/9 "2019-07-26T01:51:41Z")

</div>

I’ve run into the same issue.

Kinda annoying that an ad plugin is offered - Yet no mention of CSP configuration in the ad plugin - I guess your left to adventure into the bug wilderness huh?

Why not mention to users in the Ad plugin readme - You need to configure CSP?

The ad plugin should handle the CSP entries for adsense/relevant ad platform.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 26, 2019, 4:43am UTC](https://meta.discourse.org/t/google-ads-not-displaying/116175/10 "2019-07-26T04:43:59Z")

</div>

CSP being on by default is somewhat new, and an important security feature, so we should update our docs.

---

<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: [January 24, 2023, 7:49pm UTC](https://meta.discourse.org/t/google-ads-not-displaying/116175/11 "2023-01-24T19:49:31Z")

</div>



---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [January 24, 2023, 7:51pm UTC](https://meta.discourse.org/t/google-ads-not-displaying/116175/12 "2023-01-24T19:51:44Z")

</div>


