prebid.js 7.17.0 → 7.19.0
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/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adfBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adqueryIdSystem.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/audiencerunBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/{andBeyondMediaBidAdapter.js → beyondmediaBidAdapter.js} +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/bidwatchAnalyticsAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bluebillywigBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/cleanioRtdProvider.js +1 -1
- package/dist/colossussspBidAdapter.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 -0
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/debugging-standalone.js +1 -1
- package/dist/debugging.js +1 -1
- package/dist/dependencies.json +6 -0
- package/dist/dgkeywordRtdProvider.js +1 -1
- package/dist/dianomiBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/enrichmentFpdModule.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/fpd.js +1 -0
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/growthCodeIdSystem.js +1 -0
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/impactifyBidAdapter.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/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediakeysBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/nativoBidAdapter.js +1 -1
- package/dist/nextMillenniumBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +133 -130
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/prebidServerBidAdapter.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/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/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.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/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.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/yandexBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/libraries/fpd/sua.js +98 -0
- package/modules/adagioBidAdapter.js +2 -1
- package/modules/adfBidAdapter.js +1 -1
- package/modules/adkernelAdnBidAdapter.js +1 -0
- package/modules/adqueryBidAdapter.js +4 -2
- package/modules/adqueryIdSystem.js +8 -8
- package/modules/adxcgBidAdapter.js +1 -1
- package/modules/amxBidAdapter.js +1 -1
- package/modules/{andBeyondMediaBidAdapter.js → beyondmediaBidAdapter.js} +0 -0
- package/modules/{andBeyondMediaBidAdapter.md → beyondmediaBidAdapter.md} +1 -1
- package/modules/bidwatchAnalyticsAdapter.js +1 -1
- package/modules/cleanioRtdProvider.js +3 -4
- package/modules/colossussspBidAdapter.js +2 -1
- package/modules/conversantAnalyticsAdapter.js +560 -0
- package/modules/conversantAnalyticsAdapter.md +47 -0
- package/modules/criteoBidAdapter.js +1 -1
- package/modules/debugging/bidInterceptor.js +2 -2
- package/modules/debugging/debugging.js +10 -2
- package/modules/dgkeywordRtdProvider.js +21 -3
- package/modules/dianomiBidAdapter.js +1 -1
- package/modules/enrichmentFpdModule.js +33 -14
- package/modules/finativeBidAdapter.js +1 -1
- package/modules/gridBidAdapter.js +188 -118
- package/modules/growthCodeIdSystem.js +164 -0
- package/modules/growthCodeIdSystem.md +37 -0
- package/modules/improvedigitalBidAdapter.js +2 -2
- package/modules/ixBidAdapter.js +94 -23
- package/modules/liveIntentIdSystem.js +39 -5
- package/modules/mediakeysBidAdapter.js +6 -1
- package/modules/mediakeysBidAdapter.md +50 -40
- package/modules/nativoBidAdapter.js +3 -2
- package/modules/nextMillenniumBidAdapter.js +34 -11
- package/modules/prebidServerBidAdapter/index.js +44 -13
- package/modules/readpeakBidAdapter.js +1 -1
- package/modules/rubiconBidAdapter.js +2 -3
- package/modules/seedingAllianceBidAdapter.js +1 -1
- package/modules/seedtagBidAdapter.js +4 -0
- package/modules/sharethroughBidAdapter.js +1 -1
- package/modules/taboolaBidAdapter.js +4 -8
- package/modules/talkadsBidAdapter.js +1 -0
- package/modules/truereachBidAdapter.js +1 -0
- package/modules/ttdBidAdapter.js +1 -1
- package/modules/userId/eids.js +19 -0
- package/modules/vidazooBidAdapter.js +1 -1
- package/modules/vuukleBidAdapter.js +34 -3
- package/modules/yahoosspBidAdapter.js +3 -1
- package/modules/yandexBidAdapter.js +31 -8
- package/package.json +2 -2
- package/src/adapterManager.js +2 -4
- package/src/cpmBucketManager.js +22 -3
- package/src/native.js +1 -5
- package/src/prebid.js +3 -3
- package/test/spec/cpmBucketManager_spec.js +239 -177
- package/test/spec/fpd/sua_spec.js +244 -0
- package/test/spec/modules/adagioBidAdapter_spec.js +23 -0
- package/test/spec/modules/adfBidAdapter_spec.js +2 -3
- package/test/spec/modules/adqueryBidAdapter_spec.js +11 -0
- package/test/spec/modules/adqueryIdSystem_spec.js +0 -2
- package/test/spec/modules/adxcgBidAdapter_spec.js +2 -3
- package/test/spec/modules/amxBidAdapter_spec.js +3 -2
- package/test/spec/modules/{andBeyondMediaBidAdapter_spec.js → beyondmediaBidAdapter_spec.js} +1 -1
- package/test/spec/modules/bidwatchAnalyticsAdapter_spec.js +2 -0
- package/test/spec/modules/colossussspBidAdapter_spec.js +4 -2
- package/test/spec/modules/conversantAnalyticsAdapter_spec.js +963 -0
- package/test/spec/modules/debugging_mod_spec.js +9 -0
- package/test/spec/modules/dgkeywordRtdProvider_spec.js +83 -1
- package/test/spec/modules/dianomiBidAdapter_spec.js +2 -3
- package/test/spec/modules/enrichmentFpdModule_spec.js +50 -7
- package/test/spec/modules/fpdModule_spec.js +9 -0
- package/test/spec/modules/gridBidAdapter_spec.js +87 -31
- package/test/spec/modules/growthCodeIdSystem_spec.js +83 -0
- package/test/spec/modules/ixBidAdapter_spec.js +221 -2
- package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +62 -8
- package/test/spec/modules/liveIntentIdSystem_spec.js +62 -8
- package/test/spec/modules/mediakeysBidAdapter_spec.js +20 -3
- package/test/spec/modules/nativoBidAdapter_spec.js +13 -2
- package/test/spec/modules/prebidServerBidAdapter_spec.js +171 -4
- package/test/spec/modules/seedtagBidAdapter_spec.js +42 -0
- package/test/spec/modules/sharethroughBidAdapter_spec.js +2 -1
- package/test/spec/modules/taboolaBidAdapter_spec.js +2 -2
- package/test/spec/modules/ttdBidAdapter_spec.js +3 -3
- package/test/spec/modules/vuukleBidAdapter_spec.js +87 -0
- package/test/spec/modules/yahoosspBidAdapter_spec.js +3 -1
- package/test/spec/modules/yandexBidAdapter_spec.js +8 -5
- package/test/spec/native_spec.js +5 -0
- package/test/spec/unit/pbjs_api_spec.js +44 -0
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
logMessage,
|
|
9
9
|
parseUrl,
|
|
10
10
|
triggerPixel,
|
|
11
|
+
getDefinedParams,
|
|
12
|
+
parseGPTSingleSizeArrayToRtbSize,
|
|
11
13
|
} from '../src/utils.js';
|
|
12
14
|
|
|
13
15
|
import CONSTANTS from '../src/constants.json';
|
|
@@ -22,6 +24,10 @@ const ENDPOINT = 'https://pbs.nextmillmedia.com/openrtb2/auction';
|
|
|
22
24
|
const TEST_ENDPOINT = 'https://test.pbs.nextmillmedia.com/openrtb2/auction';
|
|
23
25
|
const SYNC_ENDPOINT = 'https://statics.nextmillmedia.com/load-cookie.html?v=4';
|
|
24
26
|
const TIME_TO_LIVE = 360;
|
|
27
|
+
const VIDEO_PARAMS = [
|
|
28
|
+
'api', 'linearity', 'maxduration', 'mimes', 'minduration', 'placement',
|
|
29
|
+
'playbackmethod', 'protocols', 'startdelay'
|
|
30
|
+
];
|
|
25
31
|
|
|
26
32
|
const EXPIRENCE_WURL = 20 * 60000;
|
|
27
33
|
const wurlMap = {};
|
|
@@ -72,21 +78,38 @@ export const spec = {
|
|
|
72
78
|
|
|
73
79
|
device,
|
|
74
80
|
site,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
'format': (sizes || []).map(s => { return {w: s[0], h: s[1]} })
|
|
78
|
-
},
|
|
81
|
+
imp: []
|
|
82
|
+
};
|
|
79
83
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
}
|
|
84
|
+
const imp = {
|
|
85
|
+
ext: {
|
|
86
|
+
prebid: {
|
|
87
|
+
storedrequest: {id}
|
|
86
88
|
}
|
|
87
|
-
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
if (deepAccess(bid, 'mediaTypes.banner')) {
|
|
93
|
+
imp.banner = {
|
|
94
|
+
format: (sizes || []).map(s => { return {w: s[0], h: s[1]} })
|
|
95
|
+
};
|
|
88
96
|
};
|
|
89
97
|
|
|
98
|
+
const video = deepAccess(bid, 'mediaTypes.video');
|
|
99
|
+
if (video) {
|
|
100
|
+
imp.video = getDefinedParams(video, VIDEO_PARAMS);
|
|
101
|
+
if (video.playerSize) {
|
|
102
|
+
imp.video = Object.assign(
|
|
103
|
+
imp.video, parseGPTSingleSizeArrayToRtbSize(video.playerSize[0]) || {}
|
|
104
|
+
);
|
|
105
|
+
} else if (video.w && video.h) {
|
|
106
|
+
imp.video.w = video.w;
|
|
107
|
+
imp.video.h = video.h;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
postBody.imp.push(imp);
|
|
112
|
+
|
|
90
113
|
const gdprConsent = bidderRequest && bidderRequest.gdprConsent;
|
|
91
114
|
const uspConsent = bidderRequest && bidderRequest.uspConsent;
|
|
92
115
|
|
|
@@ -522,6 +522,8 @@ Object.assign(ORTB2.prototype, {
|
|
|
522
522
|
let imps = [];
|
|
523
523
|
let aliases = {};
|
|
524
524
|
const firstBidRequest = bidRequests[0];
|
|
525
|
+
let floorMin = null;
|
|
526
|
+
let floorMinCur = null;
|
|
525
527
|
|
|
526
528
|
// transform ad unit into array of OpenRTB impression objects
|
|
527
529
|
let impIds = new Set();
|
|
@@ -671,21 +673,21 @@ Object.assign(ORTB2.prototype, {
|
|
|
671
673
|
|
|
672
674
|
mergeDeep(imp, mediaTypes);
|
|
673
675
|
|
|
676
|
+
const convertCurrency = typeof getGlobal().convertCurrency !== 'function'
|
|
677
|
+
? (amount) => amount
|
|
678
|
+
: (amount, from, to) => {
|
|
679
|
+
if (from === to) return amount;
|
|
680
|
+
let result = null;
|
|
681
|
+
try {
|
|
682
|
+
result = getGlobal().convertCurrency(amount, from, to);
|
|
683
|
+
} catch (e) {
|
|
684
|
+
}
|
|
685
|
+
return result;
|
|
686
|
+
}
|
|
687
|
+
|
|
674
688
|
const floor = (() => {
|
|
675
689
|
// we have to pick a floor for the imp - here we attempt to find the minimum floor
|
|
676
690
|
// across all bids for this adUnit
|
|
677
|
-
|
|
678
|
-
const convertCurrency = typeof getGlobal().convertCurrency !== 'function'
|
|
679
|
-
? (amount) => amount
|
|
680
|
-
: (amount, from, to) => {
|
|
681
|
-
if (from === to) return amount;
|
|
682
|
-
let result = null;
|
|
683
|
-
try {
|
|
684
|
-
result = getGlobal().convertCurrency(amount, from, to);
|
|
685
|
-
} catch (e) {
|
|
686
|
-
}
|
|
687
|
-
return result;
|
|
688
|
-
}
|
|
689
691
|
const s2sCurrency = config.getConfig('currency.adServerCurrency') || DEFAULT_S2S_CURRENCY;
|
|
690
692
|
|
|
691
693
|
return adUnit.bids
|
|
@@ -696,6 +698,7 @@ Object.assign(ORTB2.prototype, {
|
|
|
696
698
|
const {currency, floor} = bid.getFloor({
|
|
697
699
|
currency: s2sCurrency
|
|
698
700
|
});
|
|
701
|
+
|
|
699
702
|
return {
|
|
700
703
|
currency,
|
|
701
704
|
floor: parseFloat(floor)
|
|
@@ -717,11 +720,13 @@ Object.assign(ORTB2.prototype, {
|
|
|
717
720
|
min.ref = min.min = floor;
|
|
718
721
|
} else {
|
|
719
722
|
const value = convertCurrency(floor.floor, floor.currency, min.ref.currency);
|
|
723
|
+
|
|
720
724
|
if (value != null && value < min.ref.floor) {
|
|
721
725
|
min.ref.floor = value;
|
|
722
726
|
min.min = floor;
|
|
723
727
|
}
|
|
724
728
|
}
|
|
729
|
+
|
|
725
730
|
return min;
|
|
726
731
|
}, {}).min
|
|
727
732
|
})();
|
|
@@ -729,6 +734,26 @@ Object.assign(ORTB2.prototype, {
|
|
|
729
734
|
if (floor) {
|
|
730
735
|
imp.bidfloor = floor.floor;
|
|
731
736
|
imp.bidfloorcur = floor.currency;
|
|
737
|
+
|
|
738
|
+
// logic below relates to https://github.com/prebid/Prebid.js/issues/8749 and does the following:
|
|
739
|
+
// 1. check client-side floors (ref bidfloor/bidfloorcur & ortb2Imp floorMin/floorMinCur (if present))
|
|
740
|
+
// 2. set pbs req wide floorMinCur to the first floor currency found when iterating over imp's
|
|
741
|
+
// (if currency conversion logic present, convert all imp floor values to this currency)
|
|
742
|
+
// 3. compare/store ref to lowest floorMin value as each imp is iterated over
|
|
743
|
+
// 4. set req wide floorMin and floorMinCur values for pbs after iterations are done
|
|
744
|
+
if (floorMinCur == null) { floorMinCur = floor.currency }
|
|
745
|
+
const ortb2ImpFloorMin = imp.ext?.prebid?.floors?.floorMin || imp.ext?.prebid?.floorMin;
|
|
746
|
+
const ortb2ImpFloorCur = imp.ext?.prebid?.floors?.floorMinCur || imp.ext?.prebid?.floorMinCur || floorMinCur;
|
|
747
|
+
|
|
748
|
+
const convertedFloorMinValue = convertCurrency(floor.floor, floor.currency, floorMinCur);
|
|
749
|
+
const convertedOrtb2ImpFloorMinValue = ortb2ImpFloorMin && ortb2ImpFloorCur ? convertCurrency(ortb2ImpFloorMin, ortb2ImpFloorCur, floorMinCur) : false;
|
|
750
|
+
|
|
751
|
+
const lowestImpFloorMin = convertedOrtb2ImpFloorMinValue && convertedOrtb2ImpFloorMinValue < convertedFloorMinValue
|
|
752
|
+
? convertedOrtb2ImpFloorMinValue
|
|
753
|
+
: convertedFloorMinValue;
|
|
754
|
+
|
|
755
|
+
deepSetValue(imp, 'ext.prebid.floors.floorMin', lowestImpFloorMin);
|
|
756
|
+
if (floorMin == null || floorMin > lowestImpFloorMin) { floorMin = lowestImpFloorMin }
|
|
732
757
|
}
|
|
733
758
|
|
|
734
759
|
if (imp.banner || imp.video || imp.native) {
|
|
@@ -742,7 +767,7 @@ Object.assign(ORTB2.prototype, {
|
|
|
742
767
|
}
|
|
743
768
|
const request = {
|
|
744
769
|
id: firstBidRequest.auctionId,
|
|
745
|
-
source: {tid:
|
|
770
|
+
source: {tid: firstBidRequest.auctionId},
|
|
746
771
|
tmax: s2sConfig.timeout,
|
|
747
772
|
imp: imps,
|
|
748
773
|
// to do: add setconfig option to pass test = 1
|
|
@@ -903,6 +928,12 @@ Object.assign(ORTB2.prototype, {
|
|
|
903
928
|
addBidderFirstPartyDataToRequest(request, s2sBidRequest.ortb2Fragments?.bidder || {});
|
|
904
929
|
|
|
905
930
|
request.imp.forEach((imp) => this.impRequested[imp.id] = imp);
|
|
931
|
+
|
|
932
|
+
if (request.ext?.prebid?.floors?.enabled) {
|
|
933
|
+
request.ext.prebid.floors.floorMin = floorMin;
|
|
934
|
+
request.ext.prebid.floors.floorMinCur = floorMinCur;
|
|
935
|
+
}
|
|
936
|
+
|
|
906
937
|
return request;
|
|
907
938
|
},
|
|
908
939
|
|
|
@@ -333,7 +333,7 @@ export const spec = {
|
|
|
333
333
|
}
|
|
334
334
|
});
|
|
335
335
|
|
|
336
|
-
if (
|
|
336
|
+
if (config.getConfig('rubicon.singleRequest') !== true) {
|
|
337
337
|
// bids are not grouped if single request mode is not enabled
|
|
338
338
|
requests = videoRequests.concat(bidRequests.filter(bidRequest => bidType(bidRequest) === 'banner').map(bidRequest => {
|
|
339
339
|
const bidParams = spec.createSlotParams(bidRequest, bidderRequest);
|
|
@@ -1279,8 +1279,7 @@ export function hasValidSupplyChainParams(schain) {
|
|
|
1279
1279
|
}
|
|
1280
1280
|
|
|
1281
1281
|
/**
|
|
1282
|
-
* Creates a URL key value param, encoding the
|
|
1283
|
-
* param unless the key is schain
|
|
1282
|
+
* Creates a URL key value param, encoding the param unless the key is schain
|
|
1284
1283
|
* @param {String} key
|
|
1285
1284
|
* @param {String} param
|
|
1286
1285
|
* @returns {String}
|
|
@@ -67,7 +67,7 @@ export const spec = {
|
|
|
67
67
|
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
|
|
68
68
|
|
|
69
69
|
const pt = setOnAny(validBidRequests, 'params.pt') || setOnAny(validBidRequests, 'params.priceType') || 'net';
|
|
70
|
-
const tid =
|
|
70
|
+
const tid = bidderRequest.auctionId;
|
|
71
71
|
const cur = [config.getConfig('currency.adServerCurrency') || DEFAULT_CUR];
|
|
72
72
|
let url = bidderRequest.refererInfo.page;
|
|
73
73
|
|
|
@@ -240,6 +240,10 @@ export const spec = {
|
|
|
240
240
|
payload['uspConsent'] = bidderRequest.uspConsent
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
+
if (validBidRequests[0].schain) {
|
|
244
|
+
payload.schain = validBidRequests[0].schain;
|
|
245
|
+
}
|
|
246
|
+
|
|
243
247
|
const payloadString = JSON.stringify(payload)
|
|
244
248
|
return {
|
|
245
249
|
method: 'POST',
|
|
@@ -60,14 +60,10 @@ export const userData = {
|
|
|
60
60
|
|
|
61
61
|
export const internal = {
|
|
62
62
|
getPageUrl: (refererInfo = {}) => {
|
|
63
|
-
return refererInfo
|
|
63
|
+
return refererInfo?.page || getWindowSelf().location.href;
|
|
64
64
|
},
|
|
65
65
|
getReferrer: (refererInfo = {}) => {
|
|
66
|
-
|
|
67
|
-
return refererInfo.ref;
|
|
68
|
-
} else {
|
|
69
|
-
return getWindowSelf().document.referrer;
|
|
70
|
-
}
|
|
66
|
+
return refererInfo?.ref || getWindowSelf().document.referrer;
|
|
71
67
|
}
|
|
72
68
|
}
|
|
73
69
|
|
|
@@ -160,7 +156,7 @@ function getSiteProperties({publisherId, bcat = []}, refererInfo) {
|
|
|
160
156
|
return {
|
|
161
157
|
id: publisherId,
|
|
162
158
|
name: publisherId,
|
|
163
|
-
domain: refererInfo?.domain || window.location
|
|
159
|
+
domain: refererInfo?.domain || window.location?.host,
|
|
164
160
|
page: getPageUrl(refererInfo),
|
|
165
161
|
ref: getReferrer(refererInfo),
|
|
166
162
|
publisher: {
|
|
@@ -241,7 +237,7 @@ function getBid(requestId, currency, bidResponse) {
|
|
|
241
237
|
width,
|
|
242
238
|
height,
|
|
243
239
|
meta,
|
|
244
|
-
netRevenue:
|
|
240
|
+
netRevenue: true
|
|
245
241
|
};
|
|
246
242
|
}
|
|
247
243
|
|
|
@@ -63,6 +63,7 @@ export const spec = {
|
|
|
63
63
|
cur: CURRENCY,
|
|
64
64
|
timeout: poBidderRequest.timeout,
|
|
65
65
|
auction_id: paValidBidRequests[0].auctionId,
|
|
66
|
+
// TODO: should this use auctionId? see #8573
|
|
66
67
|
transaction_id: paValidBidRequests[0].transactionId,
|
|
67
68
|
bids: laBids,
|
|
68
69
|
gdpr: { applies: false, consent: false },
|
package/modules/ttdBidAdapter.js
CHANGED
|
@@ -59,7 +59,7 @@ function getBidFloor(bid) {
|
|
|
59
59
|
|
|
60
60
|
function getSource(validBidRequests) {
|
|
61
61
|
let source = {
|
|
62
|
-
tid: validBidRequests[0].
|
|
62
|
+
tid: validBidRequests[0].auctionId
|
|
63
63
|
};
|
|
64
64
|
if (validBidRequests[0].schain) {
|
|
65
65
|
utils.deepSetValue(source, 'ext.schain', validBidRequests[0].schain);
|
package/modules/userId/eids.js
CHANGED
|
@@ -5,6 +5,25 @@ export const USER_IDS_CONFIG = {
|
|
|
5
5
|
|
|
6
6
|
// key-name : {config}
|
|
7
7
|
|
|
8
|
+
// GrowthCode
|
|
9
|
+
'growthCodeId': {
|
|
10
|
+
getValue: function(data) {
|
|
11
|
+
return data.gc_id
|
|
12
|
+
},
|
|
13
|
+
source: 'growthcode.io',
|
|
14
|
+
atype: 1,
|
|
15
|
+
getUidExt: function(data) {
|
|
16
|
+
const extendedData = pick(data, [
|
|
17
|
+
'h1',
|
|
18
|
+
'h2',
|
|
19
|
+
'h3',
|
|
20
|
+
]);
|
|
21
|
+
if (Object.keys(extendedData).length) {
|
|
22
|
+
return extendedData;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
|
|
8
27
|
// trustpid
|
|
9
28
|
'trustpid': {
|
|
10
29
|
source: 'trustpid.com',
|
|
@@ -10,7 +10,7 @@ const BIDDER_VERSION = '1.0.0';
|
|
|
10
10
|
const CURRENCY = 'USD';
|
|
11
11
|
const TTL_SECONDS = 60 * 5;
|
|
12
12
|
const DEAL_ID_EXPIRY = 1000 * 60 * 15;
|
|
13
|
-
const UNIQUE_DEAL_ID_EXPIRY = 1000 * 60 *
|
|
13
|
+
const UNIQUE_DEAL_ID_EXPIRY = 1000 * 60 * 60;
|
|
14
14
|
const SESSION_ID_KEY = 'vidSid';
|
|
15
15
|
export const SUPPORTED_ID_SYSTEMS = {
|
|
16
16
|
'britepoolid': 1,
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import { parseSizesInput } from '../src/utils.js';
|
|
1
|
+
import { parseSizesInput, deepAccess } from '../src/utils.js';
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
|
+
import { BANNER } from '../src/mediaTypes.js';
|
|
4
|
+
import { config } from '../src/config.js';
|
|
3
5
|
|
|
4
6
|
const BIDDER_CODE = 'vuukle';
|
|
5
7
|
const URL = 'https://pb.vuukle.com/adapter';
|
|
6
8
|
const TIME_TO_LIVE = 360;
|
|
9
|
+
const VENDOR_ID = 1004;
|
|
7
10
|
|
|
8
11
|
export const spec = {
|
|
9
12
|
code: BIDDER_CODE,
|
|
13
|
+
gvlid: VENDOR_ID,
|
|
14
|
+
supportedMediaTypes: [ BANNER ],
|
|
10
15
|
|
|
11
16
|
isBidRequestValid: function(bid) {
|
|
12
17
|
return true
|
|
13
18
|
},
|
|
14
19
|
|
|
15
|
-
buildRequests: function(bidRequests) {
|
|
20
|
+
buildRequests: function(bidRequests, bidderRequest) {
|
|
21
|
+
bidderRequest = bidderRequest || {};
|
|
16
22
|
const requests = bidRequests.map(function (bid) {
|
|
17
23
|
const parseSized = parseSizesInput(bid.sizes);
|
|
18
24
|
const arrSize = parseSized[0].split('x');
|
|
@@ -25,10 +31,27 @@ export const spec = {
|
|
|
25
31
|
rnd: Math.random(),
|
|
26
32
|
bidId: bid.bidId,
|
|
27
33
|
source: 'pbjs',
|
|
34
|
+
schain: JSON.stringify(bid.schain),
|
|
35
|
+
requestId: bid.bidderRequestId,
|
|
36
|
+
tmax: bidderRequest.timeout,
|
|
37
|
+
gdpr: (bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies) ? 1 : 0,
|
|
38
|
+
consentGiven: vuukleGetConsentGiven(bidderRequest.gdprConsent),
|
|
28
39
|
version: '$prebid.version$',
|
|
29
|
-
v:
|
|
40
|
+
v: 2,
|
|
30
41
|
};
|
|
31
42
|
|
|
43
|
+
if (bidderRequest.uspConsent) {
|
|
44
|
+
params.uspConsent = bidderRequest.uspConsent;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (config.getConfig('coppa') === true) {
|
|
48
|
+
params.coppa = 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (bidderRequest.gdprConsent && bidderRequest.gdprConsent.consentString) {
|
|
52
|
+
params.consent = bidderRequest.gdprConsent.consentString;
|
|
53
|
+
}
|
|
54
|
+
|
|
32
55
|
return {
|
|
33
56
|
method: 'GET',
|
|
34
57
|
url: URL,
|
|
@@ -65,3 +88,11 @@ export const spec = {
|
|
|
65
88
|
},
|
|
66
89
|
}
|
|
67
90
|
registerBidder(spec);
|
|
91
|
+
|
|
92
|
+
function vuukleGetConsentGiven(gdprConsent) {
|
|
93
|
+
let consentGiven = 0;
|
|
94
|
+
if (typeof gdprConsent !== 'undefined') {
|
|
95
|
+
consentGiven = deepAccess(gdprConsent, `vendorData.vendor.consents.${VENDOR_ID}`) ? 1 : 0;
|
|
96
|
+
}
|
|
97
|
+
return consentGiven;
|
|
98
|
+
}
|
|
@@ -237,7 +237,9 @@ function generateOpenRtbObject(bidderRequest, bid) {
|
|
|
237
237
|
device: {
|
|
238
238
|
dnt: 0,
|
|
239
239
|
ua: navigator.userAgent,
|
|
240
|
-
ip: deepAccess(bid, 'params.bidOverride.device.ip') || deepAccess(bid, 'params.ext.ip') || undefined
|
|
240
|
+
ip: deepAccess(bid, 'params.bidOverride.device.ip') || deepAccess(bid, 'params.ext.ip') || undefined,
|
|
241
|
+
w: window.screen.width,
|
|
242
|
+
h: window.screen.height
|
|
241
243
|
},
|
|
242
244
|
regs: {
|
|
243
245
|
ext: {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {formatQS, deepAccess} from '../src/utils.js';
|
|
1
|
+
import { formatQS, deepAccess, triggerPixel } from '../src/utils.js';
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
3
|
|
|
4
4
|
const BIDDER_CODE = 'yandex';
|
|
5
|
-
const BIDDER_URL = 'https://bs
|
|
5
|
+
const BIDDER_URL = 'https://bs.yandex.ru/metadsp';
|
|
6
6
|
const DEFAULT_TTL = 180;
|
|
7
|
+
const DEFAULT_CURRENCY = 'EUR';
|
|
7
8
|
const SSP_ID = 10500;
|
|
8
9
|
|
|
9
10
|
export const spec = {
|
|
@@ -19,9 +20,13 @@ export const spec = {
|
|
|
19
20
|
const consentString = deepAccess(bidderRequest, 'gdprConsent.consentString');
|
|
20
21
|
|
|
21
22
|
let referrer = '';
|
|
23
|
+
let domain = '';
|
|
24
|
+
let page = '';
|
|
25
|
+
|
|
22
26
|
if (bidderRequest && bidderRequest.refererInfo) {
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
referrer = bidderRequest.refererInfo.ref;
|
|
28
|
+
domain = bidderRequest.refererInfo.domain;
|
|
29
|
+
page = bidderRequest.refererInfo.page;
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
return validBidRequests.map((bidRequest) => {
|
|
@@ -30,17 +35,25 @@ export const spec = {
|
|
|
30
35
|
|
|
31
36
|
const queryParams = {
|
|
32
37
|
'imp-id': impId,
|
|
33
|
-
'target-ref': targetRef ||
|
|
38
|
+
'target-ref': targetRef || domain,
|
|
34
39
|
'ssp-id': SSP_ID,
|
|
35
40
|
};
|
|
36
41
|
if (gdprApplies !== undefined) {
|
|
37
42
|
queryParams['gdpr'] = 1;
|
|
38
43
|
queryParams['tcf-consent'] = consentString;
|
|
39
44
|
}
|
|
45
|
+
|
|
46
|
+
const floorInfo = bidRequest.getFloor ? bidRequest.getFloor({
|
|
47
|
+
currency: DEFAULT_CURRENCY
|
|
48
|
+
}) : {};
|
|
49
|
+
const bidfloor = floorInfo.floor;
|
|
50
|
+
const bidfloorcur = floorInfo.currency;
|
|
51
|
+
|
|
40
52
|
const imp = {
|
|
41
53
|
id: impId,
|
|
54
|
+
bidfloor,
|
|
55
|
+
bidfloorcur,
|
|
42
56
|
};
|
|
43
|
-
|
|
44
57
|
const bannerParams = deepAccess(bidRequest, 'mediaTypes.banner');
|
|
45
58
|
if (bannerParams) {
|
|
46
59
|
const [ w, h ] = bannerParams.sizes[0];
|
|
@@ -58,7 +71,8 @@ export const spec = {
|
|
|
58
71
|
id: bidRequest.bidId,
|
|
59
72
|
imp: [imp],
|
|
60
73
|
site: {
|
|
61
|
-
|
|
74
|
+
ref_url: referrer,
|
|
75
|
+
page_url: page,
|
|
62
76
|
},
|
|
63
77
|
},
|
|
64
78
|
options: {
|
|
@@ -84,7 +98,7 @@ export const spec = {
|
|
|
84
98
|
let prBid = {
|
|
85
99
|
requestId: bidRequest.bidId,
|
|
86
100
|
cpm: rtbBid.price,
|
|
87
|
-
currency: cur ||
|
|
101
|
+
currency: cur || DEFAULT_CURRENCY,
|
|
88
102
|
width: rtbBid.w,
|
|
89
103
|
height: rtbBid.h,
|
|
90
104
|
creativeId: rtbBid.adid,
|
|
@@ -102,6 +116,15 @@ export const spec = {
|
|
|
102
116
|
return prBid;
|
|
103
117
|
});
|
|
104
118
|
},
|
|
119
|
+
|
|
120
|
+
onBidWon: function (bid) {
|
|
121
|
+
const nurl = bid['nurl'];
|
|
122
|
+
|
|
123
|
+
if (!nurl) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
triggerPixel(nurl);
|
|
127
|
+
}
|
|
105
128
|
}
|
|
106
129
|
|
|
107
130
|
registerBidder(spec);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prebid.js",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.19.0",
|
|
4
4
|
"description": "Header Bidding Management Library",
|
|
5
5
|
"main": "src/prebid.js",
|
|
6
6
|
"scripts": {
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"express": "^4.15.4",
|
|
127
127
|
"fun-hooks": "^0.9.9",
|
|
128
128
|
"just-clone": "^1.0.2",
|
|
129
|
-
"live-connect-js": "2.
|
|
129
|
+
"live-connect-js": "2.4.0"
|
|
130
130
|
},
|
|
131
131
|
"optionalDependencies": {
|
|
132
132
|
"fsevents": "^2.3.2"
|
package/src/adapterManager.js
CHANGED
|
@@ -357,8 +357,6 @@ adapterManager.callBids = (adUnits, bidRequests, addBidResponse, doneCb, request
|
|
|
357
357
|
|
|
358
358
|
let counter = 0;
|
|
359
359
|
|
|
360
|
-
// $.source.tid MUST be a unique UUID and also THE SAME between all PBS Requests for a given Auction
|
|
361
|
-
const sourceTid = generateUUID();
|
|
362
360
|
_s2sConfigs.forEach((s2sConfig) => {
|
|
363
361
|
if (s2sConfig && uniqueServerBidRequests[counter] && getS2SBidderSet(s2sConfig).has(uniqueServerBidRequests[counter].bidderCode)) {
|
|
364
362
|
// s2s should get the same client side timeout as other client side requests.
|
|
@@ -374,7 +372,7 @@ adapterManager.callBids = (adUnits, bidRequests, addBidResponse, doneCb, request
|
|
|
374
372
|
let uniqueServerRequests = serverBidRequests.filter(serverBidRequest => serverBidRequest.uniquePbsTid === uniquePbsTid);
|
|
375
373
|
|
|
376
374
|
if (s2sAdapter) {
|
|
377
|
-
let s2sBidRequest = {
|
|
375
|
+
let s2sBidRequest = {'ad_units': adUnitsS2SCopy, s2sConfig, ortb2Fragments};
|
|
378
376
|
if (s2sBidRequest.ad_units.length) {
|
|
379
377
|
let doneCbs = uniqueServerRequests.map(bidRequest => {
|
|
380
378
|
bidRequest.start = timestamp();
|
|
@@ -387,7 +385,7 @@ adapterManager.callBids = (adUnits, bidRequests, addBidResponse, doneCb, request
|
|
|
387
385
|
// fire BID_REQUESTED event for each s2s bidRequest
|
|
388
386
|
uniqueServerRequests.forEach(bidRequest => {
|
|
389
387
|
// add the new sourceTid
|
|
390
|
-
events.emit(CONSTANTS.EVENTS.BID_REQUESTED, {...bidRequest, tid:
|
|
388
|
+
events.emit(CONSTANTS.EVENTS.BID_REQUESTED, {...bidRequest, tid: bidRequest.auctionId});
|
|
391
389
|
});
|
|
392
390
|
|
|
393
391
|
// make bid requests
|
package/src/cpmBucketManager.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {find} from './polyfill.js';
|
|
2
|
-
import { isEmpty } from './utils.js';
|
|
2
|
+
import { isEmpty, logWarn } from './utils.js';
|
|
3
|
+
import { config } from './config.js';
|
|
3
4
|
|
|
4
5
|
const _defaultPrecision = 2;
|
|
5
6
|
const _lgPriceConfig = {
|
|
@@ -118,6 +119,11 @@ function getCpmTarget(cpm, bucket, granularityMultiplier) {
|
|
|
118
119
|
const precision = typeof bucket.precision !== 'undefined' ? bucket.precision : _defaultPrecision;
|
|
119
120
|
const increment = bucket.increment * granularityMultiplier;
|
|
120
121
|
const bucketMin = bucket.min * granularityMultiplier;
|
|
122
|
+
let roundingFunction = Math.floor;
|
|
123
|
+
let customRoundingFunction = config.getConfig('cpmRoundingFunction');
|
|
124
|
+
if (typeof customRoundingFunction === 'function') {
|
|
125
|
+
roundingFunction = customRoundingFunction;
|
|
126
|
+
}
|
|
121
127
|
|
|
122
128
|
// start increments at the bucket min and then add bucket min back to arrive at the correct rounding
|
|
123
129
|
// note - we're padding the values to avoid using decimals in the math prior to flooring
|
|
@@ -125,10 +131,23 @@ function getCpmTarget(cpm, bucket, granularityMultiplier) {
|
|
|
125
131
|
// (eg 4.01 / 0.01 = 400.99999999999994)
|
|
126
132
|
// min precison should be 2 to move decimal place over.
|
|
127
133
|
let pow = Math.pow(10, precision + 2);
|
|
128
|
-
let
|
|
129
|
-
let cpmTarget
|
|
134
|
+
let cpmToRound = ((cpm * pow) - (bucketMin * pow)) / (increment * pow);
|
|
135
|
+
let cpmTarget;
|
|
136
|
+
let invalidRounding;
|
|
137
|
+
// It is likely that we will be passed {cpmRoundingFunction: roundingFunction()}
|
|
138
|
+
// rather than the expected {cpmRoundingFunction: roundingFunction}. Default back to floor in that case
|
|
139
|
+
try {
|
|
140
|
+
cpmTarget = (roundingFunction(cpmToRound) * increment) + bucketMin;
|
|
141
|
+
} catch (err) {
|
|
142
|
+
invalidRounding = true;
|
|
143
|
+
}
|
|
144
|
+
if (invalidRounding || typeof cpmTarget !== 'number') {
|
|
145
|
+
logWarn('Invalid rounding function passed in config');
|
|
146
|
+
cpmTarget = (Math.floor(cpmToRound) * increment) + bucketMin;
|
|
147
|
+
}
|
|
130
148
|
// force to 10 decimal places to deal with imprecise decimal/binary conversions
|
|
131
149
|
// (for example 0.1 * 3 = 0.30000000000000004)
|
|
150
|
+
|
|
132
151
|
cpmTarget = Number(cpmTarget.toFixed(10));
|
|
133
152
|
return cpmTarget.toFixed(precision);
|
|
134
153
|
}
|
package/src/native.js
CHANGED
|
@@ -449,11 +449,7 @@ export function getAllAssetsMessage(data, adObject, {getNativeReq = getNativeReq
|
|
|
449
449
|
* appropriate for sending in adserver targeting or placeholder replacement.
|
|
450
450
|
*/
|
|
451
451
|
function getAssetValue(value) {
|
|
452
|
-
|
|
453
|
-
return value.url;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
return value;
|
|
452
|
+
return value?.url || value;
|
|
457
453
|
}
|
|
458
454
|
|
|
459
455
|
function getNativeKeys(adUnit) {
|
package/src/prebid.js
CHANGED
|
@@ -662,10 +662,10 @@ export const startAuction = hook('async', function ({ bidsBackHandler, timeout:
|
|
|
662
662
|
|
|
663
663
|
const bidders = allBidders.filter(bidder => !s2sBidders.has(bidder));
|
|
664
664
|
|
|
665
|
-
adUnit.
|
|
666
|
-
|
|
665
|
+
const tid = adUnit.ortb2Imp?.ext?.tid || generateUUID();
|
|
666
|
+
adUnit.transactionId = tid;
|
|
667
667
|
// Populate ortb2Imp.ext.tid with transactionId. Specifying a transaction ID per item in the ortb impression array, lets multiple transaction IDs be transmitted in a single bid request.
|
|
668
|
-
deepSetValue(adUnit, 'ortb2Imp.ext.tid',
|
|
668
|
+
deepSetValue(adUnit, 'ortb2Imp.ext.tid', tid);
|
|
669
669
|
|
|
670
670
|
bidders.forEach(bidder => {
|
|
671
671
|
const adapter = bidderRegistry[bidder];
|