Adsense在我的AMP页面上返回错误的选择器。

问题描述 投票:0回答:1

我用的是AMP自动广告,我没有看到任何广告。当检查控制台时,我发现了这个。

log.js:251 [amp-auto-ads] 没有找到锚元素。

我挖了一下,发现投放来自Adsense的远程配置。

https://pagead2.googlesyndication.com/getconfig/ama?client=ca-pub-7726580065556509&plah=[site_url]&ama_t=amp&url=[Page_url]&__amp_source_origin=[site_url]

我得到的配置如下

{
   "producerVersion":"20200506_020425",
   "placements":[
      {
         "anchor":{
            "selector":"ARTICLE",
            "index":0,
            "sub":{
               "selector":"P",
               "all":true,
               "min_c":100
            }
         },
         "pos":4,
         "type":1,
         "style":{
            "top_m":10,
            "bot_m":24
         }
      },
      {
         "anchor":{
            "selector":"ARTICLE",
            "index":1,
            "sub":{
               "selector":"P",
               "all":true,
               "min_c":100
            }
         },
         "pos":4,
         "type":1,
         "style":{
            "top_m":10,
            "bot_m":24
         }
      },
      {
         "anchor":{
            "selector":"ARTICLE",
            "index":2,
            "sub":{
               "selector":"P",
               "all":true,
               "min_c":100
            }
         },
         "pos":4,
         "type":1,
         "style":{
            "top_m":10,
            "bot_m":24
         }
      },
      {
         "anchor":{
            "selector":"ARTICLE.post",
            "index":0,
            "sub":{
               "selector":"P",
               "all":true,
               "min_c":100
            }
         },
         "pos":1,
         "type":1,
         "style":{
            "top_m":10,
            "bot_m":24
         }
      },
      {
         "anchor":{
            "selector":"ARTICLE",
            "index":0,
            "sub":{
               "selector":"P",
               "all":true,
               "min_c":100
            }
         },
         "pos":1,
         "type":1,
         "style":{
            "top_m":10,
            "bot_m":24
         }
      },
      {
         "anchor":{
            "selector":"ARTICLE.post",
            "index":0,
            "sub":{
               "selector":"P",
               "all":true,
               "min_c":100
            }
         },
         "pos":4,
         "type":1,
         "style":{
            "top_m":10,
            "bot_m":24
         }
      }
   ],
   "attributes":{
      "data-tag-origin":"ampa",
      "data-package":"7979106250"
   },
   "optInStatus":[
      1
   ],
   "adConstraints":{
      "initialMinSpacing":"1vp",
      "subsequentMinSpacing":[
         {
            "adCount":3,
            "spacing":"2vp"
         },
         {
            "adCount":6,
            "spacing":"3vp"
         }
      ],
      "maxAdCount":8
   }
}

问题是,我没有 ARTICLE 标签在我的HTML页面上。这就是为什么我没有看到任何AMP广告。这是Adsense上的东西要修复还是让我处理并改变我的HTML结构?如果你知道的话,请标记Adsense团队的人。

amp-html amp-auto-ads
1个回答
0
投票

对于面临同样问题的人。我通过添加以下内容来解决这个问题 <article> 标签到我的AMP文档。

我相信发生这种情况是因为我们将我们的产品迁移到了一个新的产品,所以谷歌正在缓存旧的HTML,并根据我们AMP HTML的旧结构来提供自动广告。我希望这能帮助到你。

© www.soinside.com 2019 - 2024. All rights reserved.