我有一个在 Apache2 上运行的网站,并且有 PHP 和 JS + HTML 代码。
这是我的广告单元的代码:
我有一个已获批准的 Adsense 帐户,几个月以来一直在展示广告并获得收入。
我创建了一个 Adsense 广告单元并将其放置在该网站上,但它没有出现。
如果它有用,我的帐户既没有被禁止也没有使用广告拦截器。 在此处的 Adsense 沙箱中进行测试时,广告也可以正常工作:http://ctrlq.org/sandbox/
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 728x90_leaderboard -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-xxxxxx"
data-ad-slot="xxxxxx"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
可能是什么问题?调试控制台中没有显示任何错误。
提前谢谢你。
最佳答案
删除 async
然后尝试:
<script class="cc-onconsent-inline-advertising" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-xxxx"
data-ad-slot="xxxx"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
您也可以点击此链接: http://www.labnol.org/internet/google-adsense-responsive-design/25252/
关于javascript - Adsense 广告未出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37370870/