【问题标题】:Ad stopped showing up. Ad unit failed to fetch. Other ads are working normally but with different code.广告停止出现。未能提取广告单元。其他广告工作正常,但代码不同。
【发布时间】:2013-05-07 21:06:37
【问题描述】:

一个广告单元刚刚停止工作,但在尝试生成新代码后仍然无法正常工作。当我使用谷歌控制台时,它只是显示警告广告单元无法获取。其他 3 个广告正常工作。它们是在我开始从事这个项目之前插入的。

新的广告代码生成如下 标题

<script type='text/javascript'>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') + 
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>

<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('/6000854/R300x250_L', [300, 250], 'div-gpt-ad-1367703773182-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>

身体

    <!-- R300x250_L -->
<div id='div-gpt-ad-1367703773182-0' style='width:300px; height:250px;'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1367703773182-0'); });
</script>
</div>

旧代码的生成方式如下 标题

<script type='text/javascript' src='http://partner.googleadservices.com/gampad/google_service.js'></script>

    <script type='text/javascript'>
        GS_googleAddAdSenseService("ca-pub-2838961657718357");
        GS_googleEnableAllServices();
    </script>

    <script type='text/javascript'>
        GA_googleAddSlot("ca-pub-2838961657718357", "Top728x90");
        GA_googleAddSlot("ca-pub-2838961657718357", "Right300x250");
        GA_googleAddSlot("ca-pub-2838961657718357", "Right300x250Bottom");
    </script>

    <script type='text/javascript'>
        GA_googleFetchAds();
    </script>

身体

<!-- Right300x250Bottom -->
        <script type='text/javascript'>
            GA_googleFillSlot("Right300x250Bottom");
        </script>

是否可能因为不同的标签或代码而发生冲突 注意:我只是 wordpress 前端开发人员,无法访问 google DFP 服务,也不会生成代码或代码

【问题讨论】:

    标签: wordpress ads adsense google-dfp


    【解决方案1】:

    编辑:根据这个讨论,使用带有 GPT 标签的旧 GAM 标签现在可能是一个问题(就在最近)http://productforums.google.com/forum/#!topic/dfp/snK7znwUMBE

    我认为您应该将 GAM 代码转换为 GPT 代码,并尽可能仅使用 DFP GPT 代码来阻止这种情况发生...这很可能是两个脚本之间的冲突,并且取决于它们加载 GPT 的顺序标签可能不起作用...

    原件: 我刚刚尝试了您的代码,并且按预期显示了两个广告。因此,同时使用这两个脚本似乎没有任何冲突。

    您是否可能已经多次刷新页面,以至于由于速率限制而不再通过 DFP 为您展示广告?不过,这只是一个疯狂的猜测。如果我经常刷新页面,我确实会不时在控制台中收到无法获取消息,所以我认为这可能只是一个速率限制,普通用户不会有问题。

    这是我正在使用的代码,页面上显示了两个 300x250 的广告,因此一切正常。

    <html>
    <head>
        <title>DFP TEST</title>
    
        <script type='text/javascript'>
        var googletag = googletag || {};
        googletag.cmd = googletag.cmd || [];
        (function() {
        var gads = document.createElement('script');
        gads.async = true;
        gads.type = 'text/javascript';
        var useSSL = 'https:' == document.location.protocol;
        gads.src = (useSSL ? 'https:' : 'http:') +
        '//www.googletagservices.com/tag/js/gpt.js';
        var node = document.getElementsByTagName('script')[0];
        node.parentNode.insertBefore(gads, node);
        })();
        </script>
    
        <script type='text/javascript'>
        googletag.cmd.push(function() {
        googletag.defineSlot('/6000854/R300x250_L', [300, 250], 'div-gpt-ad-1367703773182-0').addService(googletag.pubads());
        googletag.pubads().enableSingleRequest();
        googletag.enableServices();
        });
        </script>
    
    <script type='text/javascript' src='http://partner.googleadservices.com/gampad/google_service.js'></script>
    
        <script type='text/javascript'>
            GS_googleAddAdSenseService("ca-pub-2838961657718357");
            GS_googleEnableAllServices();
        </script>
    
        <script type='text/javascript'>
            GA_googleAddSlot("ca-pub-2838961657718357", "Top728x90");
            GA_googleAddSlot("ca-pub-2838961657718357", "Right300x250");
            GA_googleAddSlot("ca-pub-2838961657718357", "Right300x250Bottom");
        </script>
    
        <script type='text/javascript'>
            GA_googleFetchAds();
        </script>
    
    </head>
    <body>
    
        <!-- R300x250_L -->
    <div id='div-gpt-ad-1367703773182-0' style='width:300px; height:250px;'>
    <script type='text/javascript'>
    googletag.cmd.push(function() { googletag.display('div-gpt-ad-1367703773182-0'); });
    </script>
    </div>
    
    <!-- Right300x250Bottom -->
            <script type='text/javascript'>
                GA_googleFillSlot("Right300x250Bottom");
            </script>
    
    </body>
    </html>
    

    【讨论】:

    • 非常感谢您的帮助
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-09
    • 2017-01-11
    • 2016-09-19
    相关资源
    最近更新 更多