首页 文章

重新加载Adsense广告,还是必须使用DFP广告管理系统?

提问于
浏览
8

我发现了一些网站,解释了如何在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 回答

  • 0

    AdSense的TOS禁止您所指的那种自动刷新 . 这并不意味着您无法以编程方式自动刷新AdSense代码 . 这确实意味着你几乎肯定会被禁止这样做 .

    另一方面,使用AdSense Doubleclick for publishers(DFP)时允许此行为 . This documentation应该指向正确的方向,并且您想要调用这样的内容来刷新您的广告:

    googletag.pubads().refresh();

    以下教程应为您提供足够的信息,以确定如何使用AdSense DFP广告管理系统:

    如果您坚持要在没有DFP广告管理系统的情况下自动刷新广告,则可以在计时器功能中执行以下操作:

    document.getElementById('FrameID').contentWindow.location.reload(true);

    建议: This will get you banned from AdSense if you are not using the service through DFP

  • 11

    在启动 <head> 标记后添加此代码

    <script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
    <script src=’http://connect.kyowal.com/kp_dev/developer/refresh.js’ type=’text/javascript’/>
    <script>
    var adsenceblockone = ‘<ins class=’adsbygoogle’ data-ad-client=’ca-pub-1385863686986530′ data-ad-format=’auto’ data-ad-slot=’5134528809′ style=’display:block’/>‘;
    </script>
    

    将此代码放在您要在页面上展示广告的位置

    <div id=”adsrefreshone”></div>
    <script>
    adsencerefreshone();
    </script>
    

    此代码仅适用于一个广告

    如果你想展示更多广告阅读完整帖子http://www.kyowal.com/rsiwal/posts/8702

相关问题