Google Ads not showing

AI-generated summary

Google Ads not showing

dcpartners is experiencing issues with Google Ads not showing on their subdomain ask.dewalist.com, despite having Adsense set up and working on their main site and another subdomain.

RGJ suggests a Content Security Policy (CSP) issue, which dcpartners attempts to resolve by adding a directive to their app.yml file. However, this doesn’t solve the issue.

Jagster recommends using the “Content Security Policy Report Only” setting instead, which dcpartners tries, but initially reports no success.

However, in a later update, RGJ confirms that ads are now showing, and dcpartners attributes the fix to Jagster’s suggestion, with plans to remove the CSP directive from their app.yml file.

We have subdomain websites as well, the main - called Dewalist.com.

We already set up Google Adsense, and working well with the main site and one of the subdomains. But it didn’t work with this website: ask.dewalist.com, where the Discourse web app is.

We already configured the Adsense Publisher code and the ad unit.

It came up with ADVERTISING text, but no advertising showed up. We checked the view source code, which has the right PUB and ad unit id.

Any ideas?

We are appreciated your feedback.

Content Security Policy: The page’s settings blocked the loading of a resource at https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js (“script-src”).

Hi @RGJ

Thanks for the input. Can you elaborate on this, please? What do we need to do?

Thanks

We researched further on this.

Regarding this CSP, it looks like we need to add this on app.yml under env section:

DISCOURSE_CSP_DIRECTIVES: "default-src 'self' https://pagead2.googlesyndication.com"

We added this, rebuilt the app, restarted the app and still not working.

Any other ideas?

Don’t use CSP or let it only reports?

Hi Jakke

Can you elaborate on this, please?

Thank you

Don’t use setting content security policy Use setting content security policy report only instead, if CORS is hiding ads.

OK. I just ticked that now:

content security policy report only

Still not working. Do I need to remove CSP?

I was going to have another look for you but ads are showing, so better not touch anything anymore :wink:

I think Jakke’s suggestion worked well.

I might remove the CSP from app.yml stuff