【问题标题】:Google Adsense not able to access Google Adsense code in website header, how to fix this?Google Adsense 无法访问网站标题中的 Google Adsense 代码,如何解决此问题?
【发布时间】:2020-08-10 02:25:02
【问题描述】:

我的网站(http://www.only4laugh.com) 不是基于 WordPress,我使用 JavaScript 框架 (ReactJS) 构建我的网站,在连接您的网站步骤谷歌提供代码以放入网站标题

<script data-ad-client="ca-pub-8461898881815761" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

我粘贴在我的网站上,但 Adsense 仍然显示错误 “代码丢失或不完整”

【问题讨论】:

    标签: adsense


    【解决方案1】:

    好吧,我需要使用 Nextjs 来解决我的问题。 Nextjs 允许在我使用导致问题的 React-Helmet 之前在服务器端渲染,它在标题上显示元标记但未在浏览器第一个快照上显示,所以我在将 react-helmet 替换为 next/head 后它解决了我的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-10
      相关资源
      最近更新 更多