Skip to content

Commit

Permalink
1. Added support for adomain
Browse files Browse the repository at this point in the history
2. Get floor price from prebid
  • Loading branch information
innayironsrc committed Jul 5, 2021
1 parent f88a55a commit 46b3ff4
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion modules/riseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const SUPPORTED_AD_TYPES = [VIDEO];
const BIDDER_CODE = 'rise';

This comment has been minimized.

Copy link
@noamtzu

noamtzu Jul 5, 2021

what about changes in README?
at least we need to mention that we are not supporting at version 5.0-5.3

const BIDDER_VERSION = '4.0.0';

This comment has been minimized.

Copy link
@noamtzu

noamtzu Jul 5, 2021

update version

const TTL = 360;
const CURRENCY = 'USD';
const SELLER_ENDPOINT = 'https://hb.yellowblue.io/';
const MODES = {
PRODUCTION: 'hb',
Expand Down Expand Up @@ -53,6 +54,10 @@ export const spec = {
mediaType: VIDEO
};

if (body.adomain && body.adomain.length) {
bidResponse.meta = {};
bidResponse.meta.advertiserDomains = body.adomain
}
bidResponses.push(bidResponse);

return bidResponses;
Expand Down Expand Up @@ -82,6 +87,23 @@ export const spec = {

registerBidder(spec);

/**
* Get floor price
* @param bid {bid}
* @returns {Number}
*/
function getFloor(bid) {
if (!utils.isFn(bid.getFloor)) {
return 0;
}
let floorResult = bid.getFloor({
currency: CURRENCY,
mediaType: VIDEO,
size: '*'
});
return floorResult.currency === CURRENCY ? floorResult.floor : 0;
}

/**
* Build the video request
* @param bid {bid}
Expand Down Expand Up @@ -206,7 +228,7 @@ function generateParameters(bid, bidderRequest) {
width: width,
height: height,
publisher_id: params.org,
floor_price: params.floorPrice,
floor_price: Math.max(getFloor(bid), params.floorPrice),
ua: navigator.userAgent,
bid_id: utils.getBidIdParameter('bidId', bid),
bidder_request_id: utils.getBidIdParameter('bidderRequestId', bid),
Expand Down

0 comments on commit 46b3ff4

Please sign in to comment.