Skip to content

Commit

Permalink
Update spotx video adapter to set the spotx_ad_key used in DFP (#1614)
Browse files Browse the repository at this point in the history
* Update spotx video adapter to set the spotx_ad_key used in DFP
targeting to the bid.adId

* 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.
  • Loading branch information
npeceniak authored and Matt Kendall committed Oct 13, 2017
1 parent 2f58bb0 commit fc9cbfb
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion modules/spotxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -85,7 +99,7 @@ function Spotx() {

bid.cpm = KVP_Object.spotx_bid;
bid.vastUrl = url;
bid.ad = url;
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];
Expand Down

0 comments on commit fc9cbfb

Please sign in to comment.