Intergrating Google Adsense with X Theme

Hello,

I am trying to monetize my site by adding google adsense. Unfortunately I cannot get the ads to show up on my site. They are not showing up in any of the widget/sidebar areas or my elements. Any advice?

Hi,

You can try this code instead

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:inline-block;width:320px;height:100px"
     data-ad-client="ca-pub-xxxxxxxxxxxxx"
     data-ad-slot="xxxxxxxxxxxxx"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Make sure to change data-ad-client, data-ad-slot and also the width and height.

Hope that helps.

Hello, I tried this edit but it did not work either.

Hi There,

I have tried to login to your site, but I couldn’t. Please check the secure note and confirm.

Did you paste your code into a Text widget and test ?

Thanks!

I have edited the secure note with the correct information to sign in.

Yes, I pasted in code into the text widget but it did not appear.

Hello There,

You added in the header widget which is not visible in the site. I enabled the header widget and I can confirm that it is displaying blank. Please make sure that in your Google Adsense manager, you allow the domain to display the ads.

Please use the Custom html widget and not the text widget.

And there is something wrong with your adsense code. It has an error on the page: http://prntscr.com/htmqjr

Hope this helps. Please let us know how it goes.

I tried the custom html widget and confirmed that the site is verified in my ad-sense account. Im not sure about the error code. Should I just download a plugin and try it that way?

Hi there.

I think it will be the same even if you install a plugin

"adsbygoogle.push() error: No slot size for availableWidth=0"
name
:
"TagError"
stack
:
"TagError: adsbygoogle.push() error: No slot size for availableWidth=0↵    at Vg (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:1:35998)↵    at Wg (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:1:34901)↵    at ei (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:1:58581)↵    at ki (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:1:61777)↵    at li (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:1:61702)↵    at Fi (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:1:67171)↵    at https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:1:65472↵    at Sd (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:1:14707)↵    at Yd (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:1:17255)↵    at Gi (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:1:65451)"

Please check this https://stackoverflow.com/questions/40112557/adsense-responsive-no-slot-size-for-availablewidth-0

Try placing your ads in a visible location instead of header widget which is hidden.

Thanks!

I have figured out the issue. You can close this topic.

Hi There,

Glad you sorted things out, would you mind sharing what causes the issue and solution so it can help other users who may find this thread.

Thanks,

I made the mistake on my end and so did google. Nothing wrong with x theme.

When I created the adsense account I happened to made it through youtube. But you need to get your adsense account validated and approved if you also want to show ads on anything else like your website. So I had an adsense account but I did not have permission from google to display ads on my site. Hope that helps out anybody facing similar issues.

Moral of story sign up for adsense through google and not youtube.

Thank you very much, for sure that’s going to help a lot of users.

Happy Holidays, Cheers :slight_smile:

Well, I hope I helped other users out because Im still stuck on the same issue lol. I thought fixing my ad-sense account would fix this problem but no luck :frowning:.

For some reasons my adds just wont appear even though everything is set up correctly. Any other thoughts or suggestions.

Thanks for the help guys and Happy Holidays to you as well.

Hey There,

The best thing you can do is to ask further assistance from Google Adsense. They should be able to figure out why an ad is not displaying with you insert the code in your site.

Best Regards.

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