Skip to content

Commit b08648a

Browse files
Merge branch 'prebid:master' into UOE-11611
2 parents 2b6ed1b + 6a2c4cd commit b08648a

File tree

156 files changed

+2404
-2024
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+2404
-2024
lines changed

libraries/advangUtils/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function isVideoBid(bid) {
1414

1515
export function getBannerBidFloor(bid) {
1616
let floorInfo = isFn(bid.getFloor) ? bid.getFloor({ currency: 'USD', mediaType: 'banner', size: '*' }) : {};
17-
return floorInfo.floor || getBannerBidParam(bid, 'bidfloor');
17+
return floorInfo?.floor || getBannerBidParam(bid, 'bidfloor');
1818
}
1919

2020
export function getVideoBidFloor(bid) {

libraries/currencyUtils/floor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function getBidFloor(bid) {
1616
mediaType: '*',
1717
size: '*',
1818
});
19-
return bidFloor.floor;
19+
return bidFloor?.floor;
2020
} catch (_) {
2121
return 0;
2222
}

libraries/dspxUtils/bidderUtils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export function getBidFloor(bid) {
225225
mediaType: '*',
226226
size: '*',
227227
});
228-
return bidFloor.floor;
228+
return bidFloor?.floor;
229229
} catch (_) {
230230
return 0
231231
}

libraries/gptUtils/gptUtils.js

+12
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ export function isSlotMatchingAdUnitCode(adUnitCode) {
1111
return (slot) => compareCodeAndSlot(slot, adUnitCode);
1212
}
1313

14+
/**
15+
* @summary Export a k-v pair to GAM
16+
*/
17+
export function setKeyValue(key, value) {
18+
if (!key || typeof key !== 'string') return false;
19+
window.googletag = window.googletag || {cmd: []};
20+
window.googletag.cmd = window.googletag.cmd || [];
21+
window.googletag.cmd.push(() => {
22+
window.googletag.pubads().setTargeting(key, value);
23+
});
24+
}
25+
1426
/**
1527
* @summary Uses the adUnit's code in order to find a matching gpt slot object on the page
1628
*/

libraries/intentIqConstants/intentIqConstants.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ export const OPT_OUT = 'O';
77
export const BLACK_LIST = 'L';
88
export const CLIENT_HINTS_KEY = '_iiq_ch';
99
export const EMPTY = 'EMPTY'
10-
export const VERSION = 0.22
10+
export const VERSION = 0.24

libraries/intentIqUtils/detectBrowserUtils.js

+10
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ export function detectBrowserFromUserAgent(userAgent) {
3232
ie: /MSIE|Trident/,
3333
};
3434

35+
// Check for Edge first
36+
if (browserRegexPatterns.edge.test(userAgent)) {
37+
return 'edge';
38+
}
39+
40+
// Check for Opera next
41+
if (browserRegexPatterns.opera.test(userAgent)) {
42+
return 'opera';
43+
}
44+
3545
// Check for Chrome first to avoid confusion with Safari
3646
if (browserRegexPatterns.chrome.test(userAgent)) {
3747
return 'chrome';
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import {gppDataHandler} from '../../src/consentHandler.js';
2+
3+
/**
4+
* Retrieves the GPP string value and additional GPP-related information.
5+
* This function extracts the GPP data, encodes it, and determines specific GPP flags such as GPI and applicable sections.
6+
* @return {Object} An object containing:
7+
* - `gppString` (string): The encoded GPP string value.
8+
* - `gpi` (number): An indicator representing whether GPP consent is available (0 if available, 1 if not).
9+
*/
10+
export function getGppValue() {
11+
const gppData = gppDataHandler.getConsentData();
12+
const gppString = gppData?.gppString || '';
13+
const gpi = gppString ? 0 : 1;
14+
15+
return { gppString, gpi };
16+
}
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import {logError} from '../../src/utils.js';
2+
3+
export function interpretResponseUtil(serverResponse, {bidderRequest}, eachBidCallback) {
4+
const bids = [];
5+
if (!serverResponse.body || serverResponse.body.error) {
6+
let errorMessage = `in response for ${bidderRequest.bidderCode} adapter`;
7+
if (serverResponse.body && serverResponse.body.error) { errorMessage += `: ${serverResponse.body.error}`; }
8+
logError(errorMessage);
9+
return bids;
10+
}
11+
(serverResponse.body.tags || []).forEach(serverBid => {
12+
try {
13+
const bid = eachBidCallback(serverBid);
14+
if (bid) {
15+
bids.push(bid);
16+
}
17+
} catch (e) {
18+
// Do nothing
19+
}
20+
});
21+
return bids;
22+
}

libraries/ortb2Utils/currency.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function getCurrencyFromBidderRequest(bidderRequest) {
2+
return bidderRequest?.ortb2?.ext?.prebid?.adServerCurrency;
3+
}

libraries/precisoUtils/bidUtilsCommon.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function getBidFloor(bid) {
3737
mediaType: '*',
3838
size: '*',
3939
});
40-
return bidFloor.floor;
40+
return bidFloor?.floor;
4141
} catch (_) {
4242
return 0
4343
}

