prebid.js 7.44.0 → 7.45.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/33acrossIdSystem.js +1 -1
- package/dist/acuityAdsBidAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.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/appushBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/beyondmediaBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/braveBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/brightcomBidAdapter.js +1 -1
- package/dist/brightcomSSPBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/coinzillaBidAdapter.js +1 -1
- package/dist/compassBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectIdSystem.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/contentexchangeBidAdapter.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/dependencies.json +12 -0
- package/dist/domainOverrideToRootDomain.js +1 -0
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.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/globalsunBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/growthCodeIdSystem.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.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/iqzoneBidAdapter.js +1 -1
- package/dist/ivsBidAdapter.js +1 -0
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/jwplayerVideoProvider.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/koblerBidAdapter.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/liveIntentIdSystem.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/luponmediaBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mathildeadsBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/medianetBidAdapter.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 +158 -156
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/onomagicBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxBidAdapter.js +1 -1
- package/dist/openxOrtbBidAdapter.js +1 -1
- package/dist/operaadsBidAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.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/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubxBidAdapter.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/sharedIdSystem.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/smarthubBidAdapter.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/truereachBidAdapter.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/userId.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/videoheroesBidAdapter.js +1 -1
- package/dist/vidoomyBidAdapter.js +1 -1
- package/dist/visiblemeasuresBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vrtcalBidAdapter.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/dist/yieldoneBidAdapter.js +1 -1
- package/libraries/domainOverrideToRootDomain/index.js +39 -0
- package/modules/acuityAdsBidAdapter.js +1 -1
- package/modules/amxBidAdapter.js +1 -1
- package/modules/amxIdSystem.js +23 -20
- package/modules/amxIdSystem.md +7 -7
- package/modules/appushBidAdapter.js +1 -1
- package/modules/beyondmediaBidAdapter.js +1 -1
- package/modules/braveBidAdapter.js +1 -1
- package/modules/brightcomBidAdapter.js +1 -1
- package/modules/brightcomSSPBidAdapter.js +1 -1
- package/modules/coinzillaBidAdapter.js +1 -2
- package/modules/compassBidAdapter.js +1 -1
- package/modules/connectIdSystem.js +96 -21
- package/modules/connectIdSystem.md +6 -5
- package/modules/contentexchangeBidAdapter.js +1 -1
- package/modules/freewheel-sspBidAdapter.js +8 -0
- package/modules/glimpseBidAdapter.js +1 -2
- package/modules/globalsunBidAdapter.js +1 -1
- package/modules/gridBidAdapter.js +1 -1
- package/modules/gridNMBidAdapter.js +1 -1
- package/modules/growthCodeIdSystem.js +18 -15
- package/modules/gumgumBidAdapter.js +1 -1
- package/modules/iqzoneBidAdapter.js +1 -1
- package/modules/ivsBidAdapter.js +85 -0
- package/modules/ivsBidAdapter.md +34 -0
- package/modules/ixBidAdapter.js +42 -105
- package/modules/jwplayerVideoProvider.js +25 -32
- package/modules/koblerBidAdapter.js +1 -2
- package/modules/kueezBidAdapter.js +1 -1
- package/modules/liveIntentIdSystem.js +8 -0
- package/modules/luponmediaBidAdapter.js +1 -1
- package/modules/magniteAnalyticsAdapter.js +76 -3
- package/modules/mathildeadsBidAdapter.js +1 -1
- package/modules/medianetBidAdapter.js +1 -1
- package/modules/mgidBidAdapter.js +178 -26
- package/modules/minutemediaBidAdapter.js +1 -1
- package/modules/oguryBidAdapter.js +3 -2
- package/modules/onomagicBidAdapter.js +1 -2
- package/modules/openxBidAdapter.js +192 -563
- package/modules/openxBidAdapter.md +22 -20
- package/modules/openxOrtbBidAdapter.js +13 -11
- package/modules/openxOrtbBidAdapter.md +5 -3
- package/modules/operaadsBidAdapter.js +1 -1
- package/modules/pubmaticBidAdapter.js +1 -1
- package/modules/pubxBidAdapter.js +5 -2
- package/modules/riseBidAdapter.js +1 -1
- package/modules/sharedIdSystem.js +4 -27
- package/modules/sharethroughBidAdapter.js +1 -1
- package/modules/shinezBidAdapter.js +1 -1
- package/modules/smarthubBidAdapter.js +1 -1
- package/modules/synacormediaBidAdapter.js +1 -3
- package/modules/truereachBidAdapter.js +1 -2
- package/modules/userId/eids.js +18 -0
- package/modules/userId/eids.md +16 -0
- package/modules/videoheroesBidAdapter.js +1 -1
- package/modules/vidoomyBidAdapter.js +22 -1
- package/modules/visiblemeasuresBidAdapter.js +1 -1
- package/modules/vrtcalBidAdapter.js +1 -1
- package/modules/yieldoneBidAdapter.js +1 -1
- package/package.json +1 -1
- package/src/Renderer.js +2 -1
- package/src/native.js +5 -1
- package/test/spec/auctionmanager_spec.js +2 -2
- package/test/spec/libraries/domainOverrideToRootDomain/index_spec.js +77 -0
- package/test/spec/modules/acuityAdsBidAdapter_spec.js +2 -1
- package/test/spec/modules/amxIdSystem_spec.js +13 -26
- package/test/spec/modules/appushBidAdapter_spec.js +2 -1
- package/test/spec/modules/beyondmediaBidAdapter_spec.js +2 -1
- package/test/spec/modules/compassBidAdapter_spec.js +2 -1
- package/test/spec/modules/connectIdSystem_spec.js +420 -242
- package/test/spec/modules/contentexchangeBidAdapter_spec.js +2 -1
- package/test/spec/modules/eids_spec.js +30 -0
- package/test/spec/modules/freewheel-sspBidAdapter_spec.js +37 -0
- package/test/spec/modules/globalsunBidAdapter_spec.js +2 -1
- package/test/spec/modules/iqzoneBidAdapter_spec.js +2 -1
- package/test/spec/modules/ivsBidAdapter_spec.js +197 -0
- package/test/spec/modules/ixBidAdapter_spec.js +84 -71
- package/test/spec/modules/koblerBidAdapter_spec.js +0 -20
- package/test/spec/modules/liveIntentIdSystem_spec.js +10 -0
- package/test/spec/modules/luponmediaBidAdapter_spec.js +1 -1
- package/test/spec/modules/magniteAnalyticsAdapter_spec.js +129 -1
- package/test/spec/modules/mathildeadsBidAdapter_spec.js +2 -1
- package/test/spec/modules/mgidBidAdapter_spec.js +184 -36
- package/test/spec/modules/oguryBidAdapter_spec.js +19 -4
- package/test/spec/modules/openxBidAdapter_spec.js +1157 -1936
- package/test/spec/modules/openxOrtbBidAdapter_spec.js +12 -39
- package/test/spec/modules/pubxBidAdapter_spec.js +10 -2
- package/test/spec/modules/sharedIdSystem_spec.js +0 -46
- package/test/spec/modules/sharethroughBidAdapter_spec.js +2 -1
- package/test/spec/modules/smarthubBidAdapter_spec.js +2 -1
- package/test/spec/modules/synacormediaBidAdapter_spec.js +0 -26
- package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +17 -4
- package/test/spec/modules/vidoomyBidAdapter_spec.js +35 -0
- package/test/spec/modules/visiblemeasuresBidAdapter_spec.js +2 -1
- package/test/spec/modules/vrtcalBidAdapter_spec.js +3 -2
- package/test/spec/renderer_spec.js +1 -2
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
_each,
|
|
3
|
+
deepAccess,
|
|
4
|
+
isPlainObject,
|
|
5
|
+
isArray,
|
|
6
|
+
isStr,
|
|
7
|
+
logInfo,
|
|
8
|
+
parseUrl,
|
|
9
|
+
isEmpty,
|
|
10
|
+
triggerPixel,
|
|
11
|
+
logWarn,
|
|
12
|
+
getBidIdParameter,
|
|
13
|
+
isFn,
|
|
14
|
+
isNumber,
|
|
15
|
+
isBoolean,
|
|
16
|
+
isInteger, deepSetValue,
|
|
17
|
+
} from '../src/utils.js';
|
|
2
18
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
3
19
|
import {BANNER, NATIVE} from '../src/mediaTypes.js';
|
|
4
20
|
import {config} from '../src/config.js';
|
|
5
21
|
import { getStorageManager } from '../src/storageManager.js';
|
|
6
22
|
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
|
|
23
|
+
import {USERSYNC_DEFAULT_CONFIG} from '../src/userSync.js';
|
|
7
24
|
|
|
8
25
|
const GVLID = 358;
|
|
9
26
|
const DEFAULT_CUR = 'USD';
|
|
@@ -64,7 +81,7 @@ _each(NATIVE_ASSETS, anAsset => { _NATIVE_ASSET_ID_TO_KEY_MAP[anAsset.ID] = anAs
|
|
|
64
81
|
_each(NATIVE_ASSETS, anAsset => { _NATIVE_ASSET_KEY_TO_ASSET_MAP[anAsset.KEY] = anAsset });
|
|
65
82
|
|
|
66
83
|
export const spec = {
|
|
67
|
-
VERSION: '1.
|
|
84
|
+
VERSION: '1.6',
|
|
68
85
|
code: BIDDER_CODE,
|
|
69
86
|
gvlid: GVLID,
|
|
70
87
|
supportedMediaTypes: [BANNER, NATIVE],
|
|
@@ -115,22 +132,19 @@ export const spec = {
|
|
|
115
132
|
/**
|
|
116
133
|
* Make a server request from the list of BidRequests.
|
|
117
134
|
*
|
|
118
|
-
* @param {
|
|
135
|
+
* @param {BidRequest[]} validBidRequests A non-empty list of bid requests which should be sent to the Server.
|
|
136
|
+
* @param bidderRequest
|
|
119
137
|
* @return ServerRequest Info describing the request to the server.
|
|
120
138
|
*/
|
|
121
139
|
buildRequests: (validBidRequests, bidderRequest) => {
|
|
122
140
|
// convert Native ORTB definition to old-style prebid native definition
|
|
123
141
|
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
|
|
124
|
-
|
|
142
|
+
const [bidRequest] = validBidRequests;
|
|
125
143
|
logInfo(LOG_INFO_PREFIX + `buildRequests`);
|
|
126
144
|
if (validBidRequests.length === 0) {
|
|
127
145
|
return;
|
|
128
146
|
}
|
|
129
147
|
const info = pageInfo();
|
|
130
|
-
// TODO: the fallback seems to never be used here, and probably in the wrong order
|
|
131
|
-
const page = info.location || deepAccess(bidderRequest, 'refererInfo.page')
|
|
132
|
-
const hostname = parseUrl(page).hostname;
|
|
133
|
-
let domain = extractDomainFromHost(hostname) || hostname;
|
|
134
148
|
const accountId = setOnAny(validBidRequests, 'params.accountId');
|
|
135
149
|
const muid = getLocalStorageSafely('mgMuidn');
|
|
136
150
|
let url = (setOnAny(validBidRequests, 'params.bidUrl') || ENDPOINT_URL) + accountId;
|
|
@@ -182,31 +196,108 @@ export const spec = {
|
|
|
182
196
|
|
|
183
197
|
let request = {
|
|
184
198
|
id: deepAccess(bidderRequest, 'bidderRequestId'),
|
|
185
|
-
site: {
|
|
199
|
+
site: ortb2Data?.site || {},
|
|
186
200
|
cur: [cur],
|
|
187
201
|
geo: {utcoffset: info.timeOffset},
|
|
188
|
-
device: {
|
|
189
|
-
ua: navigator.userAgent,
|
|
190
|
-
js: 1,
|
|
191
|
-
dnt: (navigator.doNotTrack === 'yes' || navigator.doNotTrack === '1' || navigator.msDoNotTrack === '1') ? 1 : 0,
|
|
192
|
-
h: screen.height,
|
|
193
|
-
w: screen.width,
|
|
194
|
-
language: getLanguage()
|
|
195
|
-
},
|
|
202
|
+
device: ortb2Data?.device || {},
|
|
196
203
|
ext: {
|
|
197
204
|
mgid_ver: spec.VERSION,
|
|
198
205
|
prebid_ver: '$prebid.version$',
|
|
199
|
-
...ortb2Data
|
|
200
206
|
},
|
|
201
|
-
imp
|
|
207
|
+
imp,
|
|
208
|
+
tmax: bidderRequest?.timeout || config.getConfig('bidderTimeout') || 500,
|
|
202
209
|
};
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
210
|
+
// request level
|
|
211
|
+
const bcat = ortb2Data?.bcat || bidRequest?.params?.bcat || [];
|
|
212
|
+
const badv = ortb2Data?.badv || bidRequest?.params?.badv || [];
|
|
213
|
+
const wlang = ortb2Data?.wlang || bidRequest?.params?.wlang || [];
|
|
214
|
+
if (bcat.length > 0) {
|
|
215
|
+
request.bcat = bcat;
|
|
216
|
+
}
|
|
217
|
+
if (badv.length > 0) {
|
|
218
|
+
request.badv = badv;
|
|
219
|
+
}
|
|
220
|
+
if (wlang.length > 0) {
|
|
221
|
+
request.wlang = wlang;
|
|
222
|
+
}
|
|
223
|
+
// site level
|
|
224
|
+
const page = deepAccess(bidderRequest, 'refererInfo.page') || info.location
|
|
225
|
+
if (!isStr(deepAccess(request.site, 'domain'))) {
|
|
226
|
+
const hostname = parseUrl(page).hostname;
|
|
227
|
+
request.site.domain = extractDomainFromHost(hostname) || hostname
|
|
228
|
+
}
|
|
229
|
+
if (!isStr(deepAccess(request.site, 'page'))) {
|
|
230
|
+
request.site.page = page
|
|
231
|
+
}
|
|
232
|
+
if (!isStr(deepAccess(request.site, 'ref'))) {
|
|
233
|
+
const ref = deepAccess(bidderRequest, 'refererInfo.ref') || info.referrer;
|
|
234
|
+
if (ref) {
|
|
235
|
+
request.site.ref = ref
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
// device level
|
|
239
|
+
if (!isStr(deepAccess(request.device, 'ua'))) {
|
|
240
|
+
request.device.ua = navigator.userAgent;
|
|
241
|
+
}
|
|
242
|
+
request.device.js = 1;
|
|
243
|
+
if (!isInteger(deepAccess(request.device, 'dnt'))) {
|
|
244
|
+
request.device.dnt = (navigator?.doNotTrack === 'yes' || navigator?.doNotTrack === '1' || navigator?.msDoNotTrack === '1') ? 1 : 0;
|
|
245
|
+
}
|
|
246
|
+
if (!isInteger(deepAccess(request.device, 'h'))) {
|
|
247
|
+
request.device.h = screen.height;
|
|
206
248
|
}
|
|
207
|
-
if (
|
|
208
|
-
request.
|
|
249
|
+
if (!isInteger(deepAccess(request.device, 'w'))) {
|
|
250
|
+
request.device.w = screen.width;
|
|
251
|
+
}
|
|
252
|
+
if (!isStr(deepAccess(request.device, 'language'))) {
|
|
253
|
+
request.device.language = getLanguage();
|
|
254
|
+
}
|
|
255
|
+
// user & regs & privacy
|
|
256
|
+
if (isPlainObject(ortb2Data?.user)) {
|
|
257
|
+
request.user = ortb2Data.user;
|
|
258
|
+
}
|
|
259
|
+
if (isPlainObject(ortb2Data?.regs)) {
|
|
260
|
+
request.regs = ortb2Data.regs;
|
|
261
|
+
}
|
|
262
|
+
if (bidderRequest && isPlainObject(bidderRequest.gdprConsent)) {
|
|
263
|
+
if (!isStr(deepAccess(request.user, 'ext.consent'))) {
|
|
264
|
+
deepSetValue(request, 'user.ext.consent', bidderRequest.gdprConsent?.consentString);
|
|
265
|
+
}
|
|
266
|
+
if (!isBoolean(deepAccess(request.regs, 'ext.gdpr'))) {
|
|
267
|
+
deepSetValue(request, 'regs.ext.gdpr', bidderRequest.gdprConsent?.gdprApplies ? 1 : 0);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
const userId = deepAccess(bidderRequest, 'userId')
|
|
271
|
+
if (isStr(userId)) {
|
|
272
|
+
deepSetValue(request, 'user.id', userId);
|
|
273
|
+
}
|
|
274
|
+
const eids = setOnAny(validBidRequests, 'userIdAsEids')
|
|
275
|
+
if (eids && eids.length > 0) {
|
|
276
|
+
deepSetValue(request, 'user.ext.eids', eids);
|
|
277
|
+
}
|
|
278
|
+
if (bidderRequest && isStr(bidderRequest.uspConsent)) {
|
|
279
|
+
if (!isBoolean(deepAccess(request.regs, 'ext.us_privacy'))) {
|
|
280
|
+
deepSetValue(request, 'regs.ext.us_privacy', bidderRequest.uspConsent);
|
|
281
|
+
}
|
|
209
282
|
}
|
|
283
|
+
if (bidderRequest && isPlainObject(bidderRequest.gppConsent)) {
|
|
284
|
+
if (!isStr(deepAccess(request.regs, 'gpp'))) {
|
|
285
|
+
deepSetValue(request, 'regs.gpp', bidderRequest.gppConsent?.gppString);
|
|
286
|
+
}
|
|
287
|
+
if (!isArray(deepAccess(request.regs, 'gpp_sid'))) {
|
|
288
|
+
deepSetValue(request, 'regs.gpp_sid', bidderRequest.gppConsent?.applicableSections);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (config.getConfig('coppa')) {
|
|
292
|
+
if (!isInteger(deepAccess(request.regs, 'coppa'))) {
|
|
293
|
+
deepSetValue(request, 'regs.coppa', 1);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
const schain = setOnAny(validBidRequests, 'schain');
|
|
297
|
+
if (schain) {
|
|
298
|
+
deepSetValue(request, 'source.ext.schain', schain);
|
|
299
|
+
}
|
|
300
|
+
|
|
210
301
|
logInfo(LOG_INFO_PREFIX + `buildRequest:`, request);
|
|
211
302
|
return {
|
|
212
303
|
method: 'POST',
|
|
@@ -218,6 +309,7 @@ export const spec = {
|
|
|
218
309
|
* Unpack the response from the server into a list of bids.
|
|
219
310
|
*
|
|
220
311
|
* @param {ServerResponse} serverResponse A successful response from the server.
|
|
312
|
+
* @param bidRequests
|
|
221
313
|
* @return {Bid[]} An array of bids which were nested inside the server.
|
|
222
314
|
*/
|
|
223
315
|
interpretResponse: (serverResponse, bidRequests) => {
|
|
@@ -268,8 +360,66 @@ export const spec = {
|
|
|
268
360
|
}
|
|
269
361
|
logInfo(LOG_INFO_PREFIX + `onBidWon`);
|
|
270
362
|
},
|
|
271
|
-
getUserSyncs: (syncOptions, serverResponses) => {
|
|
363
|
+
getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent, gppConsent) => {
|
|
272
364
|
logInfo(LOG_INFO_PREFIX + `getUserSyncs`);
|
|
365
|
+
const spb = isPlainObject(config.getConfig('userSync')) &&
|
|
366
|
+
isNumber(config.getConfig('userSync').syncsPerBidder)
|
|
367
|
+
? config.getConfig('userSync').syncsPerBidder : USERSYNC_DEFAULT_CONFIG.syncsPerBidder;
|
|
368
|
+
|
|
369
|
+
if (spb > 0 && isPlainObject(syncOptions) && (syncOptions.iframeEnabled || syncOptions.pixelEnabled)) {
|
|
370
|
+
let pixels = [];
|
|
371
|
+
if (serverResponses &&
|
|
372
|
+
isArray(serverResponses) &&
|
|
373
|
+
serverResponses.length > 0 &&
|
|
374
|
+
isPlainObject(serverResponses[0].body) &&
|
|
375
|
+
isPlainObject(serverResponses[0].body.ext) &&
|
|
376
|
+
isArray(serverResponses[0].body.ext.cm) &&
|
|
377
|
+
serverResponses[0].body.ext.cm.length > 0) {
|
|
378
|
+
pixels = serverResponses[0].body.ext.cm;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
const syncs = [];
|
|
382
|
+
const query = [];
|
|
383
|
+
query.push('cbuster=' + Math.round(new Date().getTime()));
|
|
384
|
+
query.push('consentData=' + encodeURIComponent(isPlainObject(gdprConsent) && isStr(gdprConsent?.consentString) ? gdprConsent.consentString : ''));
|
|
385
|
+
if (isPlainObject(gdprConsent) && typeof gdprConsent?.gdprApplies === 'boolean' && gdprConsent.gdprApplies) {
|
|
386
|
+
query.push('gdprApplies=1');
|
|
387
|
+
} else {
|
|
388
|
+
query.push('gdprApplies=0');
|
|
389
|
+
}
|
|
390
|
+
if (isPlainObject(uspConsent) && uspConsent?.consentString) {
|
|
391
|
+
query.push(`uspString=${encodeURIComponent(uspConsent?.consentString)}`);
|
|
392
|
+
}
|
|
393
|
+
if (isPlainObject(gppConsent) && gppConsent?.gppString) {
|
|
394
|
+
query.push(`gppString=${encodeURIComponent(gppConsent?.gppString)}`);
|
|
395
|
+
}
|
|
396
|
+
if (config.getConfig('coppa')) {
|
|
397
|
+
query.push('coppa=1')
|
|
398
|
+
}
|
|
399
|
+
if (syncOptions.iframeEnabled) {
|
|
400
|
+
syncs.push({
|
|
401
|
+
type: 'iframe',
|
|
402
|
+
url: 'https://cm.mgid.com/i.html?' + query.join('&')
|
|
403
|
+
});
|
|
404
|
+
} else if (syncOptions.pixelEnabled) {
|
|
405
|
+
if (pixels.length === 0) {
|
|
406
|
+
for (let i = 0; i < spb; i++) {
|
|
407
|
+
syncs.push({
|
|
408
|
+
type: 'image',
|
|
409
|
+
url: 'https://cm.mgid.com/i.gif?' + query.join('&') // randomly selects partner if sync required
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
} else {
|
|
413
|
+
for (let i = 0; i < spb && i < pixels.length; i++) {
|
|
414
|
+
syncs.push({
|
|
415
|
+
type: 'image',
|
|
416
|
+
url: pixels[i] + (pixels[i].indexOf('?') > 0 ? '&' : '?') + query.join('&')
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
return syncs;
|
|
422
|
+
}
|
|
273
423
|
}
|
|
274
424
|
};
|
|
275
425
|
|
|
@@ -287,6 +437,7 @@ function setOnAny(collection, key) {
|
|
|
287
437
|
/**
|
|
288
438
|
* Unpack the Server's Bid into a Prebid-compatible one.
|
|
289
439
|
* @param serverBid
|
|
440
|
+
* @param cur
|
|
290
441
|
* @return Bid
|
|
291
442
|
*/
|
|
292
443
|
function prebidBid(serverBid, cur) {
|
|
@@ -330,7 +481,7 @@ function setMediaType(bid, newBid) {
|
|
|
330
481
|
}
|
|
331
482
|
|
|
332
483
|
function extractDomainFromHost(pageHost) {
|
|
333
|
-
if (pageHost
|
|
484
|
+
if (pageHost === 'localhost') {
|
|
334
485
|
return 'localhost'
|
|
335
486
|
}
|
|
336
487
|
let domain = null;
|
|
@@ -600,6 +751,7 @@ function pageInfo() {
|
|
|
600
751
|
* Get the floor price from bid.params for backward compatibility.
|
|
601
752
|
* If not found, then check floor module.
|
|
602
753
|
* @param bid A valid bid object
|
|
754
|
+
* @param cur
|
|
603
755
|
* @returns {*|number} floor price
|
|
604
756
|
*/
|
|
605
757
|
function getBidFloor(bid, cur) {
|
|
@@ -366,7 +366,7 @@ function generateGeneralParams(generalObject, bidderRequest) {
|
|
|
366
366
|
const {syncEnabled, filterSettings} = config.getConfig('userSync') || {};
|
|
367
367
|
const {bidderCode} = bidderRequest;
|
|
368
368
|
const generalBidParams = generalObject.params;
|
|
369
|
-
const timeout =
|
|
369
|
+
const timeout = bidderRequest.timeout;
|
|
370
370
|
|
|
371
371
|
// these params are snake_case instead of camelCase to allow backwards compatability on the server.
|
|
372
372
|
// in the future, these will be converted to camelCase to match our convention.
|
|
@@ -11,7 +11,7 @@ const DEFAULT_TIMEOUT = 1000;
|
|
|
11
11
|
const BID_HOST = 'https://mweb-hb.presage.io/api/header-bidding-request';
|
|
12
12
|
const TIMEOUT_MONITORING_HOST = 'https://ms-ads-monitoring-events.presage.io';
|
|
13
13
|
const MS_COOKIE_SYNC_DOMAIN = 'https://ms-cookie-sync.presage.io';
|
|
14
|
-
const ADAPTER_VERSION = '1.4.
|
|
14
|
+
const ADAPTER_VERSION = '1.4.1';
|
|
15
15
|
|
|
16
16
|
function getClientWidth() {
|
|
17
17
|
const documentElementClientWidth = window.top.document.documentElement.clientWidth
|
|
@@ -90,7 +90,8 @@ function buildRequests(validBidRequests, bidderRequest) {
|
|
|
90
90
|
},
|
|
91
91
|
device: {
|
|
92
92
|
w: getClientWidth(),
|
|
93
|
-
h: getClientHeight()
|
|
93
|
+
h: getClientHeight(),
|
|
94
|
+
pxratio: window.devicePixelRatio
|
|
94
95
|
}
|
|
95
96
|
};
|
|
96
97
|
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
} from '../src/utils.js';
|
|
14
14
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
15
15
|
import {BANNER} from '../src/mediaTypes.js';
|
|
16
|
-
import {config} from '../src/config.js';
|
|
17
16
|
|
|
18
17
|
const BIDDER_CODE = 'onomagic';
|
|
19
18
|
const URL = 'https://bidder.onomagic.com/hb';
|
|
@@ -80,7 +79,7 @@ function buildRequests(bidReqs, bidderRequest) {
|
|
|
80
79
|
w: screen.width,
|
|
81
80
|
h: screen.height
|
|
82
81
|
},
|
|
83
|
-
tmax:
|
|
82
|
+
tmax: bidderRequest?.timeout
|
|
84
83
|
};
|
|
85
84
|
|
|
86
85
|
return {
|