1

I'm pretty new to the world of Header Bidding and some mechanics are not very clear to me, anyway I have to write my own bid adapter (only native).

I have defined the functions isBidRequestValid() buildRequests() interpretResponse() onBidWon(). For testing purpouse I'm using integrationExamples/gpt/native_example.html with appnexusAdapter and mycustomAdapter.

I'm able to create the bid requests for my bidder’s server and parsing the bid responses. But I'm stuck on this, when my bids are higher than appnexus bids, I get no response from DFP and the onBidWon() event is not fired. While if the appenxus bids are higher than mine, I get a valid response from DFP, the appnexus onBidWon() event is fired and the adUnits are populated with the appnexus creatives.

AppNexus responds with two creatives ($0.5 cpm and $10.00 cpm), my server also responds with two creatives with random cpm (1-100).

That's an example of bid returned by 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,
}

From the console log I can see the following info:

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

I suppose that I'm missing some configuration, because I get no error at all. Thanks in advance

fasenderos
  • 388
  • 3
  • 18
  • Hello @fasenderos i'm facing with the same issue, probably you have find the solution ? – KolaCaine Jul 27 '21 at 14:22
  • you can check your DFP line item setup. mostly issue lies there it seems. `onBidWon()` is called only after the creative renders on page – guilemon Jan 05 '22 at 06:27

0 Answers0