【问题标题】:AMP: <amp-ad> not showing adense ads, but empty fieldAMP:<amp-ad> 未显示 adense 广告,但字段为空
【发布时间】:2017-11-17 20:02:35
【问题描述】:

我在使用 amp-ad 时遇到问题。

<!DOCTYPE html>
<html amp lang="en">
<head>
    <meta charset="utf-8">
    <script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
    <script async src="https://cdn.ampproject.org/v0.js"></script>
    <meta name="viewport" content="width=device-width,minimum-scale=1">
    <link rel="canonical" href="http://localhost:9000/simple-test.html">
    <title>AMP Test</title>
    <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
</head>
<body>
    <section id="content">
        <div style="width: 728px; height: 90px">        
            <amp-ad width=728 height=90
                type="adsense"
                data-ad-client="ca-pub-XXXXXXXXXXXXXXXXX"
                data-ad-slot="XXXXXXXXX">
            </amp-ad>
        </div>
    </section>
</body>
</html>

它没有被显示。取而代之的是具有指定尺寸的元素,它插入了一些脚本和 iframe,但那里没有广告。我尝试了所有可用的布局。我还尝试了不同的广告尺寸。根据验证器,代码是可以的。

传统的 JavaScript 版本可以正常工作。 有什么帮助吗?

【问题讨论】:

    标签: html ads adsense amp-html


    【解决方案1】:

    Adsense AMP 广告不会在本地开发网站上展示。将其上传到实时站点可能会起作用。还要确保您的域在 AdSense 设置中被列入白名单。

    【讨论】:

    • 它在 localhost 中确实有效,但对于广告代码,不能保证一定会投放广告。因此,广告当时可能不会投放。
    【解决方案2】:

    我认为您必须在 Google 上为发布商创建一个帐户才能在您的网站上获取 AdSense。该网站将引导您完成它。您还可以查看 DFP 广告测试页。希望有所帮助:-)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-17
      • 1970-01-01
      • 2019-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多