2013-05-07 83 views
0

一個廣告單元剛剛停止工作,並在嘗試生成新代碼後仍然無法工作。當我使用谷歌控制檯時,它只是顯示警告廣告單元未能獲取。其他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> 

有可能是因爲diferent標籤或代碼 注意的衝突:我只是WordPress的前端開發者,我沒有訪問谷歌服務DFP我不是生成的標籤或代碼

回答

1

編輯:根據這個討論,它看起來像使用舊的GAM標籤與GPT標籤現在可能是一個問題(最近)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> 
+0

非常感謝您的幫助 – levat 2013-05-20 11:50:53