libraries/riseUtils/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import {
55
isEmpty,
66
contains,
77
isInteger,
8-
getBidIdParameter
8+
getBidIdParameter,
9+
isPlainObject
910
} from '../../src/utils.js';
1011
import { BANNER, VIDEO } from '../../src/mediaTypes.js';
1112
import {config} from '../../src/config.js';
@@ -19,7 +20,7 @@ export function getFloor(bid, mediaType) {
1920
mediaType: mediaType,
2021
size: '*'
2122
});
22-
return floorResult.currency === 'USD' && floorResult.floor ? floorResult.floor : 0;
23+
return isPlainObject(floorResult) && floorResult.currency === 'USD' && floorResult.floor ? floorResult.floor : 0;
2324
}
2425

2526
export function getSizesArray(bid, mediaType) {

libraries/teqblazeUtils/bidderUtils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const getBidFloor = (bid) => {
2929
size: '*',
3030
});
3131

32-
return bidFloor.floor;
32+
return bidFloor?.floor;
3333
} catch (err) {
3434
return 0;
3535
}
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
export function timeoutQueue() {
2+
const queue = [];
3+
return {
4+
submit(timeout, onResume, onTimeout) {
5+
const item = [
6+
onResume,
7+
setTimeout(() => {
8+
queue.splice(queue.indexOf(item), 1);
9+
onTimeout();
10+
}, timeout)
11+
];
12+
queue.push(item);
13+
},
14+
resume() {
15+
while (queue.length) {
16+
const [onResume, timerId] = queue.shift();
17+
clearTimeout(timerId);
18+
onResume();
19+
}
20+
}
21+
}
22+
}

libraries/vidazooUtils/bidderUtils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ export function buildRequestData(bid, topWindowUrl, sizes, bidderRequest, bidder
255255
size: '*'
256256
});
257257

258-
if (floorInfo.currency === 'USD') {
258+
if (floorInfo?.currency === 'USD') {
259259
bidFloor = floorInfo.floor;
260260
}
261261
}

libraries/xeUtils/bidderUtils.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {deepAccess, getBidIdParameter, isFn, logError, isArray, parseSizesInput} from '../../src/utils.js';
1+
import {deepAccess, getBidIdParameter, isFn, logError, isArray, parseSizesInput, isPlainObject} from '../../src/utils.js';
22
import {getAdUnitSizes} from '../sizeUtils/sizeUtils.js';
33
import {findIndex} from '../../src/polyfill.js';
44

@@ -13,7 +13,7 @@ export function getBidFloor(bid, currency = 'USD') {
1313
size: '*'
1414
});
1515

16-
if (typeof floor === 'object' && !isNaN(floor.floor) && floor.currency === currency) {
16+
if (isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === currency) {
1717
return floor.floor;
1818
}
1919

modules/33acrossBidAdapter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ function _getBidFloors(bidRequest, size, mediaType) {
535535
size: [ size.w, size.h ]
536536
});
537537

538-
if (!isNaN(bidFloors.floor) && (bidFloors.currency === CURRENCY)) {
538+
if (!isNaN(bidFloors?.floor) && (bidFloors?.currency === CURRENCY)) {
539539
return bidFloors.floor;
540540
}
541541
}

modules/adagioBidAdapter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ function _getFloors(bidRequest) {
313313
floors.push(cleanObj({
314314
mt: mediaType,
315315
s: isArray(size) ? `${size[0]}x${size[1]}` : undefined,
316-
f: (!isNaN(info.floor) && info.currency === CURRENCY) ? info.floor : undefined
316+
f: (!isNaN(info?.floor) && info?.currency === CURRENCY) ? info?.floor : undefined
317317
}));
318318
}
319319

modules/adfBidAdapter.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
66
import {deepAccess, deepClone, deepSetValue, mergeDeep, parseSizesInput, setOnAny} from '../src/utils.js';
77
import {config} from '../src/config.js';
88
import {Renderer} from '../src/Renderer.js';
9+
import { getCurrencyFromBidderRequest } from '../libraries/ortb2Utils/currency.js';
910

1011
const { getConfig } = config;
1112

