Adsense Auto Ads in X Theme

Hey,

I’m having real trouble getting the Google Auto Ads code to work on my website. Here is the code:

< script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">
< script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: “ca-pub-4708403110589662”,
enable_page_level_ads: true
});
< /script>

(Please ignore the added spaces in tags due to the script not showing in this forum)

It’s meant to go in the < head > tag.

I’ve tried everything from basic plugins that insert scripts into the head to adding through functions.php and the obvious _header.php but nothing seems to work.

I’ve also tried the Adsense Wordpress plugins, but no joy. That being said, I do get one “Anchor ad” in mobile view, so some of the code does something, but it won’t populate through the website and in between paragraphs as Auto Ads should.

I know it should work, as I’ve tried this same code on other themes inside the < head > tag and it works as expected. I’ve also tested this on other X Theme sites I’ve built with the same odd result.

Any ideas what’s going on here?

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.