【发布时间】:2019-05-31 06:36:51
【问题描述】:
根据研究,2014 年有一个先前的问题 (Is Google adsense available for localhost?) 建议添加:
data-adtest="on"
在测试和阅读comments 之后,该解决方案不再有效。在广告单元中:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- responsive_ad -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-####"
data-ad-slot="######"
data-ad-format="auto"
data-adtest="on"
data-full-width-responsive="true">
</ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
在 Chrome、Firefox 和 Safari 中进行测试后,会呈现一个白框。搜索后,我无法在产品论坛或任何网站上找到任何解决方案。如何在 localhost 中测试广告单元?
【问题讨论】:
标签: javascript html localhost mamp adsense