我们正在尝试将我们网站上的 DFP 广告调用转换为具有单一请求模式的异步呈现的 GPT 广告调用。我们试图用广告制作概念验证页面。但是页面似乎没有显示任何广告.....下面是我从https://support.google.com/dfp_premium/bin/answer.py?hl=en&answer=1638622&topic=28788&ctx=topic修改的代码
似乎收到了响应广告调用的错误请求......并且广告 div 为空
<html>
<head>
<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.pubads().set("adsense_background_color", "000000");
});
</script>
<script>
googletag.cmd.push(function() {
googletag.defineSlot("/N6752/adj/hw.bd/home",[728, 90], "div-gpt-ad-123456789-0")
.addService(googletag.pubads());
googletag.defineSlot("/N6752/adj/hw.bd/home", [300, 250] , "div-gpt-ad-123456789-1")
.addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
</head>
<body>
<div id="div-gpt-ad-123456789-0" style="width: 728px; height: 90px">
<script type="text/javascript">
googletag.cmd.push(function() {
googletag.display("div-gpt-ad-123456789-0");
});
</script>
</div>
<div id="div-gpt-ad-123456789-1">
<script type="text/javascript">
googletag.cmd.push(function() {
googletag.display("div-gpt-ad-123456789-1");
});
</script>
</div>
</body>
</html>