Adsense Auto Ads on Pro 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?

Hello @mhenshall,

Thanks for asking. :slight_smile:

To add the adsense code I suggest you to use Insert Headers and Footers plugin. To get started with the plugin, please take a look at following resource.

https://www.wpbeginner.com/plugins/how-to-add-header-and-footer-code-in-wordpress/

Thanks.

Hey Prasant,

Unfortunately, I have tried this plugin, and it still only produces the anchor ads in mobile view. No other auto placed ads as it should do.

When I insert this code on my other themes, it works perfectly.

Thanks for your help so far,
Marc

Hello There,

Please temporarily switch to twenty seventeen theme and activate Insert Header and Footers plugin. Place the Google Ad code and check your site if the ad is displaying. If no add is displayed, please check your Google Ad code as it may only allow to display in mobile and not in any other screen size.

If possible, please provide us access to your site so that we can take a closer look and investigate this issue.

Thanks.

Thanks for your help so far.

I’ve tried the twenty eventeen theme, but no luck. Here is a temporary login (any further help greatly appreciated):

https://www.yoursoundmatters.com/wp-admin/

User: apex
Pass: support123

Hello There,

I am guessing the it is not displaying because you may not have properly set it up. You must meet any requirements first before implementing the code in your site.

For added information, please review these links:
https://support.google.com/adsense/answer/7480616?hl=en
https://adsense.googleblog.com/2018/02/introducing-adsense-auto-ads.html

And if still nothing is working, I would highly recommend that you ask further help from the Adsense team.
https://support.google.com/adsense#topic=3373519

Thank you for your understanding.

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