hexo的butterfly主题添加Google Adsense后审核失败
出现问题
已在hexo的butterfly主题配置文件中添加google adsense的客户号,但是adsense审核提示失败,如何解决?
hexo的配置:
1 | # Google Adsense (谷歌廣告) |
通过查看页面元素发现,静态页面中已经生成了adsense的代码:
1 | <script async="async" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><script>(adsbygoogle = window.adsbygoogle || []).push({ |
对比发现,这段js和接入google adsense的code不一致:
1 | <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1711515749423877" |
解决方法
关掉hexo的中google_adsense的配置,不让butterfly生成代码:
1 | # Google Adsense (谷歌廣告) |
在配置文件中搜索inject
,做如下配置:
1 | # Inject |
注意:以上所说的hexo配置指的是butterfly主题的配置文件。
另外:记得把google clientId更换为你自己的Google Adsense clientId。
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 独特的留白!
评论