是的,另一个有问题的谷歌广告和他们的回应广告。一个网站总共增加了三个广告,两个是“水平”,一个是“自动”。
为它们创建了CSS类,因为Adsense无法计算它们的宽度。
.adSidebar {
margin: auto;
max-height: 600px;
width: 302px;
}
.adContent {
margin: auto;
width: 300px;
@media #{$small-break} {
width: 320px;
}
@media #{$large-break} {
width: 730px;
}
}广告包括使用这些类。
<div class="adContainer">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle adContent" style="display:block" data-ad-client="ca-pub-123456789" data-ad-slot="987654321" data-ad-format="horizontal"></ins>
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>
</div>大约50%的时间,所有三个广告是正确的显示。然而,在其他情况下,有一两个人失踪,有时甚至全部失踪。错误信息:
TagError: adsbygoogle.push() error: No slot size for availableWidth=0但是,当我查看不使用Firebug显示的ins元素时,它会显示一个固定的宽度。
有人知道在哪里找这个问题吗?如果你想自己看看,网站是www.kfc-uerdingen.de。
P.S.:我尝试联系广告帮助,但由于该帐户是新的,因此还没有显示出稳定的收入,他们不会让你电子邮件。他们的支持论坛更糟糕。
发布于 2016-01-16 07:43:18
我认为这三个步骤可以帮助你解决问题;
首先,它在您的css中使用了用于移动的AdSense最小宽度的度量:
.adSidebar {
margin: auto;
max-height: 600px;
width: 320px;
/*width: 302px;*/
}
.adContent {
margin: auto;
width: 320px;
/*width: 300px;*/
@media #{$small-break} {
width: 320px;
}
@media #{$large-break} {
width: 730px;
}
}其次,在"head“块上加载初始化脚本一次,而不是在每个"ins”块中加载:
<head>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
</head>第三,在页面加载结束时使用Jquery加载块:
<script>
$(document).ready(function(){
$('ins').each(function(){
(adsbygoogle = window.adsbygoogle || []).push({});
});
});
</script>我希望这对你的问题有所帮助。
https://stackoverflow.com/questions/34824456
复制相似问题