From d117872cf85d00d6b07224ffb48579769193febd Mon Sep 17 00:00:00 2001 From: Nick Peceniak Date: Fri, 22 Sep 2017 14:32:25 -0600 Subject: [PATCH 1/2] Update spotx video adapter to set the spotx_ad_key used in DFP targeting to the bid.adId --- modules/spotxBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/spotxBidAdapter.js b/modules/spotxBidAdapter.js index e8ed973fe5f..78a927fcdf3 100644 --- a/modules/spotxBidAdapter.js +++ b/modules/spotxBidAdapter.js @@ -85,7 +85,7 @@ function Spotx() { bid.cpm = KVP_Object.spotx_bid; bid.vastUrl = url; - bid.ad = url; + bid.adId = KVP_Object.spotx_ad_key; var sizes = utils.isArray(bidReq.sizes[0]) ? bidReq.sizes[0] : bidReq.sizes; bid.height = sizes[1]; From 379b7aadc1711c94833eb1e40d6b987857c7c689 Mon Sep 17 00:00:00 2001 From: Nick Peceniak Date: Wed, 11 Oct 2017 15:47:28 -0600 Subject: [PATCH 2/2] Changed spotx adapter to set hb_adid through registerDefaultBidderSetting - Instead of setting the adid to the spotx key in the bid response itself we now set a key bid.spotx_ad_key on the bid and then overwrite the hb_adid using this key. --- modules/spotxBidAdapter.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/spotxBidAdapter.js b/modules/spotxBidAdapter.js index 78a927fcdf3..2e2831a028a 100644 --- a/modules/spotxBidAdapter.js +++ b/modules/spotxBidAdapter.js @@ -11,6 +11,20 @@ function Spotx() { let bidReq; let KVP_Object; + const _defaultBidderSettings = { + alwaysUseBid: true, + adserverTargeting: [ + { + key: 'hb_adid', + val: function (bidResponse) { + return bidResponse.spotx_ad_key; + } + } + ] + }; + + bidmanager.registerDefaultBidderSetting('spotx', _defaultBidderSettings); + baseAdapter.callBids = function(bidRequest) { if (!bidRequest || !bidRequest.bids || bidRequest.bids.length === 0) { return; @@ -85,7 +99,7 @@ function Spotx() { bid.cpm = KVP_Object.spotx_bid; bid.vastUrl = url; - bid.adId = KVP_Object.spotx_ad_key; + bid.spotx_ad_key = KVP_Object.spotx_ad_key; var sizes = utils.isArray(bidReq.sizes[0]) ? bidReq.sizes[0] : bidReq.sizes; bid.height = sizes[1];