Skip to content

Commit

Permalink
Merge branch 'prebid:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofequativ authored May 29, 2024
2 parents b183b77 + 0f91aff commit 5e1a949
Show file tree
Hide file tree
Showing 28 changed files with 1,306 additions and 575 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
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
58 changes: 43 additions & 15 deletions modules/iqzoneBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isFn, deepAccess, logMessage } from '../src/utils.js';
import { logMessage, logError, deepAccess } from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
import { config } from '../src/config.js';
Expand All @@ -9,8 +9,7 @@ const AD_URL = 'https://smartssp-us-east.iqzone.com/pbjs';
const SYNC_URL = 'https://cs.smartssp.iqzone.com';

function isBidResponseValid(bid) {
if (!bid.requestId || !bid.cpm || !bid.creativeId ||
!bid.ttl || !bid.currency) {
if (!bid.requestId || !bid.cpm || !bid.creativeId || !bid.ttl || !bid.currency) {
return false;
}

Expand All @@ -27,7 +26,7 @@ function isBidResponseValid(bid) {
}

function getPlacementReqData(bid) {
const { params, bidId, mediaTypes } = bid;
const { params, bidId, mediaTypes, transactionId, userIdAsEids } = bid;
const schain = bid.schain || {};
const { placementId, endpointId } = params;
const bidfloor = getBidFloor(bid);
Expand Down Expand Up @@ -57,7 +56,7 @@ function getPlacementReqData(bid) {
placement.mimes = mediaTypes[VIDEO].mimes;
placement.protocols = mediaTypes[VIDEO].protocols;
placement.startdelay = mediaTypes[VIDEO].startdelay;
placement.placement = mediaTypes[VIDEO].placement;
placement.plcmt = mediaTypes[VIDEO].plcmt;
placement.skip = mediaTypes[VIDEO].skip;
placement.skipafter = mediaTypes[VIDEO].skipafter;
placement.minbitrate = mediaTypes[VIDEO].minbitrate;
Expand All @@ -71,23 +70,29 @@ function getPlacementReqData(bid) {
placement.adFormat = NATIVE;
}

if (transactionId) {
placement.ext = placement.ext || {};
placement.ext.tid = transactionId;
}

if (userIdAsEids && userIdAsEids.length) {
placement.eids = userIdAsEids;
}

return placement;
}

function getBidFloor(bid) {
if (!isFn(bid.getFloor)) {
return deepAccess(bid, 'params.bidfloor', 0);
}

try {
const bidFloor = bid.getFloor({
currency: 'USD',
mediaType: '*',
size: '*',
});
return bidFloor.floor;
} catch (_) {
return 0
} catch (err) {
logError(err);
return 0;
}
}

Expand Down Expand Up @@ -151,12 +156,28 @@ export const spec = {
host,
page,
placements,
coppa: config.getConfig('coppa') === true ? 1 : 0,
ccpa: bidderRequest.uspConsent || undefined,
gdpr: bidderRequest.gdprConsent || undefined,
coppa: deepAccess(bidderRequest, 'ortb2.regs.coppa') ? 1 : 0,
tmax: bidderRequest.timeout
};

if (bidderRequest.uspConsent) {
request.ccpa = bidderRequest.uspConsent;
}

if (bidderRequest.gdprConsent) {
request.gdpr = {
consentString: bidderRequest.gdprConsent.consentString
};
}

if (bidderRequest.gppConsent) {
request.gpp = bidderRequest.gppConsent.gppString;
request.gpp_sid = bidderRequest.gppConsent.applicableSections;
} else if (bidderRequest.ortb2?.regs?.gpp) {
request.gpp = bidderRequest.ortb2.regs.gpp;
request.gpp_sid = bidderRequest.ortb2.regs.gpp_sid;
}

const len = validBidRequests.length;
for (let i = 0; i < len; i++) {
const bid = validBidRequests[i];
Expand Down Expand Up @@ -184,20 +205,27 @@ export const spec = {
return response;
},

getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => {
getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent, gppConsent) => {
let syncType = syncOptions.iframeEnabled ? 'iframe' : 'image';
let syncUrl = SYNC_URL + `/${syncType}?pbjs=1`;

if (gdprConsent && gdprConsent.consentString) {
if (typeof gdprConsent.gdprApplies === 'boolean') {
syncUrl += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
} else {
syncUrl += `&gdpr=0&gdpr_consent=${gdprConsent.consentString}`;
}
}

if (uspConsent && uspConsent.consentString) {
syncUrl += `&ccpa_consent=${uspConsent.consentString}`;
}

if (gppConsent?.gppString && gppConsent?.applicableSections?.length) {
syncUrl += '&gpp=' + gppConsent.gppString;
syncUrl += '&gpp_sid=' + gppConsent.applicableSections.join(',');
}

const coppa = config.getConfig('coppa') ? 1 : 0;
syncUrl += `&coppa=${coppa}`;

Expand Down
Loading

0 comments on commit 5e1a949

Please sign in to comment.