prebid.js 7.54.0 → 7.54.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/kulturemediaBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +128 -128
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/oxxionRtdProvider.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/modules/adqueryBidAdapter.js +21 -18
- package/modules/ixBidAdapter.js +285 -53
- package/modules/kargoBidAdapter.js +4 -0
- package/modules/mediasquareBidAdapter.js +19 -23
- package/modules/oxxionRtdProvider.js +124 -11
- package/modules/rubiconBidAdapter.js +13 -1
- package/modules/yahoosspBidAdapter.js +8 -7
- package/package.json +1 -1
- package/test/spec/modules/ixBidAdapter_spec.js +745 -3
- package/test/spec/modules/mediasquareBidAdapter_spec.js +3 -0
- package/test/spec/modules/oxxionRtdProvider_spec.js +113 -1
- package/test/spec/modules/rubiconBidAdapter_spec.js +41 -0
- package/test/spec/modules/yahoosspBidAdapter_spec.js +54 -24
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { submodule } from '../src/hook.js'
|
|
2
|
-
import { deepAccess, logInfo } from '../src/utils.js'
|
|
2
|
+
import { deepAccess, logInfo, logError } from '../src/utils.js'
|
|
3
|
+
import { ajax } from '../src/ajax.js';
|
|
4
|
+
import adapterManager from '../src/adapterManager.js';
|
|
3
5
|
|
|
4
6
|
const oxxionRtdSearchFor = [ 'adUnitCode', 'auctionId', 'bidder', 'bidderCode', 'bidId', 'cpm', 'creativeId', 'currency', 'width', 'height', 'mediaType', 'netRevenue', 'originalCpm', 'originalCurrency', 'requestId', 'size', 'source', 'status', 'timeToRespond', 'transactionId', 'ttl', 'sizes', 'mediaTypes', 'src', 'userId', 'labelAny', 'adId' ];
|
|
5
7
|
const LOG_PREFIX = 'oxxionRtdProvider submodule: ';
|
|
6
8
|
|
|
7
9
|
const allAdUnits = [];
|
|
10
|
+
const bidderAliasRegistry = adapterManager.aliasRegistry || {};
|
|
8
11
|
|
|
9
12
|
/** @type {RtdSubmodule} */
|
|
10
13
|
export const oxxionSubmodule = {
|
|
@@ -12,23 +15,56 @@ export const oxxionSubmodule = {
|
|
|
12
15
|
init: init,
|
|
13
16
|
getBidRequestData: getAdUnits,
|
|
14
17
|
onBidResponseEvent: insertVideoTracking,
|
|
18
|
+
getRequestsList: getRequestsList,
|
|
19
|
+
getFilteredAdUnitsOnBidRates: getFilteredAdUnitsOnBidRates,
|
|
15
20
|
};
|
|
16
21
|
|
|
17
22
|
function init(config, userConsent) {
|
|
18
|
-
if (!config.params || !config.params.domain
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
return
|
|
23
|
+
if (!config.params || !config.params.domain) { return false }
|
|
24
|
+
if (config.params.contexts && Array.isArray(config.params.contexts) && config.params.contexts.length > 0) { return true; }
|
|
25
|
+
if (typeof config.params.threshold != 'undefined' && typeof config.params.samplingRate == 'number') { return true }
|
|
26
|
+
return false;
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
function getAdUnits(reqBidsConfigObj, callback, config, userConsent) {
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
logInfo(LOG_PREFIX + 'started with ', config);
|
|
31
|
+
if (typeof config.params.threshold != 'undefined' && typeof config.params.samplingRate == 'number') {
|
|
32
|
+
let filteredBids;
|
|
33
|
+
const requests = getRequestsList(reqBidsConfigObj);
|
|
34
|
+
const gdpr = userConsent && userConsent.gdpr ? userConsent.gdpr.consentString : null;
|
|
35
|
+
const payload = {
|
|
36
|
+
gdpr,
|
|
37
|
+
requests
|
|
38
|
+
};
|
|
39
|
+
const endpoint = 'https://' + config.params.domain + '.oxxion.io/analytics/bid_rate_interests';
|
|
40
|
+
getPromisifiedAjax(endpoint, JSON.stringify(payload), {
|
|
41
|
+
method: 'POST',
|
|
42
|
+
withCredentials: true
|
|
43
|
+
}).then(bidsRateInterests => {
|
|
44
|
+
if (bidsRateInterests.length) {
|
|
45
|
+
[reqBidsConfigObj.adUnits, filteredBids] = getFilteredAdUnitsOnBidRates(bidsRateInterests, reqBidsConfigObj.adUnits, config.params, true);
|
|
30
46
|
}
|
|
31
|
-
|
|
47
|
+
if (filteredBids.length > 0) {
|
|
48
|
+
getPromisifiedAjax('https://' + config.params.domain + '.oxxion.io/analytics/request_rejecteds', JSON.stringify({'bids': filteredBids, 'gdpr': gdpr}), {
|
|
49
|
+
method: 'POST',
|
|
50
|
+
withCredentials: true
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (typeof callback == 'function') { callback(); }
|
|
54
|
+
}).catch(error => logError(LOG_PREFIX, 'bidInterestError', error));
|
|
55
|
+
}
|
|
56
|
+
if (config.params.contexts && Array.isArray(config.params.contexts) && config.params.contexts.length > 0) {
|
|
57
|
+
const reqAdUnits = reqBidsConfigObj.adUnits;
|
|
58
|
+
if (Array.isArray(reqAdUnits)) {
|
|
59
|
+
reqAdUnits.forEach(adunit => {
|
|
60
|
+
if (config.params.contexts.includes(deepAccess(adunit, 'mediaTypes.video.context'))) {
|
|
61
|
+
allAdUnits.push(adunit);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (!(typeof config.params.threshold != 'undefined' && typeof config.params.samplingRate == 'number') && typeof callback == 'function') {
|
|
66
|
+
callback();
|
|
67
|
+
}
|
|
32
68
|
}
|
|
33
69
|
}
|
|
34
70
|
|
|
@@ -94,4 +130,81 @@ function getImpUrl(config, data, maxCpm) {
|
|
|
94
130
|
return trackingImpUrl + 'cpmIncrement=' + cpmIncrement + '&context=' + context;
|
|
95
131
|
}
|
|
96
132
|
|
|
133
|
+
function getPromisifiedAjax (url, data = {}, options = {}) {
|
|
134
|
+
return new Promise((resolve, reject) => {
|
|
135
|
+
const callbacks = {
|
|
136
|
+
success(responseText, { response }) {
|
|
137
|
+
resolve(JSON.parse(response));
|
|
138
|
+
},
|
|
139
|
+
error(error) {
|
|
140
|
+
reject(error);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
ajax(url, callbacks, data, options);
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function getFilteredAdUnitsOnBidRates (bidsRateInterests, adUnits, params, useSampling) {
|
|
148
|
+
const { threshold, samplingRate } = params;
|
|
149
|
+
const filteredBids = [];
|
|
150
|
+
// Separate bidsRateInterests in two groups against threshold & samplingRate
|
|
151
|
+
const { interestingBidsRates, uninterestingBidsRates } = bidsRateInterests.reduce((acc, interestingBid) => {
|
|
152
|
+
const isBidRateUpper = typeof threshold == 'number' ? interestingBid.rate === true || interestingBid.rate > threshold : interestingBid.suggestion;
|
|
153
|
+
const isBidInteresting = isBidRateUpper || (getRandomNumber(100) < samplingRate && useSampling);
|
|
154
|
+
const key = isBidInteresting ? 'interestingBidsRates' : 'uninterestingBidsRates';
|
|
155
|
+
acc[key].push(interestingBid);
|
|
156
|
+
return acc;
|
|
157
|
+
}, {
|
|
158
|
+
interestingBidsRates: [],
|
|
159
|
+
uninterestingBidsRates: [] // Do something with later
|
|
160
|
+
});
|
|
161
|
+
logInfo(LOG_PREFIX, 'getFilteredAdUnitsOnBidRates()', interestingBidsRates, uninterestingBidsRates);
|
|
162
|
+
// Filter bids and adUnits against interesting bids rates
|
|
163
|
+
const newAdUnits = adUnits.filter(({ bids = [] }, adUnitIndex) => {
|
|
164
|
+
adUnits[adUnitIndex].bids = bids.filter(bid => {
|
|
165
|
+
if (!params.bidders || params.bidders.includes(bid.bidder)) {
|
|
166
|
+
const index = interestingBidsRates.findIndex(({ id }) => id === bid._id);
|
|
167
|
+
if (index == -1) {
|
|
168
|
+
let tmpBid = bid;
|
|
169
|
+
tmpBid['code'] = adUnits[adUnitIndex].code;
|
|
170
|
+
tmpBid['mediaTypes'] = adUnits[adUnitIndex].mediaTypes;
|
|
171
|
+
tmpBid['originalBidder'] = bidderAliasRegistry[bid.bidder] || bid.bidder;
|
|
172
|
+
if (tmpBid.floorData) {
|
|
173
|
+
delete tmpBid.floorData;
|
|
174
|
+
}
|
|
175
|
+
filteredBids.push(tmpBid);
|
|
176
|
+
}
|
|
177
|
+
delete bid._id;
|
|
178
|
+
return index !== -1;
|
|
179
|
+
} else {
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
return !!adUnits[adUnitIndex].bids.length;
|
|
184
|
+
});
|
|
185
|
+
return [newAdUnits, filteredBids];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function getRandomNumber (max = 10) {
|
|
189
|
+
return Math.round(Math.random() * max);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function getRequestsList(reqBidsConfigObj) {
|
|
193
|
+
let count = 0;
|
|
194
|
+
return reqBidsConfigObj.adUnits.flatMap(({
|
|
195
|
+
bids = [],
|
|
196
|
+
mediaTypes = {},
|
|
197
|
+
code = ''
|
|
198
|
+
}) => bids.reduce((acc, { bidder = '', params = {} }, index) => {
|
|
199
|
+
const id = count++;
|
|
200
|
+
bids[index]._id = id;
|
|
201
|
+
return acc.concat({
|
|
202
|
+
id,
|
|
203
|
+
adUnit: code,
|
|
204
|
+
bidder,
|
|
205
|
+
mediaTypes,
|
|
206
|
+
});
|
|
207
|
+
}, []));
|
|
208
|
+
}
|
|
209
|
+
|
|
97
210
|
submodule('realTimeData', oxxionSubmodule);
|
|
@@ -382,6 +382,8 @@ export const spec = {
|
|
|
382
382
|
'gdpr',
|
|
383
383
|
'gdpr_consent',
|
|
384
384
|
'us_privacy',
|
|
385
|
+
'gpp',
|
|
386
|
+
'gpp_sid',
|
|
385
387
|
'rp_schain',
|
|
386
388
|
].concat(Object.keys(params).filter(item => containsUId.test(item)))
|
|
387
389
|
.concat([
|
|
@@ -553,6 +555,11 @@ export const spec = {
|
|
|
553
555
|
data['us_privacy'] = encodeURIComponent(bidderRequest.uspConsent);
|
|
554
556
|
}
|
|
555
557
|
|
|
558
|
+
if (bidderRequest.gppConsent?.gppString) {
|
|
559
|
+
data['gpp'] = bidderRequest.gppConsent.gppString;
|
|
560
|
+
data['gpp_sid'] = bidderRequest.gppConsent?.applicableSections?.toString();
|
|
561
|
+
}
|
|
562
|
+
|
|
556
563
|
data['rp_maxbids'] = bidderRequest.bidLimit || 1;
|
|
557
564
|
|
|
558
565
|
applyFPD(bidRequest, BANNER, data);
|
|
@@ -695,7 +702,7 @@ export const spec = {
|
|
|
695
702
|
return (adB.cpm || 0.0) - (adA.cpm || 0.0);
|
|
696
703
|
});
|
|
697
704
|
},
|
|
698
|
-
getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent) {
|
|
705
|
+
getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent, gppConsent) {
|
|
699
706
|
if (!hasSynced && syncOptions.iframeEnabled) {
|
|
700
707
|
// data is only assigned if params are available to pass to syncEndpoint
|
|
701
708
|
let params = {};
|
|
@@ -713,6 +720,11 @@ export const spec = {
|
|
|
713
720
|
params['us_privacy'] = encodeURIComponent(uspConsent);
|
|
714
721
|
}
|
|
715
722
|
|
|
723
|
+
if (gppConsent?.gppString) {
|
|
724
|
+
params['gpp'] = gppConsent.gppString;
|
|
725
|
+
params['gpp_sid'] = gppConsent.applicableSections?.toString();
|
|
726
|
+
}
|
|
727
|
+
|
|
716
728
|
params = Object.keys(params).length ? `?${formatQS(params)}` : '';
|
|
717
729
|
|
|
718
730
|
hasSynced = true;
|
|
@@ -114,11 +114,12 @@ function extractUserSyncUrls(syncOptions, pixels) {
|
|
|
114
114
|
*/
|
|
115
115
|
function updateConsentQueryParams(url, consentData) {
|
|
116
116
|
const parameterMap = {
|
|
117
|
-
'gdpr_consent': consentData.gdpr.consentString,
|
|
118
|
-
'gdpr': consentData.gdpr.gdprApplies ? '1' : '0',
|
|
119
|
-
'us_privacy': consentData.uspConsent,
|
|
120
|
-
'gpp': consentData.gpp.gppString,
|
|
121
|
-
'gpp_sid': consentData.gpp
|
|
117
|
+
'gdpr_consent': consentData.gdpr ? consentData.gdpr.consentString : '',
|
|
118
|
+
'gdpr': consentData.gdpr && consentData.gdpr.gdprApplies ? '1' : '0',
|
|
119
|
+
'us_privacy': consentData.uspConsent ? consentData.uspConsent : '',
|
|
120
|
+
'gpp': consentData.gpp ? consentData.gpp.gppString : '',
|
|
121
|
+
'gpp_sid': consentData.gpp && Array.isArray(consentData.gpp.applicableSections)
|
|
122
|
+
? consentData.gpp.applicableSections.join(',') : ''
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
const existingUrl = new URL(url);
|
|
@@ -276,8 +277,8 @@ function generateOpenRtbObject(bidderRequest, bid) {
|
|
|
276
277
|
ext: {
|
|
277
278
|
'us_privacy': bidderRequest.uspConsent ? bidderRequest.uspConsent : '',
|
|
278
279
|
gdpr: bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies ? 1 : 0,
|
|
279
|
-
gpp: bidderRequest.gppConsent.gppString,
|
|
280
|
-
gpp_sid: bidderRequest.gppConsent.applicableSections
|
|
280
|
+
gpp: bidderRequest.gppConsent ? bidderRequest.gppConsent.gppString : '',
|
|
281
|
+
gpp_sid: bidderRequest.gppConsent ? bidderRequest.gppConsent.applicableSections : []
|
|
281
282
|
}
|
|
282
283
|
},
|
|
283
284
|
source: {
|