1

我对 Header Bidding 的世界很陌生,有些机制对我来说不是很清楚,无论如何我必须编写自己的投标适配器(仅native)。

我已经定义了函数isBidRequestValid() buildRequests() interpretResponse() onBidWon()。为了测试目的,我使用integrationExamples/gpt/native_example.html withappnexusAdaptermycustomAdapter.

我能够为我的投标人的服务器创建投标请求并解析投标响应。但是我坚持这一点,当我的出价高于 appnexus 出价时,我没有得到 DFP 的响应,并且onBidWon()没有触发事件。如果附加出价高于我的出价,我会从 DFP 获得有效响应,appnexus onBidWon()触发该事件,并且 adUnits 会填充附加的广告素材。

AppNexus 响应两个广告素材(0.5 美元 cpm 和 10.00 美元 cpm),我的服务器也响应了两个随机 cpm (1-100) 的广告素材。

这是一个返回的出价示例interpretResponse

{
   adUnitCode: "/19968336/prebid_native_example_1",
   cpm: 15,
   creativeId: "5ce6aa65bdf6bf2d36654a2d",
   currency: "EUR",
   height: 1,
   mediaType: "native",
   native: {
      title: "Other great advices to try",
      sponsoredBy: "Other Great Company",
      clickUrl: "https://affiliate.company.com/click/cn9s9c627i",
      image: {
         height: 1,
         url: "https://cdn.mysite.com/5f9aaf8b0afcd63d2c35d180.jpg",
         width: 1,
      }
   },
   netRevenue: true
   requestId: "2f30d517a4c847"
   ttl: 300,
   width: 1,
}

从控制台日志中,我可以看到以下信息:

