Google Adsense响应广告不显示 [英] Google Adsense Responsive Ads Not Showing
问题描述
在以下链接此处,我有3个广告,右/左/标题广告。他们使用的是响应单位,状态为有效,问题是响应式广告未展示,Google搜索显示它是由CSS主题引起的,也许广告单元没有占用父级div的大小。 p>
我尝试过以下操作:
< div class = right-ad>
< script async src =// pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"> ;</script>
< ins class =adsbygoogle
style =display:inline
data-ad-client =ca-pub-1588985522291479
data-ad-slot = 8975496541
data-ad-format =auto>< / ins>
< script>
(adsbygoogle = window.adsbygoogle || [])。push({});
< / script>
< / div>
2:
code>< script async src =// pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"> ;</script>
< ins class =right-ad
style =display:inline
data-ad-client =ca-pub-1588985522291479
data- slot =8975496541
data-ad-format =auto>< / ins>
< script>
(adsbygoogle = window.adsbygoogle || [])。push({});
< / script>
仍为空白,CSS如下(最小950像素):
margin-right:1%;
position:relative;
width:13%;
height:100%;
margin-top:1em;
float:right;
border-top-left-radius:2px;
border-top-right-radius:2px;
border-bottom-right-radius:2px;
border-bottom-left-radius:2px;
box-shadow:rgba(0,0,0,0.0980392)0px 2px 4px,rgba(0,0,0,0.0980392)0px 0px 3px;
为什么仍为空白?
编辑:
< / div>
< div class =left-ad>
< script async
src =// pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"> ;</script>
< ins class =adsbygoogle
style =display:block
data-ad-client =ca-pub-1588985522291479
data-ad-slot = 8975496541
data-ad-format =auto>< / ins>
< script>
(adsbygoogle = window.adsbygoogle || [])。push({});
< / script>
< / div>
ins class =right-ad
style =display:inline
将此添加到广告的HTML?您不应该更改广告代码。对于 data-ad-format =auto
,广告将适应容器的大小。只需移除您添加到广告代码中的内容,然后更改容器即可。在您的情况下,< div class =right-ad>
div。
一个常规的广告代码看起来像
< div class =my-containerstyle =width:500px; height:300px >
< script async src =// pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"> ;</script>
< ins class =adsbygoogle
style =display:block
data-ad-client =ca-pub-XXXXXXXXXXX
data-ad-slot = XXXXXXXXXXX
data-ad-format =auto>< / ins>
< script>
(adsbygoogle = window.adsbygoogle || [])。push({});
< / script>
< / div>
因此, style =display:inline
应为
style =display:block
In the following link here, i have 3 ads, Right / Left / Header Ads. They're using Responsive Units, the status is "Active", the problem is the Responsive ads are not showing, Googling revealed that it's caused by the CSS theming, maybe the Ad units are not taking the size of the parent div .
I've tried the following :
<div class="right-ad">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:inline"
data-ad-client="ca-pub-1588985522291479"
data-ad-slot="8975496541"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
2 :
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="right-ad"
style="display:inline"
data-ad-client="ca-pub-1588985522291479"
data-ad-slot="8975496541"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Still blank, the CSS is as the following ( min 950px ) :
margin-right: 1%;
position: relative;
width: 13%;
height: 100%;
margin-top:1em;
float:right;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px;
box-shadow: rgba(0, 0, 0, 0.0980392) 0px 2px 4px, rgba(0, 0, 0, 0.0980392) 0px 0px 3px;
Why it's still blank ?
Edit :
</div>
<div class="left-ad">
<script async
src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1588985522291479"
data-ad-slot="8975496541"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
<ins class="right-ad"
style="display:inline"
Did you add this to the ad's HTML? You are not supposed to change the ad code. For data-ad-format="auto"
the ad will adapt to the container's size. Simply remove what you added to the ad code and change the container instead. In your case, the <div class="right-ad">
div.
This is what a regular ad code looks like
<div class="my-container" style="width: 500px; height: 300px">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-XXXXXXXXXXX"
data-ad-slot="XXXXXXXXXXX"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
So, your style="display:inline"
should be
style="display:block"
这篇关于Google Adsense响应广告不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!