Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/prebid/Prebid.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhsiehucf committed May 21, 2021
2 parents 8630cb1 + bb02ee1 commit 97421e1
Show file tree
Hide file tree
Showing 66 changed files with 2,592 additions and 433 deletions.
7 changes: 6 additions & 1 deletion modules/.submodules.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@
],
"rtdModule": [
"browsiRtdProvider",
"geoedgeRtdProvider",
"haloRtdProvider",
"jwplayerRtdProvider",
"permutiveRtdProvider",
"reconciliationRtdProvider",
"geoedgeRtdProvider",
"sirdataRtdProvider"
],
"fpdModule": [
"enrichmentFpdModule",
"validationFpdModule"
]
}
6 changes: 5 additions & 1 deletion modules/adagioBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { OUTSTREAM } from '../src/video.js';

export const BIDDER_CODE = 'adagio';
export const LOG_PREFIX = 'Adagio:';
export const VERSION = '2.8.0';
export const VERSION = '2.10.0';
export const FEATURES_VERSION = '1';
export const ENDPOINT = 'https://mp.4dex.io/prebid';
export const SUPPORTED_MEDIA_TYPES = [BANNER, NATIVE, VIDEO];
Expand Down Expand Up @@ -1019,6 +1019,10 @@ export const spec = {
const bidReq = (find(bidRequest.data.adUnits, bid => bid.bidId === bidObj.requestId));

if (bidReq) {
bidObj.meta = utils.deepAccess(bidObj, 'meta', {});
bidObj.meta.mediaType = bidObj.mediaType;
bidObj.meta.advertiserDomains = (Array.isArray(bidObj.aDomain) && bidObj.aDomain.length) ? bidObj.aDomain : [];

if (bidObj.mediaType === VIDEO) {
const mediaTypeContext = utils.deepAccess(bidReq, 'mediaTypes.video.context');
// Adagio SSP returns a `vastXml` only. No `vastUrl` nor `videoCacheKey`.
Expand Down
4 changes: 0 additions & 4 deletions modules/aolBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,6 @@ export const spec = {
formatMarketplaceDynamicParams(params = {}, consentData = {}) {
let queryParams = {};

if (params.bidFloor) {
queryParams.bidfloor = params.bidFloor;
}

Object.assign(queryParams, this.formatKeyValues(params.keyValues));
Object.assign(queryParams, this.formatConsentData(consentData));

Expand Down
7 changes: 7 additions & 0 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,12 @@ export const spec = {
if (bidRequests[0].userId) {
let eids = [];

addUserId(eids, utils.deepAccess(bidRequests[0], `userId.flocId.id`), 'chrome.com', null);
addUserId(eids, utils.deepAccess(bidRequests[0], `userId.criteoId`), 'criteo.com', null);
addUserId(eids, utils.deepAccess(bidRequests[0], `userId.netId`), 'netid.de', null);
addUserId(eids, utils.deepAccess(bidRequests[0], `userId.idl_env`), 'liveramp.com', null);
addUserId(eids, utils.deepAccess(bidRequests[0], `userId.tdid`), 'adserver.org', 'TDID');
addUserId(eids, utils.deepAccess(bidRequests[0], `userId.uid2.id`), 'uidapi.com', 'UID2');

if (eids.length) {
payload.eids = eids;
Expand Down Expand Up @@ -578,6 +580,11 @@ function newBid(serverBid, rtbBid, bidderRequest) {
}
};

// WE DON'T FULLY SUPPORT THIS ATM - future spot for adomain code; creating a stub for 5.0 compliance
if (rtbBid.adomain) {
bid.meta = Object.assign({}, bid.meta, { advertiserDomains: [] });
}

if (rtbBid.advertiser_id) {
bid.meta = Object.assign({}, bid.meta, { advertiserId: rtbBid.advertiser_id });
}
Expand Down
41 changes: 32 additions & 9 deletions modules/beachfrontBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import { VIDEO, BANNER } from '../src/mediaTypes.js';
import find from 'core-js-pure/features/array/find.js';
import includes from 'core-js-pure/features/array/includes.js';

const ADAPTER_VERSION = '1.15';
const ADAPTER_VERSION = '1.16';
const ADAPTER_NAME = 'BFIO_PREBID';
const OUTSTREAM = 'outstream';
const CURRENCY = 'USD';

export const VIDEO_ENDPOINT = 'https://reachms.bfmio.com/bid.json?exchange_id=';
export const BANNER_ENDPOINT = 'https://display.bfmio.com/prebid_display';
Expand All @@ -19,7 +20,8 @@ export const DEFAULT_MIMES = ['video/mp4', 'application/javascript'];

export const SUPPORTED_USER_IDS = [
{ key: 'tdid', source: 'adserver.org', rtiPartner: 'TDID', queryParam: 'tdid' },
{ key: 'idl_env', source: 'liveramp.com', rtiPartner: 'idl', queryParam: 'idl' }
{ key: 'idl_env', source: 'liveramp.com', rtiPartner: 'idl', queryParam: 'idl' },
{ key: 'uid2.id', source: 'uidapi.com', rtiPartner: 'UID2', queryParam: 'uid2' }
];

let appId = '';
Expand Down Expand Up @@ -78,7 +80,7 @@ export const spec = {
creativeId: response.crid || response.cmpId,
renderer: context === OUTSTREAM ? createRenderer(bidRequest) : null,
mediaType: VIDEO,
currency: 'USD',
currency: CURRENCY,
netRevenue: true,
ttl: 300
};
Expand Down Expand Up @@ -110,7 +112,7 @@ export const spec = {
width: bid.w,
height: bid.h,
mediaType: BANNER,
currency: 'USD',
currency: CURRENCY,
netRevenue: true,
ttl: 300
};
Expand Down Expand Up @@ -250,6 +252,16 @@ function getPlayerBidParam(bid, key, defaultValue) {
return param === undefined ? defaultValue : param;
}

function getBannerBidFloor(bid) {
let floorInfo = utils.isFn(bid.getFloor) ? bid.getFloor({ currency: CURRENCY, mediaType: 'banner', size: '*' }) : {};
return floorInfo.floor || getBannerBidParam(bid, 'bidfloor');
}

function getVideoBidFloor(bid) {
let floorInfo = utils.isFn(bid.getFloor) ? bid.getFloor({ currency: CURRENCY, mediaType: 'video', size: '*' }) : {};
return floorInfo.floor || getVideoBidParam(bid, 'bidfloor');
}

function isVideoBidValid(bid) {
return isVideoBid(bid) && getVideoBidParam(bid, 'appId') && getVideoBidParam(bid, 'bidfloor');
}
Expand Down Expand Up @@ -279,7 +291,7 @@ function getEids(bid) {

function getUserId(bid) {
return ({ key, source, rtiPartner }) => {
let id = bid.userId && bid.userId[key];
let id = utils.deepAccess(bid, `userId.${key}`);
return id ? formatEid(id, source, rtiPartner) : null;
};
}
Expand Down Expand Up @@ -315,7 +327,7 @@ function createVideoRequestData(bid, bidderRequest) {
let firstSize = getFirstSize(sizes);
let video = getVideoTargetingParams(bid);
let appId = getVideoBidParam(bid, 'appId');
let bidfloor = getVideoBidParam(bid, 'bidfloor');
let bidfloor = getVideoBidFloor(bid);
let tagid = getVideoBidParam(bid, 'tagid');
let topLocation = getTopWindowLocation(bidderRequest);
let eids = getEids(bid);
Expand Down Expand Up @@ -351,10 +363,13 @@ function createVideoRequestData(bid, bidderRequest) {
regs: {
ext: {}
},
source: {
ext: {}
},
user: {
ext: {}
},
cur: ['USD']
cur: [CURRENCY]
};

if (bidderRequest && bidderRequest.uspConsent) {
Expand All @@ -367,6 +382,10 @@ function createVideoRequestData(bid, bidderRequest) {
payload.user.ext.consent = consentString;
}

if (bid.schain) {
payload.source.ext.schain = bid.schain;
}

if (eids.length > 0) {
payload.user.ext.eids = eids;
}
Expand All @@ -386,7 +405,7 @@ function createBannerRequestData(bids, bidderRequest) {
return {
slot: bid.adUnitCode,
id: getBannerBidParam(bid, 'appId'),
bidfloor: getBannerBidParam(bid, 'bidfloor'),
bidfloor: getBannerBidFloor(bid),
tagid: getBannerBidParam(bid, 'tagid'),
sizes: getBannerSizes(bid)
};
Expand Down Expand Up @@ -416,8 +435,12 @@ function createBannerRequestData(bids, bidderRequest) {
payload.gdprConsent = consentString;
}

if (bids[0] && bids[0].schain) {
payload.schain = bids[0].schain;
}

SUPPORTED_USER_IDS.forEach(({ key, queryParam }) => {
let id = bids[0] && bids[0].userId && bids[0].userId[key];
let id = utils.deepAccess(bids, `0.userId.${key}`)
if (id) {
payload[queryParam] = id;
}
Expand Down
24 changes: 11 additions & 13 deletions modules/beachfrontBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Module Name: Beachfront Bid Adapter

Module Type: Bidder Adapter

Maintainer: john@beachfront.com
Maintainer: prebid@beachfront.com

# Description

Expand All @@ -18,26 +18,24 @@ Module that connects to Beachfront's demand sources
mediaTypes: {
video: {
context: 'instream',
playerSize: [ 640, 360 ]
playerSize: [640, 360],
mimes: ['video/mp4', 'application/javascript']
}
},
bids: [
{
bidder: 'beachfront',
params: {
bidfloor: 0.01,
appId: '11bc5dd5-7421-4dd8-c926-40fa653bec76',
video: {
mimes: [ 'video/mp4', 'application/javascript' ]
}
appId: '11bc5dd5-7421-4dd8-c926-40fa653bec76'
}
}
]
}, {
code: 'test-banner',
mediaTypes: {
banner: {
sizes: [ 300, 250 ]
sizes: [300, 250]
}
},
bids: [
Expand All @@ -61,10 +59,11 @@ Module that connects to Beachfront's demand sources
mediaTypes: {
video: {
context: 'outstream',
playerSize: [ 640, 360 ]
playerSize: [640, 360],
mimes: ['video/mp4', 'application/javascript']
},
banner: {
sizes: [ 300, 250 ]
sizes: [300, 250]
}
},
bids: [
Expand All @@ -74,7 +73,6 @@ Module that connects to Beachfront's demand sources
video: {
bidfloor: 0.01,
appId: '11bc5dd5-7421-4dd8-c926-40fa653bec76',
mimes: [ 'video/mp4', 'application/javascript' ]
},
banner: {
bidfloor: 0.01,
Expand All @@ -95,7 +93,8 @@ Module that connects to Beachfront's demand sources
mediaTypes: {
video: {
context: 'outstream',
playerSize: [ 640, 360 ]
playerSize: [ 640, 360 ],
mimes: ['video/mp4', 'application/javascript']
}
},
bids: [
Expand All @@ -104,8 +103,7 @@ Module that connects to Beachfront's demand sources
params: {
video: {
bidfloor: 0.01,
appId: '11bc5dd5-7421-4dd8-c926-40fa653bec76',
mimes: [ 'video/mp4', 'application/javascript' ]
appId: '11bc5dd5-7421-4dd8-c926-40fa653bec76'
},
player: {
progressColor: '#50A8FA',
Expand Down
5 changes: 4 additions & 1 deletion modules/betweenBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ export const spec = {
creativeId: serverResponse.body[i].creativeid,
currency: serverResponse.body[i].currency || 'RUB',
netRevenue: serverResponse.body[i].netRevenue || true,
ad: serverResponse.body[i].ad
ad: serverResponse.body[i].ad,
meta: {
advertiserDomains: serverResponse.body[i].adomain ? serverResponse.body[i].adomain : []
}
};
bidResponses.push(bidResponse);
}
Expand Down
6 changes: 5 additions & 1 deletion modules/bucksenseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const spec = {
var sCurrency = oResponse.currency || 'USD';
var bNetRevenue = oResponse.netRevenue || true;
var sAd = oResponse.ad || '';
var sAdomains = oResponse.adomains || [];

if (request && sRequestID.length == 0) {
utils.logInfo(WHO + ' interpretResponse() - use RequestID from Placments');
Expand All @@ -110,7 +111,10 @@ export const spec = {
creativeId: sCreativeID,
currency: sCurrency,
netRevenue: bNetRevenue,
ad: sAd
ad: sAd,
meta: {
advertiserDomains: sAdomains
}
};
bidResponses.push(bidResponse);
} else {
Expand Down
12 changes: 6 additions & 6 deletions modules/ccxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ function _buildBid (bid) {
}
}

placement.video.protocols = utils.deepAccess(bid, 'params.video.protocols') || SUPPORTED_VIDEO_PROTOCOLS
placement.video.mimes = utils.deepAccess(bid, 'params.video.mimes') || SUPPORTED_VIDEO_MIMES
placement.video.playbackmethod = utils.deepAccess(bid, 'params.video.playbackmethod') || SUPPORTED_VIDEO_PLAYBACK_METHODS
placement.video.skip = utils.deepAccess(bid, 'params.video.skip') || 0
if (placement.video.skip === 1 && utils.deepAccess(bid, 'params.video.skipafter')) {
placement.video.skipafter = utils.deepAccess(bid, 'params.video.skipafter')
placement.video.protocols = utils.deepAccess(bid, 'mediaTypes.video.protocols') || utils.deepAccess(bid, 'params.video.protocols') || SUPPORTED_VIDEO_PROTOCOLS
placement.video.mimes = utils.deepAccess(bid, 'mediaTypes.video.mimes') || utils.deepAccess(bid, 'params.video.mimes') || SUPPORTED_VIDEO_MIMES
placement.video.playbackmethod = utils.deepAccess(bid, 'mediaTypes.video.playbackmethod') || utils.deepAccess(bid, 'params.video.playbackmethod') || SUPPORTED_VIDEO_PLAYBACK_METHODS
placement.video.skip = utils.deepAccess(bid, 'mediaTypes.video.skip') || utils.deepAccess(bid, 'params.video.skip') || 0
if (placement.video.skip === 1 && (utils.deepAccess(bid, 'mediaTypes.video.skipafter') || utils.deepAccess(bid, 'params.video.skipafter'))) {
placement.video.skipafter = utils.deepAccess(bid, 'mediaTypes.video.skipafter') || utils.deepAccess(bid, 'params.video.skipafter')
}
}

Expand Down
Loading

0 comments on commit 97421e1

Please sign in to comment.