@@ -60,7 +61,7 @@ export const spec = {
6061
const pt = setOnAny(validBidRequests, 'params.pt') || setOnAny(validBidRequests, 'params.priceType') || 'net';
6162
const tid = bidderRequest.ortb2?.source?.tid;
6263
const test = setOnAny(validBidRequests, 'params.test');
63-
const currency = getConfig('currency.adServerCurrency');
64+
const currency = getCurrencyFromBidderRequest(bidderRequest);
6465
const cur = currency && [ currency ];
6566
const eids = setOnAny(validBidRequests, 'userIdAsEids');
6667
const schain = setOnAny(validBidRequests, 'schain');
@@ -75,8 +76,8 @@ export const spec = {
7576
mediaType: '*'
7677
}) : {};
7778

78-
const bidfloor = floorInfo.floor;
79-
const bidfloorcur = floorInfo.currency;
79+
const bidfloor = floorInfo?.floor;
80+
const bidfloorcur = floorInfo?.currency;
8081
const { mid, inv, mname } = bid.params;
8182
const impExtData = bid.ortb2Imp?.ext?.data;
8283

modules/adgenerationBidAdapter.js

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import {deepAccess, getBidIdParameter} from '../src/utils.js';
2-
import {registerBidder} from '../src/adapters/bidderFactory.js';
3-
import {BANNER, NATIVE} from '../src/mediaTypes.js';
4-
import {config} from '../src/config.js';
5-
import {convertOrtbRequestToProprietaryNative} from '../src/native.js';
6-
import {tryAppendQueryString} from '../libraries/urlUtils/urlUtils.js';
7-
import {escapeUnsafeChars} from '../libraries/htmlEscape/htmlEscape.js';
1+
import { escapeUnsafeChars } from '../libraries/htmlEscape/htmlEscape.js';
2+
import { getCurrencyFromBidderRequest } from '../libraries/ortb2Utils/currency.js';
3+
import { tryAppendQueryString } from '../libraries/urlUtils/urlUtils.js';
4+
import { registerBidder } from '../src/adapters/bidderFactory.js';
5+
import { BANNER, NATIVE } from '../src/mediaTypes.js';
6+
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
7+
import { deepAccess, getBidIdParameter } from '../src/utils.js';
88

99
/**
1010
* @typedef {import('../src/adapters/bidderFactory.js').BidRequest} BidRequest
@@ -61,7 +61,7 @@ export const spec = {
6161
data = tryAppendQueryString(data, 't', 'json3');
6262
data = tryAppendQueryString(data, 'transactionid', validReq.ortb2Imp?.ext?.tid);
6363
data = tryAppendQueryString(data, 'sizes', getSizes(validReq));
64-
data = tryAppendQueryString(data, 'currency', getCurrencyType());
64+
data = tryAppendQueryString(data, 'currency', getCurrencyType(bidderRequest));
6565
data = tryAppendQueryString(data, 'pbver', '$prebid.version$');
6666
data = tryAppendQueryString(data, 'sdkname', 'prebidjs');
6767
data = tryAppendQueryString(data, 'adapterver', ADGENE_PREBID_VERSION);
@@ -94,7 +94,8 @@ export const spec = {
9494
method: 'GET',
9595
url: url,
9696
data: data,
97-
bidRequest: validBidRequests[i]
97+
bidRequest: validBidRequests[i],
98+
bidderRequest
9899
});
99100
}
100101
return serverRequests;
@@ -119,7 +120,7 @@ export const spec = {
119120
height: body.h ? body.h : 1,
120121
creativeId: body.creativeid || '',
121122
dealId: body.dealid || '',
122-
currency: getCurrencyType(),
123+
currency: getCurrencyFromBidderRequest(bidRequests.bidderRequest),
123124
netRevenue: true,
124125
ttl: body.ttl || 10,
125126
};
@@ -304,9 +305,9 @@ function getSizes(validReq) {
304305
/**
305306
* @return {?string} USD or JPY
306307
*/
307-
function getCurrencyType() {
308-
if (config.getConfig('currency.adServerCurrency') && config.getConfig('currency.adServerCurrency').toUpperCase() === 'USD') return 'USD';
309-
return 'JPY';
308+
function getCurrencyType(bidderRequest) {
309+
const adServerCurrency = getCurrencyFromBidderRequest(bidderRequest) || ''
310+
return adServerCurrency.toUpperCase() === 'USD' ? 'USD' : 'JPY'
310311
}
311312

312313
/**

modules/adkernelBidAdapter.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ export const spec = {
101101
{code: 'rxnetwork'},
102102
{code: 'revbid'},
103103
{code: 'spinx', gvlid: 1308},
104-
{code: 'oppamedia'}
104+
{code: 'oppamedia'},
105+
{code: 'pixelpluses', gvlid: 1209}
105106
],
106107
supportedMediaTypes: [BANNER, VIDEO, NATIVE],
107108

modules/admaticBidAdapter.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {getValue, formatQS, logError, deepAccess, isArray, getBidIdParameter} from '../src/utils.js';
2-
import { registerBidder } from '../src/adapters/bidderFactory.js';
3-
import { config } from '../src/config.js';
4-
import { BANNER, VIDEO, NATIVE } from '../src/mediaTypes.js';
1+
import { getCurrencyFromBidderRequest } from '../libraries/ortb2Utils/currency.js';
52
import { Renderer } from '../src/Renderer.js';
3+
import { registerBidder } from '../src/adapters/bidderFactory.js';
4+
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
5+
import { deepAccess, formatQS, getBidIdParameter, getValue, isArray, logError } from '../src/utils.js';
66
import {getUserSyncParams} from '../libraries/userSyncUtils/userSyncUtils.js';
77
import { interpretNativeAd } from '../libraries/precisoUtils/bidNativeUtils.js';
88

@@ -56,6 +56,7 @@ export const spec = {
5656
const ortb = bidderRequest.ortb2;
5757
const networkId = getValue(validBidRequests[0].params, 'networkId');
5858
let host = getValue(validBidRequests[0].params, 'host');
59+
const currency = getCurrencyFromBidderRequest(bidderRequest) || 'TRY';
5960
const bidderName = validBidRequests[0].bidder;
6061

6162
const payload = {
@@ -84,10 +85,7 @@ export const spec = {
8485
tmax: parseInt(tmax)
8586
};
8687

87-
if (config.getConfig('currency.adServerCurrency')) {
88-
payload.ext.cur = config.getConfig('currency.adServerCurrency');
89-
}
90-
88+
payload.ext.cur = currency;
9189
if (bidderRequest && bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies) {
9290
const consentStr = (bidderRequest.gdprConsent.consentString)
9391
? bidderRequest.gdprConsent.consentString.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '') : '';

modules/admixerBidAdapter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function getBidFloor(bid) {
133133
mediaType: '*',
134134
size: '*',
135135
});
136-
return bidFloor.floor;
136+
return bidFloor?.floor;
137137
} catch (_) {
138138
return 0;
139139
}

modules/adotBidAdapter.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import {Renderer} from '../src/Renderer.js';
2-
import {registerBidder} from '../src/adapters/bidderFactory.js';
3-
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
4-
import {isArray, isBoolean, isFn, isPlainObject, isStr, logError, replaceAuctionPrice} from '../src/utils.js';
5-
import {find} from '../src/polyfill.js';
6-
import {config} from '../src/config.js';
7-
import {OUTSTREAM} from '../src/video.js';
1+
import { getCurrencyFromBidderRequest } from '../libraries/ortb2Utils/currency.js';
2+
import { Renderer } from '../src/Renderer.js';
3+
import { registerBidder } from '../src/adapters/bidderFactory.js';
4+
import { config } from '../src/config.js';
5+
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
86
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
7+
import { find } from '../src/polyfill.js';
8+
import { isArray, isBoolean, isFn, isPlainObject, isStr, logError, replaceAuctionPrice } from '../src/utils.js';
9+
import { OUTSTREAM } from '../src/video.js';
910
import { NATIVE_ASSETS_IDS as NATIVE_ID_MAPPING, NATIVE_ASSETS as NATIVE_PLACEMENTS } from '../libraries/braveUtils/nativeAssets.js';
1011

1112
/**
@@ -310,7 +311,7 @@ function buildImpFromAdUnit(adUnit, bidderRequest) {
310311
if (!mediaType) return null;
311312

312313
const media = IMP_BUILDER[mediaType](mediaTypes[mediaType], bidderRequest, adUnit)
313-
const currency = config.getConfig('currency.adServerCurrency') || DEFAULT_CURRENCY;
314+
const currency = getCurrencyFromBidderRequest(bidderRequest) || DEFAULT_CURRENCY;
314315
const bidfloor = getMainFloor(adUnit, media.format, mediaType, currency);
315316

316317
return {
@@ -641,7 +642,7 @@ function getFloor(adUnit, size, mediaType, currency) {
641642

642643
const floorResult = adUnit.getFloor({ currency, mediaType, size });
643644

644-
return floorResult.currency === currency ? floorResult.floor : 0;
645+
return floorResult?.currency === currency ? floorResult?.floor : 0;
645646
}
646647

647648
/**

0 commit comments

Comments
 (0)