Google Adsense content security policy error

AI-generated summary

The discussion revolves around a Google Adsense content security policy (CSP) error causing ads to fail to load on a Discourse site. Callum_OKane reports that ads only display the word “advertisement” with a CSP error. awesomerobot directs them to a guide on adjusting CSP settings, suggesting a permissive policy to allow Google scripts. After adding https: to the policy, Callum_OKane notes the ad area expanded but still shows no content. awesomerobot observes that the ad iframe loads but is empty, with no clear errors in the console. Callum_OKane shares the site URL for inspection. awesomerobot confirms the ad plugin appears to work but suspects Google-side issues, suggesting checking the Adsense account for errors or submitting a report via Google’s support form 8.

Adsense fails to load ads and just shows the word advertisement with the following error

See Mitigate XSS Attacks with Content Security Policy - #3 by pmusaraj, here’s the relevant portion (you can find these settings by searching your site settings for content security policy):

OK, I added https:, and now the advert location just grew and takes up a big part of the page now, when it only took one line for the word advertisement before

Looks like the script is working now but the ad is failing to load for some reason… are there any errors?

I am actually on mobile right now and will not have access to my pc for a bit as it’s being repaired, you can go to the site here and check the console for errors. https://support.maniabots.xyz

Took a quick look and it’s not entirely clear to me. I believe the ad plugin is working now because you get a Google iframe served for the ad… but there’s no content in that iframe. I don’t see any related errors.

Why would the iframe have no content?

On the Discourse side it looks like things are working, but I have no insight into reasons why Google might not be serving ads.

Are there any errors or notifications in your adsense account? For new sites sometimes it can take a little while for ads to start being served.

If you’re not seeing any issues with your configuration Google does have a specific form you can submit in the case where ads aren’t appearing: https://support.google.com/adsense/contact/cant_see_ad