Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdSense ads not displaying #45

Open
bhrose opened this issue Aug 13, 2018 · 5 comments
Open

AdSense ads not displaying #45

bhrose opened this issue Aug 13, 2018 · 5 comments

Comments

@bhrose
Copy link

bhrose commented Aug 13, 2018

I can't get AdSense ads to show on my site, and instead have an empty iframe on individual posts. Example post using adsenseTop = true here. Example post using adsenseBottom = true here.

My config.toml file is set to

[params.info]
adsense = "5124404914438454" # Adsense ID (ID only, without ca-pub-)

This is the correct ID number, and my ID works for my test site on Blogger. Am I missing something, or do you know if there's another step I need to make on the AdSense side to enable ads to show?

@ribice
Copy link
Owner

ribice commented Aug 16, 2018

I can see the adsense code on your page's source just fine.

Perhaps it's something related to adsense itself?

@bhrose
Copy link
Author

bhrose commented Aug 16, 2018

Do you know where the data-ad-slot="6857547199" comes from, or how that's generated? It's the only difference between what AdSense says to use and what my site is actually using. And I think data-ad-slot tells AdSense what ad unit ID it should be displaying.

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5124404914438454"
     data-ad-slot="6929844789"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>

And this is what I'm seeing in the page source:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
--
  | <ins class="adsbygoogle"
  | style="display:block; text-align:center;"
  | data-ad-format="fluid"
  | data-ad-layout="in-article"
  | data-ad-client="ca-pub-5124404914438454"
  | data-ad-slot="6857547199"></ins>
  | <script>
  | (adsbygoogle = window.adsbygoogle \|\| []).push({});
  | </script>

@bhrose
Copy link
Author

bhrose commented Aug 16, 2018

Testing something. I edited the themes/kiss/layouts/partials/adsense.html file where data-ad-slot="6857547199" seems to be hard coded, and will let you know if ads start showing up in 24 hours.

@bhrose
Copy link
Author

bhrose commented Aug 16, 2018

Just confirmed updating the themes/kiss/layouts/partials/adsense.html file fixed my issue, and also confirmed both adsenseTop = true as well as adsenseBottom = true work as intended. If anyone else is seeing this issue, updating data-ad-slot="6857547199" in your adsense.html file to whatever your own AdSense account ad unit ID is should work, thanks!

@ribice
Copy link
Owner

ribice commented Aug 16, 2018

Hmm I tested it only with mine and it seemed to work fine. I'll look into other themes and see how they did that. Will probably need to provide ad-slot and ad-client after the fix is merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants