簡體   English   中英

prebid.js 廣告未呈現

[英]prebid.js ad is not getting rendered

我已經在測試頁面上設置了帶有單個適配器的 prebid.js。 我從適配器獲得廣告響應,我可以看到 pbjs.getBidResponses() 對象仍然存在,但廣告沒有在頁面上呈現。

你可以訪問測試頁面

標准預投標設置如下

腳本

var sizes = [
  [300, 250]
];
var PREBID_TIMEOUT = 1000;
var FAILSAFE_TIMEOUT = 3000;

var adUnits = [{
  code: '/19968336/header-bid-tag-1',
  mediaTypes: {
    banner: {
      sizes: sizes
    }
  },
  bids: [{
    bidder: 'incrementx',
    params: {
      placementId: 'PNX-HB-R787915V41024E'
    }
  }]
}];

// ======== DO NOT EDIT BELOW THIS LINE =========== //
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function () {
  googletag.pubads().disableInitialLoad();
});

var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

pbjs.que.push(function () {
  pbjs.addAdUnits(adUnits);
  pbjs.requestBids({
    bidsBackHandler: initAdserver,
    timeout: PREBID_TIMEOUT
  });
});

function initAdserver() {
  if (pbjs.initAdserverSet) return;
  pbjs.initAdserverSet = true;
  googletag.cmd.push(function () {
    pbjs.setTargetingForGPTAsync && pbjs.setTargetingForGPTAsync();
    googletag.pubads().refresh();
  });
}

// in case PBJS doesn't load
setTimeout(function () {
  initAdserver();
}, FAILSAFE_TIMEOUT);

googletag.cmd.push(function () {
  googletag.defineSlot('/19968336/header-bid-tag-1', sizes, 'div-1')
    .addService(googletag.pubads());

  googletag.pubads().collapseEmptyDivs();
  googletag.pubads().enableSingleRequest();
  googletag.enableServices();
});

HTML

<div id='div-1'>
    <script type='text/javascript'>
        googletag.cmd.push(function () {
            googletag.display('div-1');
        });
    </script>
</div>

適配器響應

{
    "vzhPlacementId": "<placement-id>",
    "bid": "<bid>",
    "adWidth": "300",
    "adHeight": "250",
    "cpm": "0.017442",
    "ad": "<ad-tag>",
    "slotBidId": "<slot-id>",
    "statusText": "Vertoz:Success"
}

pbjs.getBidResponses() 輸出

{
    "/19968336/header-bid-tag-1": {
        "bids": [
            {
                "bidderCode": "incrementx",
                "width": 300,
                "height": 250,
                "statusMessage": "Bid available",
                "adId": "389575b4d6d5f1",
                "requestId": "2b7446c2969f1f",
                "transactionId": "a6a81b3e-8cf7-4d71-bc7e-34c283e1a746",
                "auctionId": "4455d9a4-4364-4f9d-bd1a-d7f0a7fd56e4",
                "mediaType": "banner",
                "source": "client",
                "cpm": 0.017442,
                "currency": "USD",
                "ttl": 300,
                "creativeId": 0,
                "netRevenue": false,
                "meta": {
                    "mediaType": "banner",
                    "advertiserDomains": [],
                    "dchain": {
                        "ver": "1.0",
                        "complete": 0,
                        "nodes": [
                            {
                                "name": "incrementx"
                            }
                        ]
                    }
                },
                "ad": "<ad-tag>",
                "adapterCode": "incrementx",
                "originalCpm": "0.017442",
                "originalCurrency": "USD",
                "responseTimestamp": 1656921876245,
                "requestTimestamp": 1656921875927,
                "bidder": "incrementx",
                "adUnitCode": "/19968336/header-bid-tag-1",
                "timeToRespond": 318,
                "pbLg": "0.00",
                "pbMg": "0.00",
                "pbHg": "0.01",
                "pbAg": "0.00",
                "pbDg": "0.01",
                "pbCg": "",
                "size": "300x250",
                "adserverTargeting": {
                    "hb_bidder": "incrementx",
                    "hb_adid": "389575b4d6d5f1",
                    "hb_pb": "0.00",
                    "hb_size": "300x250",
                    "hb_source": "client",
                    "hb_format": "banner",
                    "hb_adomain": ""
                },
                "status": "targetingSet"
            }
        ]
    }
}

pbjs.getAllPrebidWinningBids() & pbjs.getAllWinningBids() 輸出

[]

這是我得到的輸出

在此處輸入圖像描述

找不到問題,只集成了 1 個適配器,所以在所有情況下都應該中標,不確定我是否在設置中遺漏了什么? 任何幫助將不勝感激,謝謝

因為此行是 prebid.org 文檔的副本:

  googletag.defineSlot('/19968336/header-bid-tag-1', sizes, 'div-1')

我認為您沒有正確配置自己的 GAM 帳戶。 您需要擁有一個 GAM 帳戶並將defineSlot的第一個參數切換為您自己的 GAM 廣告單元代碼。

如果您想避免使用 GAM,則需要遵循投標后的說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM