prebid.js 9.0.0 → 9.2.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/.nvmrc +1 -1
- package/browsers.json +3 -3
- package/dist/33acrossAnalyticsAdapter.js +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/BTBidAdapter.js +1 -1
- package/dist/acuityadsBidAdapter.js +1 -1
- package/dist/adagioAnalyticsAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adagioRtdProvider.js +1 -1
- package/dist/adagioUtils.js +1 -0
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/admanBidAdapter.js +1 -1
- package/dist/adpod.js +1 -1
- package/dist/adprimeBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adstirBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/agmaAnalyticsAdapter.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/appnexusUtils.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/autoplayDetection.js +1 -1
- package/dist/axisBidAdapter.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/bliinkBidAdapter.js +1 -1
- package/dist/boldwinBidAdapter.js +1 -1
- package/dist/bridBidAdapter.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/chunk-core.js +1 -1
- package/dist/compassBidAdapter.js +1 -1
- package/dist/concertBidAdapter.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/dailymotionBidAdapter.js +1 -1
- package/dist/dependencies.json +83 -4
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/dxkultureBidAdapter.js +1 -1
- package/dist/e_volutionBidAdapter.js +1 -1
- package/dist/emtvBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/exadsBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.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/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/illuminBidAdapter.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/iqzoneBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/kimberliteBidAdapter.js +1 -1
- package/dist/kiviadsBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/krushmediaBidAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/loyalBidAdapter.js +1 -1
- package/dist/luceadBidAdapter.js +1 -1
- package/dist/lunamediahbBidAdapter.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/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/mgidXBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/missenaBidAdapter.js +1 -1
- package/dist/mobfoxpbBidAdapter.js +1 -1
- package/dist/mobianRtdProvider.js +1 -0
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/nobidAnalyticsAdapter.js +1 -1
- package/dist/nobidBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +190 -186
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openwebBidAdapter.js +1 -1
- package/dist/openxBidAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/ortbConverter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/ozoneBidAdapter.js +1 -1
- package/dist/paapi.js +1 -1
- package/dist/pgamsspBidAdapter.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/playdigoBidAdapter.js +1 -1
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/pubCircleBidAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/publirBidAdapter.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubxaiAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/qtBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/raynRtdProvider.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/richaudienceBidAdapter.js +1 -0
- package/dist/ringieraxelspringerBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/setupadBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/shinezRtbBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smartytechBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stnBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/tagorasBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/teqblazeUtils.js +1 -0
- package/dist/themoneytizerBidAdapter.js +1 -1
- package/dist/topicsFpdModule.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/twistDigitalBidAdapter.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/unrulyBidAdapter.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visiblemeasuresBidAdapter.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/yahooAdsBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspAnalyticsAdapter.js +1 -1
- package/integrationExamples/gpt/raynRtdProvider_example.html +1 -0
- package/libraries/adagioUtils/adagioUtils.js +35 -0
- package/libraries/appnexusUtils/anUtils.js +1 -0
- package/libraries/autoplayDetection/autoplay.js +8 -1
- package/libraries/ortbConverter/converter.js +1 -1
- package/libraries/teqblazeUtils/bidderUtils.js +253 -0
- package/modules/.submodules.json +1 -0
- package/modules/acuityadsBidAdapter.js +5 -203
- package/modules/adagioBidAdapter.js +1 -17
- package/modules/adagioRtdProvider.js +41 -51
- package/modules/adagioRtdProvider.md +1 -0
- package/modules/admanBidAdapter.js +31 -188
- package/modules/adprimeBidAdapter.js +28 -165
- package/modules/axisBidAdapter.js +33 -165
- package/modules/beyondmediaBidAdapter.js +5 -189
- package/modules/bliinkBidAdapter.js +3 -31
- package/modules/boldwinBidAdapter.js +21 -159
- package/modules/ceeIdSystem.js +1 -1
- package/modules/compassBidAdapter.js +5 -198
- package/modules/contentexchangeBidAdapter.js +5 -200
- package/modules/conversantBidAdapter.js +1 -0
- package/modules/dailymotionBidAdapter.js +1 -1
- package/modules/e_volutionBidAdapter.js +4 -186
- package/modules/emtvBidAdapter.js +5 -198
- package/modules/globalsunBidAdapter.js +5 -199
- package/modules/id5IdSystem.js +31 -2
- package/modules/id5IdSystem.md +67 -2
- package/modules/iqzoneBidAdapter.js +5 -224
- package/modules/kiviadsBidAdapter.js +5 -199
- package/modules/krushmediaBidAdapter.js +25 -143
- package/modules/loyalBidAdapter.js +4 -178
- package/modules/lunamediahbBidAdapter.js +5 -118
- package/modules/mathildeadsBidAdapter.js +5 -198
- package/modules/mgidXBidAdapter.js +14 -209
- package/modules/mobfoxpbBidAdapter.js +4 -135
- package/modules/mobianRtdProvider.js +52 -0
- package/modules/mobianRtdProvider.md +11 -0
- package/modules/nobidAnalyticsAdapter.js +2 -3
- package/modules/novatiqIdSystem.md +2 -3
- package/modules/ozoneBidAdapter.js +117 -58
- package/modules/paapi.js +2 -1
- package/modules/pgamsspBidAdapter.js +5 -240
- package/modules/playdigoBidAdapter.js +4 -186
- package/modules/prebidServerBidAdapter/index.js +9 -2
- package/modules/pubCircleBidAdapter.js +5 -218
- package/modules/pubmaticAnalyticsAdapter.js +21 -8
- package/modules/pubxaiAnalyticsAdapter.js +1 -5
- package/modules/qtBidAdapter.js +5 -224
- package/modules/raynRtdProvider.js +36 -3
- package/modules/richaudienceBidAdapter.js +375 -0
- package/modules/richaudienceBidAdapter.md +1 -1
- package/modules/seedtagBidAdapter.js +1 -0
- package/modules/setupadBidAdapter.js +76 -153
- package/modules/setupadBidAdapter.md +1 -1
- package/modules/smaatoBidAdapter.js +17 -6
- package/modules/smartytechBidAdapter.js +7 -2
- package/modules/topicsFpdModule.js +1 -1
- package/modules/uid2IdSystem.js +0 -1
- package/modules/uid2IdSystem_shared.js +0 -1
- package/modules/visiblemeasuresBidAdapter.js +5 -199
- package/modules/zeta_global_sspAnalyticsAdapter.js +8 -4
- package/package.json +1 -1
- package/src/auction.js +5 -63
- package/src/utils/focusTimeout.js +41 -0
- package/src/utils/ttlCollection.js +2 -1
- package/src/utils.js +42 -0
- package/src/videoCache.js +72 -0
- package/test/mocks/videoCacheStub.js +1 -1
- package/test/spec/auctionmanager_spec.js +16 -1
- package/test/spec/libraries/teqblazeUtils/bidderUtils_spec.js +519 -0
- package/test/spec/modules/acuityadsBidAdapter_spec.js +79 -43
- package/test/spec/modules/adagioRtdProvider_spec.js +62 -1
- package/test/spec/modules/admanBidAdapter_spec.js +370 -247
- package/test/spec/modules/adprimeBidAdapter_spec.js +225 -78
- package/test/spec/modules/axisBidAdapter_spec.js +78 -14
- package/test/spec/modules/beyondmediaBidAdapter_spec.js +80 -18
- package/test/spec/modules/bliinkBidAdapter_spec.js +8 -2
- package/test/spec/modules/boldwinBidAdapter_spec.js +221 -75
- package/test/spec/modules/compassBidAdapter_spec.js +130 -16
- package/test/spec/modules/contentexchangeBidAdapter_spec.js +134 -21
- package/test/spec/modules/conversantBidAdapter_spec.js +7 -0
- package/test/spec/modules/dailymotionBidAdapter_spec.js +3 -3
- package/test/spec/modules/e_volutionBidAdapter_spec.js +65 -3
- package/test/spec/modules/emtvBidAdapter_spec.js +131 -16
- package/test/spec/modules/globalsunBidAdapter_spec.js +130 -16
- package/test/spec/modules/id5IdSystem_spec.js +79 -3
- package/test/spec/modules/iqzoneBidAdapter_spec.js +66 -12
- package/test/spec/modules/kiviadsBidAdapter_spec.js +131 -20
- package/test/spec/modules/krushmediaBidAdapter_spec.js +272 -90
- package/test/spec/modules/loyalBidAdapter_spec.js +114 -14
- package/test/spec/modules/lunamediahbBidAdapter_spec.js +221 -87
- package/test/spec/modules/mathildeadsBidAdapter_spec.js +87 -18
- package/test/spec/modules/mgidXBidAdapter_spec.js +11 -3
- package/test/spec/modules/mobfoxpbBidAdapter_spec.js +229 -91
- package/test/spec/modules/mobianRtdProvider_spec.js +107 -0
- package/test/spec/modules/ozoneBidAdapter_spec.js +192 -22
- package/test/spec/modules/paapi_spec.js +5 -5
- package/test/spec/modules/pgamsspBidAdapter_spec.js +83 -16
- package/test/spec/modules/playdigoBidAdapter_spec.js +38 -9
- package/test/spec/modules/prebidServerBidAdapter_spec.js +14 -0
- package/test/spec/modules/pubCircleBidAdapter_spec.js +82 -17
- package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +52 -5
- package/test/spec/modules/qtBidAdapter_spec.js +15 -3
- package/test/spec/modules/raynRtdProvider_spec.js +25 -0
- package/test/spec/modules/richaudienceBidAdapter_spec.js +1304 -0
- package/test/spec/modules/seedtagBidAdapter_spec.js +2 -0
- package/test/spec/modules/setupadBidAdapter_spec.js +139 -97
- package/test/spec/modules/smaatoBidAdapter_spec.js +27 -0
- package/test/spec/modules/smartytechBidAdapter_spec.js +5 -1
- package/test/spec/modules/topicsFpdModule_spec.js +43 -59
- package/test/spec/modules/visiblemeasuresBidAdapter_spec.js +130 -16
- package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +4 -0
- package/test/spec/ortbConverter/converter_spec.js +7 -3
- package/test/spec/unit/utils/focusTimeout_spec.js +60 -0
- package/test/spec/videoCache_spec.js +56 -53
|
@@ -15,6 +15,8 @@ import {
|
|
|
15
15
|
deepAccess,
|
|
16
16
|
deepSetValue,
|
|
17
17
|
generateUUID,
|
|
18
|
+
getDomLoadingDuration,
|
|
19
|
+
getSafeframeGeometry,
|
|
18
20
|
getUniqueIdentifierStr,
|
|
19
21
|
getWindowSelf,
|
|
20
22
|
getWindowTop,
|
|
@@ -24,6 +26,7 @@ import {
|
|
|
24
26
|
isStr,
|
|
25
27
|
prefixLog
|
|
26
28
|
} from '../src/utils.js';
|
|
29
|
+
import { _ADAGIO, getBestWindowForAdagio } from '../libraries/adagioUtils/adagioUtils.js';
|
|
27
30
|
import { getGptSlotInfoForAdUnitCode } from '../libraries/gptUtils/gptUtils.js';
|
|
28
31
|
|
|
29
32
|
/**
|
|
@@ -35,6 +38,11 @@ const ADAGIO_BIDDER_CODE = 'adagio';
|
|
|
35
38
|
const GVLID = 617;
|
|
36
39
|
const SCRIPT_URL = 'https://script.4dex.io/a/latest/adagio.js';
|
|
37
40
|
const SESS_DURATION = 30 * 60 * 1000;
|
|
41
|
+
export const PLACEMENT_SOURCES = {
|
|
42
|
+
ORTB: 'ortb', // implicit default, not used atm.
|
|
43
|
+
ADUNITCODE: 'code',
|
|
44
|
+
GPID: 'gpid'
|
|
45
|
+
};
|
|
38
46
|
export const storage = getStorageManager({ moduleType: MODULE_TYPE_RTD, moduleName: SUBMODULE_NAME });
|
|
39
47
|
|
|
40
48
|
const { logError, logWarn } = prefixLog('AdagioRtdProvider:');
|
|
@@ -42,23 +50,6 @@ const { logError, logWarn } = prefixLog('AdagioRtdProvider:');
|
|
|
42
50
|
// Guard to avoid storing the same bid data several times.
|
|
43
51
|
const guard = new Set();
|
|
44
52
|
|
|
45
|
-
/**
|
|
46
|
-
* Returns the window.ADAGIO global object used to store Adagio data.
|
|
47
|
-
* This object is created in window.top if possible, otherwise in window.self.
|
|
48
|
-
*/
|
|
49
|
-
const _ADAGIO = (function() {
|
|
50
|
-
const w = (canAccessWindowTop()) ? getWindowTop() : getWindowSelf();
|
|
51
|
-
|
|
52
|
-
w.ADAGIO = w.ADAGIO || {};
|
|
53
|
-
w.ADAGIO.pageviewId = w.ADAGIO.pageviewId || generateUUID();
|
|
54
|
-
w.ADAGIO.adUnits = w.ADAGIO.adUnits || {};
|
|
55
|
-
w.ADAGIO.pbjsAdUnits = w.ADAGIO.pbjsAdUnits || [];
|
|
56
|
-
w.ADAGIO.queue = w.ADAGIO.queue || [];
|
|
57
|
-
w.ADAGIO.windows = w.ADAGIO.windows || [];
|
|
58
|
-
|
|
59
|
-
return w.ADAGIO;
|
|
60
|
-
})();
|
|
61
|
-
|
|
62
53
|
/**
|
|
63
54
|
* Store the sampling data.
|
|
64
55
|
* This data is used to determine if beacons should be sent to adagio.
|
|
@@ -131,12 +122,14 @@ const _FEATURES = (function() {
|
|
|
131
122
|
features.data = {};
|
|
132
123
|
},
|
|
133
124
|
get: function() {
|
|
125
|
+
const w = getBestWindowForAdagio();
|
|
126
|
+
|
|
134
127
|
if (!features.initialized) {
|
|
135
128
|
features.data = {
|
|
136
129
|
page_dimensions: getPageDimensions().toString(),
|
|
137
130
|
viewport_dimensions: getViewPortDimensions().toString(),
|
|
138
131
|
user_timestamp: getTimestampUTC().toString(),
|
|
139
|
-
dom_loading: getDomLoadingDuration().toString(),
|
|
132
|
+
dom_loading: getDomLoadingDuration(w).toString(),
|
|
140
133
|
};
|
|
141
134
|
features.initialized = true;
|
|
142
135
|
}
|
|
@@ -271,10 +264,12 @@ function onBidRequest(bidderRequest, config, _userConsent) {
|
|
|
271
264
|
* @param {*} config
|
|
272
265
|
*/
|
|
273
266
|
function onGetBidRequestData(bidReqConfig, callback, config) {
|
|
267
|
+
const configParams = deepAccess(config, 'params', {});
|
|
274
268
|
const { site: ortb2Site } = bidReqConfig.ortb2Fragments.global;
|
|
275
269
|
const features = _internal.getFeatures().get();
|
|
276
270
|
const ext = {
|
|
277
271
|
uid: generateUUID(),
|
|
272
|
+
pageviewId: _ADAGIO.pageviewId,
|
|
278
273
|
features: { ...features },
|
|
279
274
|
session: { ..._SESSION.get() }
|
|
280
275
|
};
|
|
@@ -294,8 +289,26 @@ function onGetBidRequestData(bidReqConfig, callback, config) {
|
|
|
294
289
|
const slotPosition = getSlotPosition(adUnit);
|
|
295
290
|
deepSetValue(ortb2Imp, `ext.data.adg_rtd.adunit_position`, slotPosition);
|
|
296
291
|
|
|
297
|
-
//
|
|
298
|
-
//
|
|
292
|
+
// It is expected that the publisher set a `adUnits[].ortb2Imp.ext.data.placement` value.
|
|
293
|
+
// Btw, We allow fallback sources to programmatically set this value.
|
|
294
|
+
// The source is defined in the `config.params.placementSource` and the possible values are `code` or `gpid`.
|
|
295
|
+
// (Please note that this `placement` is not related to the oRTB video property.)
|
|
296
|
+
if (!deepAccess(ortb2Imp, 'ext.data.placement')) {
|
|
297
|
+
const { placementSource = '' } = configParams;
|
|
298
|
+
|
|
299
|
+
switch (placementSource.toLowerCase()) {
|
|
300
|
+
case PLACEMENT_SOURCES.ADUNITCODE:
|
|
301
|
+
deepSetValue(ortb2Imp, 'ext.data.placement', adUnit.code);
|
|
302
|
+
break;
|
|
303
|
+
case PLACEMENT_SOURCES.GPID:
|
|
304
|
+
deepSetValue(ortb2Imp, 'ext.data.placement', deepAccess(ortb2Imp, 'ext.gpid'));
|
|
305
|
+
break;
|
|
306
|
+
default:
|
|
307
|
+
logWarn('`ortb2Imp.ext.data.placement` is missing and `params.definePlacement` is not set in the config.');
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// We expect that `pagetype`, `category`, `placement` are defined in FPD `ortb2.site.ext.data` and `adUnits[].ortb2Imp.ext.data` objects.
|
|
299
312
|
// Btw, we have to ensure compatibility with publishers that use the "legacy" adagio params at the adUnit.params level.
|
|
300
313
|
const adagioBid = adUnit.bids.find(bid => _internal.isAdagioBidder(bid.bidder));
|
|
301
314
|
if (adagioBid) {
|
|
@@ -316,9 +329,6 @@ function onGetBidRequestData(bidReqConfig, callback, config) {
|
|
|
316
329
|
if (adagioBid.params.placement) {
|
|
317
330
|
deepSetValue(ortb2Imp, 'ext.data.placement', adagioBid.params.placement);
|
|
318
331
|
mustWarnOrtb2Imp = true;
|
|
319
|
-
} else {
|
|
320
|
-
// If the placement is not defined, we fallback to the adUnit code.
|
|
321
|
-
deepSetValue(ortb2Imp, 'ext.data.placement', adUnit.code);
|
|
322
332
|
}
|
|
323
333
|
}
|
|
324
334
|
|
|
@@ -428,16 +438,14 @@ function getSlotPosition(adUnit) {
|
|
|
428
438
|
const position = { x: 0, y: 0 };
|
|
429
439
|
|
|
430
440
|
if (isSafeFrameWindow()) {
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
const sfGeom = (typeof ws.$sf.ext.geom === 'function') ? ws.$sf.ext.geom() : null;
|
|
441
|
+
const { self } = getSafeframeGeometry() || {};
|
|
434
442
|
|
|
435
|
-
if (!
|
|
443
|
+
if (!self) {
|
|
436
444
|
return '';
|
|
437
445
|
}
|
|
438
446
|
|
|
439
|
-
position.x = Math.round(
|
|
440
|
-
position.y = Math.round(
|
|
447
|
+
position.x = Math.round(self.t);
|
|
448
|
+
position.y = Math.round(self.l);
|
|
441
449
|
} else {
|
|
442
450
|
try {
|
|
443
451
|
// window.top based computing
|
|
@@ -513,16 +521,14 @@ function getViewPortDimensions() {
|
|
|
513
521
|
const viewportDims = { w: 0, h: 0 };
|
|
514
522
|
|
|
515
523
|
if (isSafeFrameWindow()) {
|
|
516
|
-
const
|
|
524
|
+
const { win } = getSafeframeGeometry() || {};
|
|
517
525
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
if (!sfGeom || !sfGeom.win) {
|
|
526
|
+
if (!win) {
|
|
521
527
|
return '';
|
|
522
528
|
}
|
|
523
529
|
|
|
524
|
-
viewportDims.w = Math.round(
|
|
525
|
-
viewportDims.h = Math.round(
|
|
530
|
+
viewportDims.w = Math.round(win.w);
|
|
531
|
+
viewportDims.h = Math.round(win.h);
|
|
526
532
|
} else {
|
|
527
533
|
// window.top based computing
|
|
528
534
|
const wt = getWindowTop();
|
|
@@ -538,22 +544,6 @@ function getTimestampUTC() {
|
|
|
538
544
|
return Math.floor(new Date().getTime() / 1000) - new Date().getTimezoneOffset() * 60;
|
|
539
545
|
}
|
|
540
546
|
|
|
541
|
-
function getDomLoadingDuration() {
|
|
542
|
-
const w = (canAccessWindowTop()) ? getWindowTop() : getWindowSelf();
|
|
543
|
-
const performance = w.performance;
|
|
544
|
-
|
|
545
|
-
let domLoadingDuration = -1;
|
|
546
|
-
|
|
547
|
-
if (performance && performance.timing && performance.timing.navigationStart > 0) {
|
|
548
|
-
const val = performance.timing.domLoading - performance.timing.navigationStart;
|
|
549
|
-
if (val > 0) {
|
|
550
|
-
domLoadingDuration = val;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
return domLoadingDuration;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
547
|
/**
|
|
558
548
|
* registerEventsForAdServers bind adagio listeners to ad-server events.
|
|
559
549
|
* Theses events are used to track the viewability and attention.
|
|
@@ -30,6 +30,7 @@ pbjs.setConfig({
|
|
|
30
30
|
params: {
|
|
31
31
|
organizationId: '1000' // Required. Provided by Adagio
|
|
32
32
|
site: 'my-site' // Required. Provided by Adagio
|
|
33
|
+
placementSource: 'ortb' // Optional. Where to find the "placement" value. Possible values: 'ortb'<default> | 'code' | 'gpid'
|
|
33
34
|
}
|
|
34
35
|
}]
|
|
35
36
|
}
|
|
@@ -1,208 +1,51 @@
|
|
|
1
|
-
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
1
|
+
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
2
2
|
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
3
|
-
import {
|
|
4
|
-
import {config} from '../src/config.js';
|
|
5
|
-
import {
|
|
3
|
+
import { deepAccess } from '../src/utils.js';
|
|
4
|
+
import { config } from '../src/config.js';
|
|
5
|
+
import {
|
|
6
|
+
isBidRequestValid,
|
|
7
|
+
buildRequestsBase,
|
|
8
|
+
interpretResponse,
|
|
9
|
+
getUserSyncs,
|
|
10
|
+
buildPlacementProcessingFunction
|
|
11
|
+
} from '../libraries/teqblazeUtils/bidderUtils.js';
|
|
6
12
|
|
|
7
13
|
const GVLID = 149;
|
|
8
14
|
const BIDDER_CODE = 'adman';
|
|
9
15
|
const AD_URL = 'https://pub.admanmedia.com/?c=o&m=multi';
|
|
10
|
-
const
|
|
16
|
+
const SYNC_URL = 'https://sync.admanmedia.com';
|
|
11
17
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
!bid.ttl || !bid.currency) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
switch (bid['mediaType']) {
|
|
18
|
-
case BANNER:
|
|
19
|
-
return Boolean(bid.width && bid.height && bid.ad);
|
|
20
|
-
case VIDEO:
|
|
21
|
-
return Boolean(bid.vastUrl);
|
|
22
|
-
case NATIVE:
|
|
23
|
-
return Boolean(bid.native && bid.native.title && bid.native.image && bid.native.impressionTrackers);
|
|
24
|
-
default:
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
18
|
+
const addCustomFieldsToPlacement = (bid, bidderRequest, placement) => {
|
|
19
|
+
placement.traffic = placement.adFormat;
|
|
28
20
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
if (placement.adFormat === VIDEO) {
|
|
22
|
+
placement.wPlayer = placement.playerSize?.[0]?.[0];
|
|
23
|
+
placement.hPlayer = placement.playerSize?.[0]?.[1];
|
|
32
24
|
}
|
|
25
|
+
};
|
|
33
26
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
return bidFloor.floor;
|
|
41
|
-
} catch (_) {
|
|
42
|
-
return 0
|
|
43
|
-
}
|
|
44
|
-
}
|
|
27
|
+
const placementProcessingFunction = buildPlacementProcessingFunction({ addCustomFieldsToPlacement });
|
|
28
|
+
|
|
29
|
+
const buildRequests = (validBidRequests = [], bidderRequest = {}) => {
|
|
30
|
+
const request = buildRequestsBase({ adUrl: AD_URL, validBidRequests, bidderRequest, placementProcessingFunction });
|
|
31
|
+
const content = deepAccess(bidderRequest, 'ortb2.site.content', config.getAnyConfig('ortb2.site.content'));
|
|
45
32
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
var uid = { id };
|
|
49
|
-
if (uidExt) {
|
|
50
|
-
uid.ext = uidExt;
|
|
51
|
-
}
|
|
52
|
-
eids.push({
|
|
53
|
-
source,
|
|
54
|
-
uids: [ uid ]
|
|
55
|
-
});
|
|
33
|
+
if (content) {
|
|
34
|
+
request.data.content = content;
|
|
56
35
|
}
|
|
57
|
-
|
|
36
|
+
|
|
37
|
+
return request;
|
|
38
|
+
};
|
|
58
39
|
|
|
59
40
|
export const spec = {
|
|
60
41
|
code: BIDDER_CODE,
|
|
61
42
|
gvlid: GVLID,
|
|
62
43
|
supportedMediaTypes: [BANNER, VIDEO, NATIVE],
|
|
63
44
|
|
|
64
|
-
isBidRequestValid: (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
buildRequests: (validBidRequests = [], bidderRequest) => {
|
|
69
|
-
// convert Native ORTB definition to old-style prebid native definition
|
|
70
|
-
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
|
|
71
|
-
const content = deepAccess(bidderRequest, 'ortb2.site.content', config.getAnyConfig('ortb2.site.content'));
|
|
72
|
-
|
|
73
|
-
let winTop = window;
|
|
74
|
-
let location;
|
|
75
|
-
// TODO: this odd try-catch block was copied in several adapters; it doesn't seem to be correct for cross-origin
|
|
76
|
-
try {
|
|
77
|
-
location = new URL(bidderRequest.refererInfo.page)
|
|
78
|
-
winTop = window.top;
|
|
79
|
-
} catch (e) {
|
|
80
|
-
location = winTop.location;
|
|
81
|
-
logMessage(e);
|
|
82
|
-
};
|
|
83
|
-
let placements = [];
|
|
84
|
-
let request = {
|
|
85
|
-
'deviceWidth': winTop.screen.width,
|
|
86
|
-
'deviceHeight': winTop.screen.height,
|
|
87
|
-
'language': (navigator && navigator.language) ? navigator.language : '',
|
|
88
|
-
'secure': 1,
|
|
89
|
-
'host': location.host,
|
|
90
|
-
'page': location.pathname,
|
|
91
|
-
'placements': placements
|
|
92
|
-
};
|
|
93
|
-
request.language.indexOf('-') != -1 && (request.language = request.language.split('-')[0])
|
|
94
|
-
if (bidderRequest) {
|
|
95
|
-
if (bidderRequest.uspConsent) {
|
|
96
|
-
request.ccpa = bidderRequest.uspConsent;
|
|
97
|
-
}
|
|
98
|
-
if (bidderRequest.gdprConsent) {
|
|
99
|
-
request.gdpr = {
|
|
100
|
-
consentString: bidderRequest.gdprConsent.consentString
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
if (content) {
|
|
104
|
-
request.content = content;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
const len = validBidRequests.length;
|
|
108
|
-
|
|
109
|
-
for (let i = 0; i < len; i++) {
|
|
110
|
-
const bid = validBidRequests[i];
|
|
111
|
-
const { params, bidId, mediaTypes } = bid;
|
|
112
|
-
|
|
113
|
-
const placement = {
|
|
114
|
-
placementId: params.placementId,
|
|
115
|
-
bidId,
|
|
116
|
-
eids: [],
|
|
117
|
-
bidFloor: getBidFloor(bid)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if (bid.transactionId) {
|
|
121
|
-
placement.ext = placement.ext || {};
|
|
122
|
-
placement.ext.tid = bid.transactionId;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (bid.schain) {
|
|
126
|
-
placement.schain = bid.schain;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (bid.userId) {
|
|
130
|
-
getUserId(placement.eids, bid.userId.uid2 && bid.userId.uid2.id, 'uidapi.com');
|
|
131
|
-
getUserId(placement.eids, bid.userId.lotamePanoramaId, 'lotame.com');
|
|
132
|
-
getUserId(placement.eids, bid.userId.idx, 'idx.lat');
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (mediaTypes?.[BANNER]) {
|
|
136
|
-
placement.traffic = BANNER;
|
|
137
|
-
placement.sizes = mediaTypes[BANNER].sizes;
|
|
138
|
-
} else if (mediaTypes?.[VIDEO]) {
|
|
139
|
-
placement.traffic = VIDEO;
|
|
140
|
-
placement.playerSize = mediaTypes[VIDEO].playerSize;
|
|
141
|
-
placement.minduration = mediaTypes[VIDEO].minduration;
|
|
142
|
-
placement.maxduration = mediaTypes[VIDEO].maxduration;
|
|
143
|
-
placement.mimes = mediaTypes[VIDEO].mimes;
|
|
144
|
-
placement.protocols = mediaTypes[VIDEO].protocols;
|
|
145
|
-
placement.startdelay = mediaTypes[VIDEO].startdelay;
|
|
146
|
-
placement.placement = mediaTypes[VIDEO].placement;
|
|
147
|
-
placement.plcmt = mediaTypes[VIDEO].plcmt;
|
|
148
|
-
placement.skip = mediaTypes[VIDEO].skip;
|
|
149
|
-
placement.skipafter = mediaTypes[VIDEO].skipafter;
|
|
150
|
-
placement.minbitrate = mediaTypes[VIDEO].minbitrate;
|
|
151
|
-
placement.maxbitrate = mediaTypes[VIDEO].maxbitrate;
|
|
152
|
-
placement.delivery = mediaTypes[VIDEO].delivery;
|
|
153
|
-
placement.playbackmethod = mediaTypes[VIDEO].playbackmethod;
|
|
154
|
-
placement.api = mediaTypes[VIDEO].api;
|
|
155
|
-
placement.linearity = mediaTypes[VIDEO].linearity;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
placements.push(placement);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return {
|
|
162
|
-
method: 'POST',
|
|
163
|
-
url: AD_URL,
|
|
164
|
-
data: request
|
|
165
|
-
};
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
interpretResponse: (serverResponse) => {
|
|
169
|
-
let response = [];
|
|
170
|
-
serverResponse = serverResponse.body;
|
|
171
|
-
for (let i = 0; i < serverResponse.length; i++) {
|
|
172
|
-
let resItem = serverResponse[i];
|
|
173
|
-
if (isBidResponseValid(resItem)) {
|
|
174
|
-
const advertiserDomains = resItem.adomain && resItem.adomain.length ? resItem.adomain : [];
|
|
175
|
-
resItem.meta = { ...resItem.meta, advertiserDomains };
|
|
176
|
-
|
|
177
|
-
response.push(resItem);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return response;
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => {
|
|
184
|
-
let syncType = syncOptions.iframeEnabled ? 'iframe' : 'image';
|
|
185
|
-
let syncUrl = URL_SYNC + `/${syncType}?pbjs=1`;
|
|
186
|
-
if (gdprConsent && gdprConsent.consentString) {
|
|
187
|
-
if (typeof gdprConsent.gdprApplies === 'boolean') {
|
|
188
|
-
syncUrl += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
|
|
189
|
-
} else {
|
|
190
|
-
syncUrl += `&gdpr=0&gdpr_consent=${gdprConsent.consentString}`;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
if (uspConsent && uspConsent.consentString) {
|
|
194
|
-
syncUrl += `&ccpa_consent=${uspConsent.consentString}`;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
const coppa = config.getConfig('coppa') ? 1 : 0;
|
|
198
|
-
syncUrl += `&coppa=${coppa}`;
|
|
199
|
-
|
|
200
|
-
return [{
|
|
201
|
-
type: syncType,
|
|
202
|
-
url: syncUrl
|
|
203
|
-
}];
|
|
204
|
-
}
|
|
205
|
-
|
|
45
|
+
isBidRequestValid: isBidRequestValid(['placementId']),
|
|
46
|
+
buildRequests,
|
|
47
|
+
interpretResponse,
|
|
48
|
+
getUserSyncs: getUserSyncs(SYNC_URL)
|
|
206
49
|
};
|
|
207
50
|
|
|
208
51
|
registerBidder(spec);
|
|
@@ -1,183 +1,46 @@
|
|
|
1
|
-
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
1
|
+
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
2
2
|
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { getAllOrtbKeywords } from '../libraries/keywords/keywords.js';
|
|
4
|
+
import {
|
|
5
|
+
isBidRequestValid,
|
|
6
|
+
buildRequestsBase,
|
|
7
|
+
interpretResponse,
|
|
8
|
+
getUserSyncs,
|
|
9
|
+
buildPlacementProcessingFunction
|
|
10
|
+
} from '../libraries/teqblazeUtils/bidderUtils.js';
|
|
7
11
|
|
|
8
12
|
const BIDDER_CODE = 'adprime';
|
|
9
13
|
const AD_URL = 'https://delta.adprime.com/pbjs';
|
|
10
14
|
const SYNC_URL = 'https://sync.adprime.com';
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
const addCustomFieldsToPlacement = (bid, bidderRequest, placement) => {
|
|
17
|
+
if (placement.adFormat === VIDEO) {
|
|
18
|
+
placement.wPlayer = placement.playerSize?.[0]?.[0];
|
|
19
|
+
placement.hPlayer = placement.playerSize?.[0]?.[1];
|
|
16
20
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
case VIDEO:
|
|
21
|
-
return Boolean(bid.vastUrl);
|
|
22
|
-
case NATIVE:
|
|
23
|
-
return Boolean(bid.native && bid.native.title && bid.native.image && bid.native.impressionTrackers);
|
|
24
|
-
default:
|
|
25
|
-
return false;
|
|
21
|
+
if (bid.userId && bid.userId.idl_env) {
|
|
22
|
+
placement.identeties = {};
|
|
23
|
+
placement.identeties.identityLink = bid.userId.idl_env;
|
|
26
24
|
}
|
|
27
|
-
}
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
26
|
+
placement.keywords = getAllOrtbKeywords(bidderRequest.ortb2, bid.params.keywords);
|
|
27
|
+
placement.audiences = bid.params.audiences || [];
|
|
28
|
+
};
|
|
33
29
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
return bidFloor.floor;
|
|
41
|
-
} catch (_) {
|
|
42
|
-
return 0
|
|
43
|
-
}
|
|
44
|
-
}
|
|
30
|
+
const placementProcessingFunction = buildPlacementProcessingFunction({ addCustomFieldsToPlacement });
|
|
31
|
+
|
|
32
|
+
const buildRequests = (validBidRequests = [], bidderRequest = {}) => {
|
|
33
|
+
return buildRequestsBase({ adUrl: AD_URL, validBidRequests, bidderRequest, placementProcessingFunction });
|
|
34
|
+
};
|
|
45
35
|
|
|
46
36
|
export const spec = {
|
|
47
37
|
code: BIDDER_CODE,
|
|
48
38
|
supportedMediaTypes: [BANNER, VIDEO, NATIVE],
|
|
49
39
|
|
|
50
|
-
isBidRequestValid: (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
buildRequests: (validBidRequests = [], bidderRequest) => {
|
|
55
|
-
// convert Native ORTB definition to old-style prebid native definition
|
|
56
|
-
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
|
|
57
|
-
|
|
58
|
-
let winTop = window;
|
|
59
|
-
let location;
|
|
60
|
-
// TODO: this odd try-catch block was copied in several adapters; it doesn't seem to be correct for cross-origin
|
|
61
|
-
try {
|
|
62
|
-
location = new URL(bidderRequest.refererInfo.page)
|
|
63
|
-
winTop = window.top;
|
|
64
|
-
} catch (e) {
|
|
65
|
-
location = winTop.location;
|
|
66
|
-
logMessage(e);
|
|
67
|
-
};
|
|
68
|
-
let placements = [];
|
|
69
|
-
let request = {
|
|
70
|
-
deviceWidth: winTop.screen.width,
|
|
71
|
-
deviceHeight: winTop.screen.height,
|
|
72
|
-
language: (navigator && navigator.language) ? navigator.language.split('-')[0] : '',
|
|
73
|
-
secure: 1,
|
|
74
|
-
host: location.host,
|
|
75
|
-
page: location.pathname,
|
|
76
|
-
placements: placements
|
|
77
|
-
};
|
|
78
|
-
if (bidderRequest) {
|
|
79
|
-
if (bidderRequest.uspConsent) {
|
|
80
|
-
request.ccpa = bidderRequest.uspConsent;
|
|
81
|
-
}
|
|
82
|
-
if (bidderRequest.gdprConsent) {
|
|
83
|
-
request.gdpr = bidderRequest.gdprConsent
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
const len = validBidRequests.length;
|
|
87
|
-
|
|
88
|
-
for (let i = 0; i < len; i++) {
|
|
89
|
-
let bid = validBidRequests[i];
|
|
90
|
-
const { mediaTypes } = bid;
|
|
91
|
-
const placement = {};
|
|
92
|
-
let sizes
|
|
93
|
-
let identeties = {}
|
|
94
|
-
if (mediaTypes) {
|
|
95
|
-
if (mediaTypes[BANNER] && mediaTypes[BANNER].sizes) {
|
|
96
|
-
placement.adFormat = BANNER;
|
|
97
|
-
sizes = mediaTypes[BANNER].sizes
|
|
98
|
-
} else if (mediaTypes[VIDEO] && mediaTypes[VIDEO].playerSize) {
|
|
99
|
-
placement.adFormat = VIDEO;
|
|
100
|
-
sizes = mediaTypes[VIDEO].playerSize
|
|
101
|
-
placement.minduration = mediaTypes[VIDEO].minduration;
|
|
102
|
-
placement.maxduration = mediaTypes[VIDEO].maxduration;
|
|
103
|
-
placement.mimes = mediaTypes[VIDEO].mimes;
|
|
104
|
-
placement.protocols = mediaTypes[VIDEO].protocols;
|
|
105
|
-
placement.startdelay = mediaTypes[VIDEO].startdelay;
|
|
106
|
-
placement.placement = mediaTypes[VIDEO].placement;
|
|
107
|
-
placement.skip = mediaTypes[VIDEO].skip;
|
|
108
|
-
placement.skipafter = mediaTypes[VIDEO].skipafter;
|
|
109
|
-
placement.minbitrate = mediaTypes[VIDEO].minbitrate;
|
|
110
|
-
placement.maxbitrate = mediaTypes[VIDEO].maxbitrate;
|
|
111
|
-
placement.delivery = mediaTypes[VIDEO].delivery;
|
|
112
|
-
placement.playbackmethod = mediaTypes[VIDEO].playbackmethod;
|
|
113
|
-
placement.api = mediaTypes[VIDEO].api;
|
|
114
|
-
placement.linearity = mediaTypes[VIDEO].linearity;
|
|
115
|
-
} else {
|
|
116
|
-
placement.adFormat = NATIVE;
|
|
117
|
-
placement.native = mediaTypes[NATIVE];
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
if (bid.userId && bid.userId.idl_env) {
|
|
121
|
-
identeties.identityLink = bid.userId.idl_env
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
placements.push({
|
|
125
|
-
...placement,
|
|
126
|
-
placementId: bid.params.placementId,
|
|
127
|
-
bidId: bid.bidId,
|
|
128
|
-
sizes: sizes || [],
|
|
129
|
-
wPlayer: sizes ? sizes[0] : 0,
|
|
130
|
-
hPlayer: sizes ? sizes[1] : 0,
|
|
131
|
-
schain: bid.schain || {},
|
|
132
|
-
keywords: getAllOrtbKeywords(bidderRequest.ortb2, bid.params.keywords),
|
|
133
|
-
audiences: bid.params.audiences || [],
|
|
134
|
-
identeties,
|
|
135
|
-
bidFloor: getBidFloor(bid)
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
return {
|
|
139
|
-
method: 'POST',
|
|
140
|
-
url: AD_URL,
|
|
141
|
-
data: request
|
|
142
|
-
};
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
interpretResponse: (serverResponse) => {
|
|
146
|
-
let response = [];
|
|
147
|
-
for (let i = 0; i < serverResponse.body.length; i++) {
|
|
148
|
-
let resItem = serverResponse.body[i];
|
|
149
|
-
if (isBidResponseValid(resItem)) {
|
|
150
|
-
const advertiserDomains = resItem.adomain && resItem.adomain.length ? resItem.adomain : [];
|
|
151
|
-
resItem.meta = { ...resItem.meta, advertiserDomains };
|
|
152
|
-
|
|
153
|
-
response.push(resItem);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return response;
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => {
|
|
160
|
-
let syncType = syncOptions.iframeEnabled ? 'iframe' : 'image';
|
|
161
|
-
let syncUrl = SYNC_URL + `/${syncType}?pbjs=1`;
|
|
162
|
-
if (gdprConsent && gdprConsent.consentString) {
|
|
163
|
-
if (typeof gdprConsent.gdprApplies === 'boolean') {
|
|
164
|
-
syncUrl += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
|
|
165
|
-
} else {
|
|
166
|
-
syncUrl += `&gdpr=0&gdpr_consent=${gdprConsent.consentString}`;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
if (uspConsent && uspConsent.consentString) {
|
|
170
|
-
syncUrl += `&ccpa_consent=${uspConsent.consentString}`;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
const coppa = config.getConfig('coppa') ? 1 : 0;
|
|
174
|
-
syncUrl += `&coppa=${coppa}`;
|
|
175
|
-
|
|
176
|
-
return [{
|
|
177
|
-
type: syncType,
|
|
178
|
-
url: syncUrl
|
|
179
|
-
}];
|
|
180
|
-
}
|
|
40
|
+
isBidRequestValid: isBidRequestValid(['placementId']),
|
|
41
|
+
buildRequests,
|
|
42
|
+
interpretResponse,
|
|
43
|
+
getUserSyncs: getUserSyncs(SYNC_URL)
|
|
181
44
|
};
|
|
182
45
|
|
|
183
46
|
registerBidder(spec);
|