【问题标题】:Ad units are being cut off in adsense responsive mode广告单元在 adsense 响应模式下被切断
【发布时间】:2016-04-20 04:08:03
【问题描述】:

在我开始使用自适应广告之前,我可以在通过 javascript 加载之前为每个广告单元指定特定的宽度和高度,这样效果会很好,但问题是,有些网页的 RPM 为 0 美元。我刚刚切换到响应式广告单元,即使整个广告没有出现在屏幕上,我最终的每千次展示收入也超过了 0 美元。我正在寻找答案。

基本上我制作了一个框架代码,它应该只为广告保留屏幕顶部。我希望能够以小写字母(我这样做)看到“广告”一词,然后是广告本身,然后是空格。一切都很好,除了广告本身。我为广告单元指定了 50 像素的最大高度,因为我试图使广告尺寸的高度最多为 50 像素,但我希望整个广告出现在屏幕上,而不是它的一部分。

我可以做些什么来解决这个问题? (如果下面的代码没有足够的广告内容,请原谅我,但它只是一个框架代码,我会在稍后处理文本内容。)

<html>
  <head>
    <style>
      #BOX{font-size:70%;width:100%;overflow:hidden;margin-bottom:8px}
      #AD{display:block;width:100%;overflow:hidden;max-height:50px}
    </style>
  </head>
  <body>
    <div ID="BOX">
      Advertisement<br>
      <script src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" async>
      </script>
      <ins ID="AD">
      </ins>
      <script>

      if(Q('AD')){
        (adsbygoogle=window.adsbygoogle||[]).push(X())
      }

      function X(){
        Q('AD').className='adsbygoogle';
        return {
          params:{
            google_ad_client:'publisherID',
            google_ad_slot:'responsiveadunitslotID',
            google_ad_format:'auto',
            google_page_url:'http://www.example.com/'
            }
          }
      }

      function Q(x){
        return document.getElementById(x)
      }

      </script>
    </div>
    <p>Content</p>
  </body>
</html>

【问题讨论】:

    标签: html css debugging adsense ads


    【解决方案1】:

    如果你想要 to control the heightins.adsbygoogle,我认为你会想要删除 google_ad_format:'auto'(智能调整大小)。 (这意味着您需要在#AD 上设置height,而您不需要overflow:hiddens。)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-21
      • 2018-01-24
      • 2016-09-25
      • 2017-12-14
      • 1970-01-01
      • 1970-01-01
      • 2013-12-18
      • 2014-11-22
      相关资源
      最近更新 更多