INFO: Invoking pbjs.onEvent Arguments
INFO: Invoking pbjs.addAdUnits 
MESSAGE: Emitting event for: addAdUnits
MESSAGE: Emitting event for: requestBids
INFO: Invoking pbjs.requestBids
MESSAGE: Emitting event for: beforeRequestBids
INFO: Bids Requested for Auction with id: f90900e7-b0da-41a1-a834-e5ca4f234891
MESSAGE: Emitting event for: auctionInit
MESSAGE: CALLING BIDDER ======= appnexus
MESSAGE: Emitting event for: bidRequested
MESSAGE: CALLING BIDDER ======= custom
MESSAGE: Emitting event for: bidRequested
MESSAGE: Emitting event for: bidAdjustment
INFO: suppressing empty key 'hb_deal' from adserver targeting
MESSAGE: Emitting event for: bidResponse
MESSAGE: Emitting event for: bidAdjustment
INFO: suppressing empty key 'hb_deal' from adserver targeting
MESSAGE: Emitting event for: bidResponse
MESSAGE: Emitting event for: bidderDone
MESSAGE: Emitting event for: bidAdjustment
INFO: suppressing empty key 'hb_deal' from adserver targeting
MESSAGE: Emitting event for: bidResponse
INFO: Bids Received for Auction with id: f90900e7-b0da-41a1-a834-e5ca4f234891
MESSAGE: Emitting event for: auctionEnd
INFO: Invoking pbjs.setTargetingForGPTAsync
MESSAGE: Attempting to set key value for slot: div-1 key: hb_native_image value: https://cdn.mysite.com/5f9aaf8b0afcd63d2c35d180.jpg
MESSAGE: Attempting to set key value for slot: div-1 key: hb_native_linkurl value: https://affiliate.company.com/click/39e6e1dwog
MESSAGE: Attempting to set key value for slot: div-1 key: hb_native_brand value: Great Company
MESSAGE: Attempting to set key value for slot: div-1 key: hb_native_title value: Try our best advises
MESSAGE: Attempting to set key value for slot: div-1 key: hb_format value: native
MESSAGE: Attempting to set key value for slot: div-1 key: hb_source value: client
MESSAGE: Attempting to set key value for slot: div-1 key: hb_size value: 1x1
MESSAGE: Attempting to set key value for slot: div-1 key: hb_pb value: 32.00
MESSAGE: Attempting to set key value for slot: div-1 key: hb_adid value: 608908d3f29299
MESSAGE: Attempting to set key value for slot: div-1 key: hb_bidder value: custom
MESSAGE: Attempting to set key value for slot: div-1 key: hb_native_linkurl_cu value: https://affiliate.company.com/click/39e6e1dwog
MESSAGE: Attempting to set key value for slot: div-1 key: hb_native_image_cust value: https://cdn.mysite.com/5f9aaf8b0afcd63d2c35d180.jpg
MESSAGE: Attempting to set key value for slot: div-1 key: hb_native_brand_cust value: Great Company
MESSAGE: Attempting to set key value for slot: div-1 key: hb_native_title_cust value: Try our best advices
MESSAGE: Attempting to set key value for slot: div-1 key: hb_format_custom value: native
MESSAGE: Attempting to set key value for slot: div-1 key: hb_source_custom value: client
MESSAGE: Attempting to set key value for slot: div-1 key: hb_size_custom value: 1x1
MESSAGE: Attempting to set key value for slot: div-1 key: hb_pb_custom value: 32.00
MESSAGE: Attempting to set key value for slot: div-1 key: hb_adid_custom value: 608908d3f29299
MESSAGE: Attempting to set key value for slot: div-1 key: hb_bidder_custom value: custom
MESSAGE: Attempting to set key value for slot: div-1 key: hb_native_linkurl_ap value: http://prebid.org/dev-docs/show-native-ads.html
MESSAGE: Attempting to set key value for slot: div-1 key: hb_native_image_appn value: https://vcdn.adnxs.com/p/creative-image/94/22/cd/0f/9422cd0f-f400-45d3-80f5-2b92629d9257.jpg
MESSAGE: Attempting to set key value for slot: div-1 key: hb_native_brand_appn value: Prebid.org
MESSAGE: Attempting to set key value for slot: div-1 key: hb_native_title_appn value: This is a Prebid Native Creative
MESSAGE: Attempting to set key value for slot: div-1 key: hb_format_appnexus value: native
MESSAGE: Attempting to set key value for slot: div-1 key: hb_source_appnexus value: client
MESSAGE: Attempting to set key value for slot: div-1 key: hb_size_appnexus value: 0x0
MESSAGE: Attempting to set key value for slot: div-1 key: hb_pb_appnexus value: 10.00
MESSAGE: Attempting to set key value for slot: div-1 key: hb_adid_appnexus value: 8fedccc6ce9763
MESSAGE: Attempting to set key value for slot: div-1 key: hb_bidder_appnexus value: appnexus
MESSAGE: Attempting to set key value for slot: div-2 key: hb_native_image value: https://cdn.mysite.com/5f9aaf8b0afcd63d2c35d180.jpg
MESSAGE: Attempting to set key value for slot: div-2 key: hb_native_linkurl value: https://affiliate.company.com/click/cn9s9c627i
MESSAGE: Attempting to set key value for slot: div-2 key: hb_native_brand value: Other Great Company
MESSAGE: Attempting to set key value for slot: div-2 key: hb_native_title value: Other great advices to try
MESSAGE: Attempting to set key value for slot: div-2 key: hb_format value: native
MESSAGE: Attempting to set key value for slot: div-2 key: hb_source value: client
MESSAGE: Attempting to set key value for slot: div-2 key: hb_size value: 1x1
MESSAGE: Attempting to set key value for slot: div-2 key: hb_pb value: 15.00
MESSAGE: Attempting to set key value for slot: div-2 key: hb_adid value: 7c0389e2b81406
MESSAGE: Attempting to set key value for slot: div-2 key: hb_bidder value: custom
MESSAGE: Attempting to set key value for slot: div-2 key: hb_native_linkurl_cu value: https://affiliate.company.com/click/cn9s9c627i
MESSAGE: Attempting to set key value for slot: div-2 key: hb_native_image_cust value: https://cdn.mysite.com/5f9aaf8b0afcd63d2c35d180.jpg
MESSAGE: Attempting to set key value for slot: div-2 key: hb_native_brand_cust value: Other Great Company
MESSAGE: Attempting to set key value for slot: div-2 key: hb_native_title_cust value: Other great advices to try
MESSAGE: Attempting to set key value for slot: div-2 key: hb_format_custom value: native
MESSAGE: Attempting to set key value for slot: div-2 key: hb_source_custom value: client
MESSAGE: Attempting to set key value for slot: div-2 key: hb_size_custom value: 1x1
MESSAGE: Attempting to set key value for slot: div-2 key: hb_pb_custom value: 15.00
MESSAGE: Attempting to set key value for slot: div-2 key: hb_adid_custom value: 7c0389e2b81406
MESSAGE: Attempting to set key value for slot: div-2 key: hb_bidder_custom value: custom
MESSAGE: Emitting event for: setTargeting
MESSAGE: Emitting event for: bidderDone

我想我缺少一些配置,因为我完全没有错误。提前致谢

4

0 回答 0