如何在一个网站上放置多个AdSense广告单元?Google提供的代码只能针对每个单元。
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-123456"
data-ad-slot="123456"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
如果我想在一个网站上使用多个 AdSense 广告单元,该怎么办? 我只使用一次 <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
和 (adsbygoogle = window.adsbygoogle || []).push({});
,然后放置 <ins ...></ins>
代码到我想要的位置。
问题是只有第一个广告单元会被解析和显示。 要显示多个广告单元,需要做什么?
这是我如何使用它(只显示第一个 ins
):
<!doctype html>
<html>
<body>
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-123456"
data-ad-slot="first"></ins>
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-123456"
data-ad-slot="second"></ins>
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-123456"
data-ad-slot="third"></ins>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>
</body>
</html>
data-ad-slot
ID,对吧?我可以在同一页上为同一个广告单元(相同的data-ad-slot
)放置两个广告吗?谢谢。 - cbdeveloper