Skip to content

Commit

Permalink
Merge branch 'master' into 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi committed May 28, 2024
2 parents 9d02193 + 8309f29 commit 2f7e2f7
Show file tree
Hide file tree
Showing 51 changed files with 2,259 additions and 734 deletions.
3 changes: 2 additions & 1 deletion modules/adkernelBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ export const spec = {
{code: 'adpluto'},
{code: 'headbidder'},
{code: 'digiad'},
{code: 'monetix'}
{code: 'monetix'},
{code: 'hyperbrainz'}
],
supportedMediaTypes: [BANNER, VIDEO, NATIVE],

Expand Down
18 changes: 9 additions & 9 deletions modules/aidemBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const converter = ortbConverter({
const request = buildRequest(imps, bidderRequest, context);
deepSetValue(request, 'at', 1);
setPrebidRequestEnvironment(request);
deepSetValue(request, 'regs', getRegs());
deepSetValue(request, 'regs', getRegs(bidderRequest));
deepSetValue(request, 'site.publisher.id', bidderRequest.bids[0].params.publisherId);
deepSetValue(request, 'site.id', bidderRequest.bids[0].params.siteId);
return request;
Expand Down Expand Up @@ -106,22 +106,22 @@ function recur(obj) {
return result;
}

function getRegs() {
function getRegs(bidderRequest) {
let regs = {};
const consentManagement = config.getConfig('consentManagement');
const euConsentManagement = bidderRequest.gdprConsent;
const usConsentManagement = bidderRequest.uspConsent;
const coppa = config.getConfig('coppa');
if (consentManagement && !!(consentManagement.gdpr)) {
deepSetValue(regs, 'gdpr_applies', !!consentManagement.gdpr);
if (euConsentManagement && euConsentManagement.consentString) {
deepSetValue(regs, 'gdpr_applies', !!euConsentManagement.consentString);
} else {
deepSetValue(regs, 'gdpr_applies', false);
}
if (consentManagement && deepAccess(consentManagement, 'usp.cmpApi') === 'static') {
deepSetValue(regs, 'usp_applies', !!deepAccess(consentManagement, 'usp'));
deepSetValue(regs, 'us_privacy', deepAccess(consentManagement, 'usp.consentData.getUSPData.uspString'));
if (usConsentManagement) {
deepSetValue(regs, 'usp_applies', true);
deepSetValue(regs, 'us_privacy', bidderRequest.uspConsent);
} else {
deepSetValue(regs, 'usp_applies', false);
}

if (isBoolean(coppa)) {
deepSetValue(regs, 'coppa_applies', !!coppa);
} else {
Expand Down
4 changes: 2 additions & 2 deletions modules/beachfrontBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {Renderer} from '../src/Renderer.js';
import {BANNER, VIDEO} from '../src/mediaTypes.js';
import {find, includes} from '../src/polyfill.js';

const ADAPTER_VERSION = '1.20';
const ADAPTER_VERSION = '1.21';
const ADAPTER_NAME = 'BFIO_PREBID';
const OUTSTREAM = 'outstream';
const CURRENCY = 'USD';
Expand All @@ -26,7 +26,7 @@ export const OUTSTREAM_SRC = 'https://player-cdn.beachfrontmedia.com/playerapi/l
export const SYNC_IFRAME_ENDPOINT = 'https://sync.bfmio.com/sync_iframe';
export const SYNC_IMAGE_ENDPOINT = 'https://sync.bfmio.com/syncb';

export const VIDEO_TARGETING = ['mimes', 'playbackmethod', 'maxduration', 'placement', 'skip', 'skipmin', 'skipafter'];
export const VIDEO_TARGETING = ['mimes', 'playbackmethod', 'maxduration', 'placement', 'plcmt', 'skip', 'skipmin', 'skipafter'];
export const DEFAULT_MIMES = ['video/mp4', 'application/javascript'];

export const SUPPORTED_USER_IDS = [
Expand Down
11 changes: 6 additions & 5 deletions modules/cadentApertureMXBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,13 @@ export const spec = {
};

// adding gpid support
let gpid = deepAccess(bid, 'ortb2Imp.ext.data.adserver.adslot');
if (!gpid) {
gpid = deepAccess(bid, 'ortb2Imp.ext.data.pbadslot');
}
let gpid =
deepAccess(bid, 'ortb2Imp.ext.gpid') ||
deepAccess(bid, 'ortb2Imp.ext.data.adserver.adslot') ||
deepAccess(bid, 'ortb2Imp.ext.data.pbadslot');

if (gpid) {
data.ext = {gpid: gpid.toString()};
data.ext = { gpid: gpid.toString() };
}
let typeSpecifics = isVideo ? { video: cadentAdapter.buildVideo(bid) } : { banner: cadentAdapter.buildBanner(bid) };
let bidfloorObj = bidfloor > 0 ? { bidfloor, bidfloorcur: DEFAULT_CUR } : {};
Expand Down
107 changes: 107 additions & 0 deletions modules/colombiaBidAdapter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import * as utils from '../src/utils.js';
import {config} from '../src/config.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import { BANNER } from '../src/mediaTypes.js';
const BIDDER_CODE = 'colombia';
const ENDPOINT_URL = 'https://ade.clmbtech.com/cde/prebid.htm';
const HOST_NAME = document.location.protocol + '//' + window.location.host;

export const spec = {
code: BIDDER_CODE,
aliases: ['clmb'],
supportedMediaTypes: [BANNER],
isBidRequestValid: function(bid) {
return !!(bid.params.placementId);
},
buildRequests: function(validBidRequests, bidderRequest) {
if (validBidRequests.length === 0) {
return [];
}
let payloadArr = []
let ctr = 1;
validBidRequests = validBidRequests.map(bidRequest => {
const params = bidRequest.params;
const sizes = utils.parseSizesInput(bidRequest.sizes)[0];
const width = sizes.split('x')[0];
const height = sizes.split('x')[1];
const placementId = params.placementId;
const cb = Math.floor(Math.random() * 99999999999);
const bidId = bidRequest.bidId;
const referrer = (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.referer) ? bidderRequest.refererInfo.referer : '';
let mediaTypes = {}
let payload = {
v: 'hb1',
p: placementId,
pos: '~' + ctr,
w: width,
h: height,
cb: cb,
r: referrer,
uid: bidId,
t: 'i',
d: HOST_NAME,
fpc: params.fpc,
_u: window.location.href,
mediaTypes: Object.assign({}, mediaTypes, bidRequest.mediaTypes)
};
if (params.keywords) payload.keywords = params.keywords;
if (params.category) payload.cat = params.category;
if (params.pageType) payload.pgt = params.pageType;
if (params.incognito) payload.ic = params.incognito;
if (params.dsmi) payload.smi = params.dsmi;
if (params.optout) payload.out = params.optout;
if (bidRequest && bidRequest.hasOwnProperty('ortb2Imp') && bidRequest.ortb2Imp.hasOwnProperty('ext')) {
payload.ext = bidRequest.ortb2Imp.ext;
if (bidRequest.ortb2Imp.ext.hasOwnProperty('gpid')) payload.pubAdCode = bidRequest.ortb2Imp.ext.gpid.split('#')[0];
}
payloadArr.push(payload);
ctr++;
});
return [{
method: 'POST',
url: ENDPOINT_URL,
data: payloadArr,
}]
},
interpretResponse: function(serverResponse, bidRequest) {
const bidResponses = [];
const res = serverResponse.body || serverResponse;
if (!res || res.length === 0) {
return bidResponses;
}
try {
res.forEach(response => {
const crid = response.creativeId || 0;
const width = response.width || 0;
const height = response.height || 0;
let cpm = response.cpm || 0;
if (cpm <= 0) {
return bidResponses;
}
if (width !== 0 && height !== 0 && cpm !== 0 && crid !== 0) {
const dealId = response.dealid || '';
const currency = response.currency || 'USD';
const netRevenue = (response.netRevenue === undefined) ? true : response.netRevenue;
const bidResponse = {
requestId: response.requestId,
cpm: cpm.toFixed(2),
width: response.width,
height: response.height,
creativeId: crid,
dealId: dealId,
currency: currency,
netRevenue: netRevenue,
ttl: config.getConfig('_bidderTimeout') || 300,
referrer: bidRequest.data.r,
ad: response.ad
};
bidResponses.push(bidResponse);
}
});
} catch (error) {
utils.logError(error);
}
return bidResponses;
}
}
registerBidder(spec);
31 changes: 31 additions & 0 deletions modules/colombiaBidAdapter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Overview

```
Module Name: COLOMBIA Bidder Adapter
Module Type: Bidder Adapter
Maintainer: colombiaonline@timesinteret.in
```

# Description

Connect to COLOMBIA for bids.

COLOMBIA adapter requires setup and approval from the COLOMBIA team. Please reach out to your account team or colombiaonline@timesinteret.in for more information.

# Test Parameters
```
var adUnits = [{
code: 'test-ad-div',
mediaTypes: {
banner: {
sizes: [[300, 250],[728,90],[320,50]]
}
},
bids: [{
bidder: 'colombia',
params: {
placementId: '540799'
}
}]
}];
```
3 changes: 2 additions & 1 deletion modules/concertBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ export const spec = {
meta: { advertiserDomains: bid && bid.adomain ? bid.adomain : [] },
creativeId: bid.creativeId,
netRevenue: bid.netRevenue,
currency: bid.currency
currency: bid.currency,
...(bid.dealid && { dealId: bid.dealid }),
};
});

Expand Down
1 change: 0 additions & 1 deletion modules/datawrkzBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ function buildVideoRequest(bidRequest, bidderRequest) {
maxbitrate: deepAccess(bidRequest, 'mediaTypes.video.maxbitrate'),
delivery: deepAccess(bidRequest, 'mediaTypes.video.delivery'),
linearity: deepAccess(bidRequest, 'mediaTypes.video.linearity'),
placement: deepAccess(bidRequest, 'mediaTypes.video.placement'),
skip: deepAccess(bidRequest, 'mediaTypes.video.skip'),
skipafter: deepAccess(bidRequest, 'mediaTypes.video.skipafter')
};
Expand Down
2 changes: 1 addition & 1 deletion modules/deepintentBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const ORTB_VIDEO_PARAMS = {
'w': (value) => isInteger(value),
'h': (value) => isInteger(value),
'startdelay': (value) => isInteger(value),
'placement': (value) => Array.isArray(value) && value.every(v => v >= 1 && v <= 5),
'plcmt': (value) => Array.isArray(value) && value.every(v => v >= 1 && v <= 5),
'linearity': (value) => [1, 2].indexOf(value) !== -1,
'skip': (value) => [0, 1].indexOf(value) !== -1,
'skipmin': (value) => isInteger(value),
Expand Down
2 changes: 1 addition & 1 deletion modules/deepintentBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ var adVideoAdUnits = [
protocols: [ 2, 3 ], // optional
battr: [ 13, 14 ], // optional
linearity: 1, // optional
placement: 2, // optional
plcmt: 2, // optional
minbitrate: 10, // optional
maxbitrate: 10 // optional
}
Expand Down
5 changes: 2 additions & 3 deletions modules/eskimiBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {getBidIdParameter} from '../src/utils.js';
*/

const BIDDER_CODE = 'eskimi';
// const ENDPOINT = 'https://hb.eskimi.com/bids'
const ENDPOINT = 'https://sspback.eskimi.com/bid-request'

const DEFAULT_BID_TTL = 30;
Expand All @@ -21,7 +20,7 @@ const VIDEO_ORTB_PARAMS = [
'mimes',
'minduration',
'maxduration',
'placement',
'plcmt',
'protocols',
'startdelay',
'skip',
Expand Down Expand Up @@ -142,7 +141,7 @@ function buildVideoImp(bidRequest, imp) {
});

if (imp.video && videoParams?.context === 'outstream') {
imp.video.placement = imp.video.placement || 4;
imp.video.plcmt = imp.video.plcmt || 4;
}

return { ...imp };
Expand Down
58 changes: 57 additions & 1 deletion modules/insticatorBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {config} from '../src/config.js';
import {BANNER, VIDEO} from '../src/mediaTypes.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {deepAccess, generateUUID, logError, isArray, isInteger, isArrayOfNums, deepSetValue} from '../src/utils.js';
import {deepAccess, generateUUID, logError, isArray, isInteger, isArrayOfNums, deepSetValue, isFn, logWarn} from '../src/utils.js';
import {getStorageManager} from '../src/storageManager.js';
import {find} from '../src/polyfill.js';

Expand Down Expand Up @@ -170,6 +170,19 @@ function buildImpression(bidRequest) {
},
}

let bidFloor = parseFloat(deepAccess(bidRequest, 'params.floor'));

if (!isNaN(bidFloor)) {
imp.bidfloor = deepAccess(bidRequest, 'params.floor');
imp.bidfloorcur = 'USD';
const bidfloorcur = deepAccess(bidRequest, 'params.bidfloorcur')
if (bidfloorcur && bidfloorcur !== 'USD') {
delete imp.bidfloor;
delete imp.bidfloorcur;
logWarn('insticator: bidfloorcur supported by insticator is USD only. ignoring bidfloor and bidfloorcur params');
}
}

if (deepAccess(bidRequest, 'mediaTypes.banner')) {
imp.banner = buildBanner(bidRequest);
}
Expand All @@ -178,6 +191,49 @@ function buildImpression(bidRequest) {
imp.video = buildVideo(bidRequest);
}

if (isFn(bidRequest.getFloor)) {
let moduleBidFloor;

const mediaType = deepAccess(bidRequest, 'mediaTypes.banner') ? 'banner' : deepAccess(bidRequest, 'mediaTypes.video') ? 'video' : undefined;

let _mediaType = mediaType;
let _size = '*';

if (mediaType && ['banner', 'video'].includes(mediaType)) {
if (mediaType === 'banner') {
const { w: width, h: height } = imp[mediaType];
if (width && height) {
_size = [width, height];
} else {
const sizes = deepAccess(bidRequest, 'mediaTypes.banner.format');
if (sizes && sizes.length > 0) {
const {w: width, h: height} = sizes[0];
_size = [width, height];
}
}
} else if (mediaType === 'video') {
const { w: width, h: height } = imp[mediaType];
_mediaType = mediaType;
_size = [width, height];
}
}
try {
moduleBidFloor = bidRequest.getFloor({
currency: 'USD',
mediaType: _mediaType,
size: _size
});
} catch (err) {
// continue with no module floors
logWarn('priceFloors module call getFloor failed, error : ', err);
}

if (moduleBidFloor) {
imp.bidfloor = moduleBidFloor.floor;
imp.bidfloorcur = moduleBidFloor.currency;
}
}

return imp;
}

Expand Down
Loading

0 comments on commit 2f7e2f7

Please sign in to comment.