我发现了一些网站,解释了如何在30-120秒后重新加载/刷新DFP广告管理系统广告,但没有一个网站解释是否可以使用Adsense广告 .
我尝试过DFP广告管理系统 - 与Adsense相比,它非常混乱 .
我目前的Adsense代码:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- MYSITE- Responsive - #1 -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-123456789..."
data-ad-slot="123456789"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
2 回答
AdSense的TOS禁止您所指的那种自动刷新 . 这并不意味着您无法以编程方式自动刷新AdSense代码 . 这确实意味着你几乎肯定会被禁止这样做 .
另一方面,使用AdSense Doubleclick for publishers(DFP)时允许此行为 . This documentation应该指向正确的方向,并且您想要调用这样的内容来刷新您的广告:
googletag.pubads().refresh();
以下教程应为您提供足够的信息,以确定如何使用AdSense DFP广告管理系统:
General Tutorial #1(过时但仍然有用)
General Tutorial #2(也过时了,但仍然有用)
Linking AdSense + DFP(这不是't work if you'使用DFP广告管理系统for Small Business;相反,您只想添加Adsense嵌入代码作为第三方广告素材
如果您坚持要在没有DFP广告管理系统的情况下自动刷新广告,则可以在计时器功能中执行以下操作:
document.getElementById('FrameID').contentWindow.location.reload(true);
建议: This will get you banned from AdSense if you are not using the service through DFP
在启动
<head>
标记后添加此代码将此代码放在您要在页面上展示广告的位置
此代码仅适用于一个广告
如果你想展示更多广告阅读完整帖子http://www.kyowal.com/rsiwal/posts/8702