javascript Google 广告已使用链接预加载进行预加载,但在窗口加载事件后的几秒钟内未使用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/53281784/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 10:09:47  来源:igfitidea点击:

Google ad was preloaded using link preload but not used within a few seconds from the window's load event

javascripterror-handlingadsense

提问by Jake

When I go to my website no ads are displaying even though I set one at the bottom of the page. It returns error - The resource https://pagead2.googlesyndication.com/pagead/js/r20181107/r20180604/show_ads_impl.jswas preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate asvalue and it is preloaded intentionally.Yes, adblocker is disabled Here's my code for ad:

当我访问我的网站时,即使我在页面底部设置了广告,也没有显示广告。它返回错误 -资源https://pagead2.googlesyndication.com/pagead/js/r20181107/r20180604/show_ads_impl.js是使用链接预加载预加载的,但在窗口加载事件的几秒钟内未使用。请确保它具有适当的as值并且是有意预加载的。是的,adblocker 被禁用这是我的广告代码:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-9121789382833091"
     data-ad-slot="8487804504"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>

回答by fbparis

I suspect this is not the reason why ads doesn't show because after a few hours without updating the source code of the page the ads finally display, but the warning is still here in the javascript console.

我怀疑这不是广告不显示的原因,因为几个小时后没有更新页面的源代码,广告最终显示,但警告仍然在 javascript 控制台中。

I've noticed that every time I'm updating the source code, the ads disappear again for a few hours so I guess Google doesn't really "trust" me and ads are automatically suspended till a bot or something comes back to check that everything is OK.

我注意到每次我更新源代码时,广告都会再次消失几个小时,所以我猜谷歌并不真正“信任”我,广告会自动暂停,直到机器人或其他东西回来检查一切都好。

回答by Ryan NZ

Are you using Cloudflare? I fixed this by disabling rocket loader on the adsense script.

您在使用 Cloudflare 吗?我通过在 adsense 脚本上禁用火箭装载机来解决这个问题。

data-cfasync="false"

I have read multiple times that rocket loader has no negative effect on Adsense, now I am not so convinced.

我已经多次阅读火箭装载机对 Adsense 没有负面影响,现在我不太相信。