最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - Adsense snippet not appearing in react app deployed in S3 - Stack Overflow

programmeradmin3浏览0评论

I'm making a small react web app. I would like to see how to add ads on it. I went on adsense and added the snippet to my index.html to have it look like this:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="theme-color" content="#000000" />
    <meta name="description" content="Web site created using create-react-app" />
    <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
    <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
    <title>Redacted</title>
    <script async src="https://pagead2.Redacted stuff" crossorigin="anonymous"></script>
  </head>
  <body>
    <noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="root"></div>
  </body>
</html>

When I go to the direct link in Amazon S3 / Buckets / bucket name / properties / static hosting I can access the website, and I see the link in the source code in .

To deploy the page, I use route53 and Cloudfront, but when I look at the deployed page on my domain, the link is missing from the , and adsense can't validate it.

I include git hashes in my footer to track the deployments, and the same commit in my domain doesn't have it, while the same commit directly from the url of my S3 has it.

I don't understand why, or what makes it disappear.

Do you have any idea what could be the cause for this?

发布评论

评论列表(0)

  1. 暂无评论