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.
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.
For anyone who runs into the same issues, steps to get ads going seems to be:
Disable content_security_policy
Make sure the official Ad plugin is installed and active.
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.
É meio irritante que um plugin de anúncios seja oferecido, mas não há nenhuma menção à configuração do CSP no plugin de anúncios. Acho que você fica à mercê de explorar o mato dos bugs, né?
Por que não avisar aos usuários no README do plugin de anúncios: “Você precisa configurar o CSP”?
O plugin de anúncios deveria lidar com as entradas do CSP para o AdSense ou plataforma de anúncios relevante.