prebid.js 9.6.0 → 9.8.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/.github/PULL_REQUEST_TEMPLATE.md +1 -1
- package/.github/codeql/codeql-config.yml +3 -0
- package/.github/codeql/queries/deviceMemory.ql +14 -0
- package/.github/codeql/queries/hardwareConcurrency.ql +14 -0
- package/.github/codeql/queries/prebid.qll +36 -0
- package/.github/codeql/queries/qlpack.yml +8 -0
- package/.github/release-drafter.yml +4 -0
- package/.github/workflows/jscpd.yml +1 -1
- package/README.md +4 -4
- 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/adagioAnalyticsAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adagioUtils.js +1 -1
- package/dist/addefendBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/admixerBidAdapter.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/adxcgAnalyticsAdapter.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/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/ccxBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/chunk-core.js +1 -1
- package/dist/cleanmedianetBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/connectionInfo.js +1 -0
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/contxtfulRtdProvider.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 +16 -3
- package/dist/discoveryBidAdapter.js +1 -1
- package/dist/docereeAdManagerBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/dxkultureBidAdapter.js +1 -1
- package/dist/eightPodAnalyticsAdapter.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/gamoshiBidAdapter.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/id5AnalyticsAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/idImportLibrary.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/intentIqAnalyticsAdapter.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/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/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/luceadBidAdapter.js +1 -1
- package/dist/mabidderBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediagoBidAdapter.js +1 -1
- package/dist/medianetAnalyticsAdapter.js +1 -1
- package/dist/medianetBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/mgidUtils.js +1 -0
- package/dist/mgidXBidAdapter.js +1 -1
- package/dist/missenaBidAdapter.js +1 -1
- package/dist/mobianRtdProvider.js +1 -1
- package/dist/navigatorData.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 +176 -170
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/omsBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxBidAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/orbidderBidAdapter.js +1 -1
- package/dist/ortbConverter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/ownadxBidAdapter.js +1 -0
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prismaBidAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubriseBidAdapter.js +1 -0
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubxaiAnalyticsAdapter.js +1 -1
- package/dist/pubxaiRtdProvider.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/redtramBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseUtils.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/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/snigelBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.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/taboolaBidAdapter.js +1 -1
- package/dist/tappxBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/terceptAnalyticsAdapter.js +1 -1
- package/dist/themoneytizerBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/unrulyBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/viantOrtbBidAdapter.js +1 -1
- package/dist/vidazooUtils.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/wurflRtdProvider.js +1 -0
- package/dist/yahooAdsBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/gpt/wurflRtdProvider_example.html +106 -0
- package/libraries/connectionInfo/connectionUtils.js +33 -0
- package/libraries/mgidUtils/mgidUtils.js +73 -0
- package/{src/fpd/navigator.js → libraries/navigatorData/navigatorData.js} +1 -1
- package/libraries/ortbConverter/processors/video.js +2 -24
- package/libraries/riseUtils/index.js +2 -1
- package/libraries/vidazooUtils/bidderUtils.js +16 -0
- package/modules/.submodules.json +3 -1
- package/modules/51DegreesRtdProvider.md +11 -7
- package/modules/adagioBidAdapter.js +10 -50
- package/modules/admixerBidAdapter.js +12 -5
- package/modules/appnexusBidAdapter.js +1 -1
- package/modules/ccxBidAdapter.js +6 -2
- package/modules/cleanmedianetBidAdapter.js +1 -1
- package/modules/contxtfulRtdProvider.js +15 -12
- package/modules/cwireBidAdapter.js +13 -9
- package/modules/cwireBidAdapter.md +29 -10
- package/modules/dailymotionBidAdapter.js +20 -1
- package/modules/dailymotionBidAdapter.md +11 -7
- package/modules/discoveryBidAdapter.js +1 -1
- package/modules/docereeAdManagerBidAdapter.js +9 -12
- package/modules/eightPodAnalyticsAdapter.js +13 -1
- package/modules/gamoshiBidAdapter.js +1 -1
- package/modules/greenbidsAnalyticsAdapter.js +7 -4
- package/modules/greenbidsRtdProvider.js +15 -5
- package/modules/id5IdSystem.js +14 -93
- package/modules/idImportLibrary.js +14 -6
- package/modules/ixBidAdapter.js +0 -1
- package/modules/mediagoBidAdapter.js +4 -4
- package/modules/mgidBidAdapter.js +30 -109
- package/modules/mgidXBidAdapter.js +2 -66
- package/modules/mobianRtdProvider.js +28 -14
- package/modules/omsBidAdapter.js +1 -1
- package/modules/ownadxBidAdapter.js +99 -0
- package/modules/prismaBidAdapter.js +1 -27
- package/modules/pubmaticBidAdapter.js +2 -1
- package/modules/pubriseBidAdapter.js +19 -0
- package/modules/pubriseBidAdapter.md +79 -0
- package/modules/pubxaiAnalyticsAdapter.js +9 -4
- package/modules/pubxaiRtdProvider.js +38 -18
- package/modules/pubxaiRtdProvider.md +2 -2
- package/modules/redtramBidAdapter.js +2 -6
- package/modules/rubiconBidAdapter.js +3 -3
- package/modules/sharethroughBidAdapter.js +5 -0
- package/modules/smarthubBidAdapter.js +2 -0
- package/modules/teadsBidAdapter.js +4 -3
- package/modules/ttdBidAdapter.js +14 -32
- package/modules/undertoneBidAdapter.js +1 -19
- package/modules/userId/index.js +1 -1
- package/modules/viantOrtbBidAdapter.js +1 -1
- package/modules/wurflRtdProvider.js +213 -0
- package/modules/wurflRtdProvider.md +67 -0
- package/package.json +1 -1
- package/src/adloader.js +1 -0
- package/src/prebid.js +2 -1
- package/src/utils/focusTimeout.js +17 -6
- package/src/utils/ttlCollection.js +1 -1
- package/src/utils.js +28 -0
- package/src/video.js +78 -1
- package/test/spec/modules/adagioBidAdapter_spec.js +0 -1
- package/test/spec/modules/admixerBidAdapter_spec.js +2 -2
- package/test/spec/modules/appnexusBidAdapter_spec.js +0 -33
- package/test/spec/modules/ccxBidAdapter_spec.js +81 -0
- package/test/spec/modules/cleanmedianetBidAdapter_spec.js +1 -1
- package/test/spec/modules/contxtfulRtdProvider_spec.js +19 -19
- package/test/spec/modules/dailymotionBidAdapter_spec.js +62 -12
- package/test/spec/modules/discoveryBidAdapter_spec.js +1 -1
- package/test/spec/modules/docereeAdManagerBidAdapter_spec.js +1 -0
- package/test/spec/modules/gamoshiBidAdapter_spec.js +1 -1
- package/test/spec/modules/id5IdSystem_spec.js +25 -98
- package/test/spec/modules/idImportLibrary_spec.js +14 -0
- package/test/spec/modules/ixBidAdapter_spec.js +8 -1
- package/test/spec/modules/mobianRtdProvider_spec.js +46 -43
- package/test/spec/modules/openxBidAdapter_spec.js +1 -1
- package/test/spec/modules/ownadxBidAdapter_spec.js +103 -0
- package/test/spec/modules/pubmaticBidAdapter_spec.js +18 -0
- package/test/spec/modules/pubriseBidAdapter_spec.js +514 -0
- package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +9 -4
- package/test/spec/modules/pubxaiRtdProvider_spec.js +37 -5
- package/test/spec/modules/rubiconBidAdapter_spec.js +10 -0
- package/test/spec/modules/sharethroughBidAdapter_spec.js +35 -0
- package/test/spec/modules/trafficgateBidAdapter_spec.js +1 -1
- package/test/spec/modules/ttdBidAdapter_spec.js +10 -1
- package/test/spec/modules/viantOrtbBidAdapter_spec.js +1 -1
- package/test/spec/modules/vidazooBidAdapter_spec.js +12 -4
- package/test/spec/modules/wurflRtdProvider_spec.js +324 -0
- package/test/spec/ortbConverter/userId_spec.js +23 -2
- package/test/spec/unit/utils/focusTimeout_spec.js +33 -6
- package/test/spec/video_spec.js +103 -1
package/modules/id5IdSystem.js
CHANGED
|
@@ -13,14 +13,13 @@ import {
|
|
|
13
13
|
isPlainObject,
|
|
14
14
|
logError,
|
|
15
15
|
logInfo,
|
|
16
|
-
logWarn
|
|
17
|
-
safeJSONParse
|
|
16
|
+
logWarn
|
|
18
17
|
} from '../src/utils.js';
|
|
19
18
|
import {fetch} from '../src/ajax.js';
|
|
20
19
|
import {submodule} from '../src/hook.js';
|
|
21
20
|
import {getRefererInfo} from '../src/refererDetection.js';
|
|
22
21
|
import {getStorageManager} from '../src/storageManager.js';
|
|
23
|
-
import {
|
|
22
|
+
import {gppDataHandler, uspDataHandler} from '../src/adapterManager.js';
|
|
24
23
|
import {MODULE_TYPE_UID} from '../src/activities/modules.js';
|
|
25
24
|
import {GreedyPromise} from '../src/utils/promise.js';
|
|
26
25
|
import {loadExternalScript} from '../src/adloader.js';
|
|
@@ -34,19 +33,12 @@ import {loadExternalScript} from '../src/adloader.js';
|
|
|
34
33
|
|
|
35
34
|
const MODULE_NAME = 'id5Id';
|
|
36
35
|
const GVLID = 131;
|
|
37
|
-
const NB_EXP_DAYS = 30;
|
|
38
36
|
export const ID5_STORAGE_NAME = 'id5id';
|
|
39
|
-
export const ID5_PRIVACY_STORAGE_NAME = `${ID5_STORAGE_NAME}_privacy`;
|
|
40
|
-
const LOCAL_STORAGE = 'html5';
|
|
41
37
|
const LOG_PREFIX = 'User ID - ID5 submodule: ';
|
|
42
38
|
const ID5_API_CONFIG_URL = 'https://id5-sync.com/api/config/prebid';
|
|
43
39
|
const ID5_DOMAIN = 'id5-sync.com';
|
|
44
40
|
const TRUE_LINK_SOURCE = 'true-link-id5-sync.com';
|
|
45
41
|
|
|
46
|
-
// order the legacy cookie names in reverse priority order so the last
|
|
47
|
-
// cookie in the array is the most preferred to use
|
|
48
|
-
const LEGACY_COOKIE_NAMES = ['pbjs-id5id', 'id5id.1st', 'id5id'];
|
|
49
|
-
|
|
50
42
|
export const storage = getStorageManager({moduleType: MODULE_TYPE_UID, moduleName: MODULE_NAME});
|
|
51
43
|
|
|
52
44
|
/**
|
|
@@ -231,7 +223,7 @@ export const id5IdSubmodule = {
|
|
|
231
223
|
* @param {SubmoduleConfig} config
|
|
232
224
|
* @param {ConsentData|undefined} consentData
|
|
233
225
|
* @param {Object} cacheIdObj - existing id, if any
|
|
234
|
-
* @return {
|
|
226
|
+
* @return {IdResponse} A response object that contains id.
|
|
235
227
|
*/
|
|
236
228
|
extendId(config, consentData, cacheIdObj) {
|
|
237
229
|
if (!hasWriteConsentToLocalStorage(consentData)) {
|
|
@@ -239,10 +231,10 @@ export const id5IdSubmodule = {
|
|
|
239
231
|
return cacheIdObj;
|
|
240
232
|
}
|
|
241
233
|
|
|
242
|
-
const partnerId = validateConfig(config) ? config.params.partner : 0;
|
|
243
|
-
incrementNb(partnerId);
|
|
244
|
-
|
|
245
234
|
logInfo(LOG_PREFIX + 'using cached ID', cacheIdObj);
|
|
235
|
+
if (cacheIdObj) {
|
|
236
|
+
cacheIdObj.nbPage = incrementNb(cacheIdObj)
|
|
237
|
+
}
|
|
246
238
|
return cacheIdObj;
|
|
247
239
|
},
|
|
248
240
|
eids: {
|
|
@@ -401,8 +393,8 @@ export class IdFetchFlow {
|
|
|
401
393
|
const params = this.submoduleConfig.params;
|
|
402
394
|
const hasGdpr = (this.gdprConsentData && typeof this.gdprConsentData.gdprApplies === 'boolean' && this.gdprConsentData.gdprApplies) ? 1 : 0;
|
|
403
395
|
const referer = getRefererInfo();
|
|
404
|
-
const signature =
|
|
405
|
-
const nbPage =
|
|
396
|
+
const signature = this.cacheIdObj ? this.cacheIdObj.signature : undefined;
|
|
397
|
+
const nbPage = incrementNb(this.cacheIdObj);
|
|
406
398
|
const trueLinkInfo = window.id5Bootstrap ? window.id5Bootstrap.getTrueLinkInfo() : {booted: false};
|
|
407
399
|
|
|
408
400
|
const data = {
|
|
@@ -456,7 +448,6 @@ export class IdFetchFlow {
|
|
|
456
448
|
#processFetchCallResponse(fetchCallResponse) {
|
|
457
449
|
try {
|
|
458
450
|
if (fetchCallResponse.privacy) {
|
|
459
|
-
storeInLocalStorage(ID5_PRIVACY_STORAGE_NAME, JSON.stringify(fetchCallResponse.privacy), NB_EXP_DAYS);
|
|
460
451
|
if (window.id5Bootstrap && window.id5Bootstrap.setPrivacy) {
|
|
461
452
|
window.id5Bootstrap.setPrivacy(fetchCallResponse.privacy);
|
|
462
453
|
}
|
|
@@ -507,89 +498,19 @@ function validateConfig(config) {
|
|
|
507
498
|
logError(LOG_PREFIX + 'storage required to be set');
|
|
508
499
|
return false;
|
|
509
500
|
}
|
|
510
|
-
|
|
511
|
-
// in a future release, we may return false if storage type or name are not set as required
|
|
512
|
-
if (config.storage.type !== LOCAL_STORAGE) {
|
|
513
|
-
logWarn(LOG_PREFIX + `storage type recommended to be '${LOCAL_STORAGE}'. In a future release this may become a strict requirement`);
|
|
514
|
-
}
|
|
515
|
-
// in a future release, we may return false if storage type or name are not set as required
|
|
516
501
|
if (config.storage.name !== ID5_STORAGE_NAME) {
|
|
517
|
-
logWarn(LOG_PREFIX + `storage name recommended to be '${ID5_STORAGE_NAME}'
|
|
502
|
+
logWarn(LOG_PREFIX + `storage name recommended to be '${ID5_STORAGE_NAME}'.`);
|
|
518
503
|
}
|
|
519
504
|
|
|
520
505
|
return true;
|
|
521
506
|
}
|
|
522
507
|
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
return `${ID5_STORAGE_NAME}_${partnerId}_nb`;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
export function storeNbInCache(partnerId, nb) {
|
|
532
|
-
storeInLocalStorage(nbCacheName(partnerId), nb, NB_EXP_DAYS);
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
export function getNbFromCache(partnerId) {
|
|
536
|
-
let cacheNb = getFromLocalStorage(nbCacheName(partnerId));
|
|
537
|
-
return (cacheNb) ? parseInt(cacheNb) : 0;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
function incrementNb(partnerId) {
|
|
541
|
-
const nb = (getNbFromCache(partnerId) + 1);
|
|
542
|
-
storeNbInCache(partnerId, nb);
|
|
543
|
-
return nb;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
function incrementAndResetNb(partnerId) {
|
|
547
|
-
const result = incrementNb(partnerId);
|
|
548
|
-
storeNbInCache(partnerId, 0);
|
|
549
|
-
return result;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
function getLegacyCookieSignature() {
|
|
553
|
-
let legacyStoredValue;
|
|
554
|
-
LEGACY_COOKIE_NAMES.forEach(function (cookie) {
|
|
555
|
-
if (storage.getCookie(cookie)) {
|
|
556
|
-
legacyStoredValue = safeJSONParse(storage.getCookie(cookie)) || legacyStoredValue;
|
|
557
|
-
}
|
|
558
|
-
});
|
|
559
|
-
return (legacyStoredValue && legacyStoredValue.signature) || '';
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
/**
|
|
563
|
-
* This will make sure we check for expiration before accessing local storage
|
|
564
|
-
* @param {string} key
|
|
565
|
-
*/
|
|
566
|
-
export function getFromLocalStorage(key) {
|
|
567
|
-
const storedValueExp = storage.getDataFromLocalStorage(`${key}_exp`);
|
|
568
|
-
// empty string means no expiration set
|
|
569
|
-
if (storedValueExp === '') {
|
|
570
|
-
return storage.getDataFromLocalStorage(key);
|
|
571
|
-
} else if (storedValueExp) {
|
|
572
|
-
if ((new Date(storedValueExp)).getTime() - Date.now() > 0) {
|
|
573
|
-
return storage.getDataFromLocalStorage(key);
|
|
574
|
-
}
|
|
508
|
+
function incrementNb(cachedObj) {
|
|
509
|
+
if (cachedObj && cachedObj.nbPage !== undefined) {
|
|
510
|
+
return cachedObj.nbPage + 1;
|
|
511
|
+
} else {
|
|
512
|
+
return 1;
|
|
575
513
|
}
|
|
576
|
-
// if we got here, then we have an expired item or we didn't set an
|
|
577
|
-
// expiration initially somehow, so we need to remove the item from the
|
|
578
|
-
// local storage
|
|
579
|
-
storage.removeDataFromLocalStorage(key);
|
|
580
|
-
return null;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* Ensure that we always set an expiration in local storage since
|
|
585
|
-
* by default it's not required
|
|
586
|
-
* @param {string} key
|
|
587
|
-
* @param {any} value
|
|
588
|
-
* @param {number} expDays
|
|
589
|
-
*/
|
|
590
|
-
export function storeInLocalStorage(key, value, expDays) {
|
|
591
|
-
storage.setDataInLocalStorage(`${key}_exp`, expDaysStr(expDays));
|
|
592
|
-
storage.setDataInLocalStorage(`${key}`, value);
|
|
593
514
|
}
|
|
594
515
|
|
|
595
516
|
/**
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import { logInfo, logError } from '../src/utils.js';
|
|
2
|
-
import {getGlobal} from '../src/prebidGlobal.js';
|
|
3
|
-
import {ajax} from '../src/ajax.js';
|
|
4
|
-
import {config} from '../src/config.js';
|
|
5
1
|
import MD5 from 'crypto-js/md5.js';
|
|
2
|
+
import { ACTIVITY_ENRICH_UFPD } from '../src/activities/activities.js';
|
|
3
|
+
import { activityParams } from '../src/activities/activityParams.js';
|
|
4
|
+
import { MODULE_TYPE_PREBID } from '../src/activities/modules.js';
|
|
5
|
+
import { isActivityAllowed } from '../src/activities/rules.js';
|
|
6
|
+
import { ajax } from '../src/ajax.js';
|
|
7
|
+
import { config } from '../src/config.js';
|
|
8
|
+
import { getGlobal } from '../src/prebidGlobal.js';
|
|
9
|
+
import { logError, logInfo } from '../src/utils.js';
|
|
6
10
|
|
|
7
11
|
let email;
|
|
8
12
|
let conf;
|
|
9
13
|
const LOG_PRE_FIX = 'ID-Library: ';
|
|
10
14
|
const CONF_DEFAULT_OBSERVER_DEBOUNCE_MS = 250;
|
|
11
|
-
const CONF_DEFAULT_FULL_BODY_SCAN = false;
|
|
12
|
-
const CONF_DEFAULT_INPUT_SCAN = false;
|
|
15
|
+
export const CONF_DEFAULT_FULL_BODY_SCAN = false;
|
|
16
|
+
export const CONF_DEFAULT_INPUT_SCAN = false;
|
|
13
17
|
const OBSERVER_CONFIG = {
|
|
14
18
|
subtree: true,
|
|
15
19
|
attributes: true,
|
|
@@ -257,6 +261,10 @@ export function setConfig(config) {
|
|
|
257
261
|
_logError('The required url is not configured');
|
|
258
262
|
return;
|
|
259
263
|
}
|
|
264
|
+
if (!isActivityAllowed(ACTIVITY_ENRICH_UFPD, activityParams(MODULE_TYPE_PREBID, 'idImportLibrary'))) {
|
|
265
|
+
_logError('Permission for id import was denied by CMP');
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
260
268
|
if (typeof config.debounce !== 'number') {
|
|
261
269
|
config.debounce = CONF_DEFAULT_OBSERVER_DEBOUNCE_MS;
|
|
262
270
|
_logInfo('Set default observer debounce to ' + CONF_DEFAULT_OBSERVER_DEBOUNCE_MS);
|
package/modules/ixBidAdapter.js
CHANGED
|
@@ -9,6 +9,7 @@ import { getPageTitle, getPageDescription, getPageKeywords, getConnectionDownLin
|
|
|
9
9
|
import { getDevice } from '../libraries/fpdUtils/deviceInfo.js';
|
|
10
10
|
import { getBidFloor } from '../libraries/currencyUtils/floor.js';
|
|
11
11
|
import { transformSizes, normalAdSize } from '../libraries/sizeUtils/tranformSize.js';
|
|
12
|
+
import {getDM, getHC, getHLen} from '../libraries/navigatorData/navigatorData.js';
|
|
12
13
|
|
|
13
14
|
// import { config } from '../src/config.js';
|
|
14
15
|
// import { isPubcidEnabled } from './pubCommonId.js';
|
|
@@ -230,7 +231,6 @@ function getParam(validBidRequests, bidderRequest) {
|
|
|
230
231
|
|
|
231
232
|
const timeout = bidderRequest.timeout || 2000;
|
|
232
233
|
const firstPartyData = bidderRequest.ortb2;
|
|
233
|
-
const topWindow = window.top;
|
|
234
234
|
const title = getPageTitle();
|
|
235
235
|
const desc = getPageDescription();
|
|
236
236
|
const keywords = getPageKeywords();
|
|
@@ -267,12 +267,12 @@ function getParam(validBidRequests, bidderRequest) {
|
|
|
267
267
|
title: title ? title.slice(0, 100) : undefined,
|
|
268
268
|
desc: desc ? desc.slice(0, 300) : undefined,
|
|
269
269
|
keywords: keywords ? keywords.slice(0, 100) : undefined,
|
|
270
|
-
hLen:
|
|
270
|
+
hLen: getHLen(),
|
|
271
271
|
},
|
|
272
272
|
device: {
|
|
273
273
|
nbw: getConnectionDownLink(),
|
|
274
|
-
hc:
|
|
275
|
-
dm:
|
|
274
|
+
hc: getHC(),
|
|
275
|
+
dm: getDM()
|
|
276
276
|
}
|
|
277
277
|
},
|
|
278
278
|
user: {
|
|
@@ -8,10 +8,12 @@ import {
|
|
|
8
8
|
parseUrl,
|
|
9
9
|
isEmpty,
|
|
10
10
|
triggerPixel,
|
|
11
|
+
triggerNurlWithCpm,
|
|
11
12
|
logWarn,
|
|
12
13
|
isFn,
|
|
13
14
|
isNumber,
|
|
14
15
|
isBoolean,
|
|
16
|
+
extractDomainFromHost,
|
|
15
17
|
isInteger, deepSetValue, getBidIdParameter, setOnAny
|
|
16
18
|
} from '../src/utils.js';
|
|
17
19
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
@@ -19,7 +21,7 @@ import {BANNER, NATIVE} from '../src/mediaTypes.js';
|
|
|
19
21
|
import {config} from '../src/config.js';
|
|
20
22
|
import { getStorageManager } from '../src/storageManager.js';
|
|
21
23
|
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
|
|
22
|
-
import {
|
|
24
|
+
import { getUserSyncs } from '../libraries/mgidUtils/mgidUtils.js'
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
27
|
* @typedef {import('../src/adapters/bidderFactory.js').BidRequest} BidRequest
|
|
@@ -86,7 +88,7 @@ _each(NATIVE_ASSETS, anAsset => { _NATIVE_ASSET_ID_TO_KEY_MAP[anAsset.ID] = anAs
|
|
|
86
88
|
_each(NATIVE_ASSETS, anAsset => { _NATIVE_ASSET_KEY_TO_ASSET_MAP[anAsset.KEY] = anAsset });
|
|
87
89
|
|
|
88
90
|
export const spec = {
|
|
89
|
-
VERSION: '1.
|
|
91
|
+
VERSION: '1.8',
|
|
90
92
|
code: BIDDER_CODE,
|
|
91
93
|
gvlid: GVLID,
|
|
92
94
|
supportedMediaTypes: [BANNER, NATIVE],
|
|
@@ -231,7 +233,7 @@ export const spec = {
|
|
|
231
233
|
const page = deepAccess(bidderRequest, 'refererInfo.page') || info.location
|
|
232
234
|
if (!isStr(deepAccess(request.site, 'domain'))) {
|
|
233
235
|
const hostname = parseUrl(page).hostname;
|
|
234
|
-
request.site.domain =
|
|
236
|
+
request.site.domain = extractDomainFromHostExceptLocalhost(hostname) || hostname
|
|
235
237
|
}
|
|
236
238
|
if (!isStr(deepAccess(request.site, 'page'))) {
|
|
237
239
|
request.site.page = page
|
|
@@ -344,13 +346,7 @@ export const spec = {
|
|
|
344
346
|
},
|
|
345
347
|
onBidWon: (bid) => {
|
|
346
348
|
const cpm = deepAccess(bid, 'adserverTargeting.hb_pb') || '';
|
|
347
|
-
|
|
348
|
-
bid.nurl = bid.nurl.replace(
|
|
349
|
-
/\${AUCTION_PRICE}/,
|
|
350
|
-
cpm
|
|
351
|
-
);
|
|
352
|
-
triggerPixel(bid.nurl);
|
|
353
|
-
}
|
|
349
|
+
triggerNurlWithCpm(bid, cpm)
|
|
354
350
|
if (bid.isBurl) {
|
|
355
351
|
if (bid.mediaType === BANNER) {
|
|
356
352
|
bid.ad = bid.ad.replace(
|
|
@@ -367,68 +363,7 @@ export const spec = {
|
|
|
367
363
|
}
|
|
368
364
|
logInfo(LOG_INFO_PREFIX + `onBidWon`);
|
|
369
365
|
},
|
|
370
|
-
getUserSyncs:
|
|
371
|
-
logInfo(LOG_INFO_PREFIX + `getUserSyncs`);
|
|
372
|
-
const spb = isPlainObject(config.getConfig('userSync')) &&
|
|
373
|
-
isNumber(config.getConfig('userSync').syncsPerBidder)
|
|
374
|
-
? config.getConfig('userSync').syncsPerBidder : USERSYNC_DEFAULT_CONFIG.syncsPerBidder;
|
|
375
|
-
|
|
376
|
-
if (spb > 0 && isPlainObject(syncOptions) && (syncOptions.iframeEnabled || syncOptions.pixelEnabled)) {
|
|
377
|
-
let pixels = [];
|
|
378
|
-
if (serverResponses &&
|
|
379
|
-
isArray(serverResponses) &&
|
|
380
|
-
serverResponses.length > 0 &&
|
|
381
|
-
isPlainObject(serverResponses[0].body) &&
|
|
382
|
-
isPlainObject(serverResponses[0].body.ext) &&
|
|
383
|
-
isArray(serverResponses[0].body.ext.cm) &&
|
|
384
|
-
serverResponses[0].body.ext.cm.length > 0) {
|
|
385
|
-
pixels = serverResponses[0].body.ext.cm;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
const syncs = [];
|
|
389
|
-
const query = [];
|
|
390
|
-
query.push('cbuster={cbuster}');
|
|
391
|
-
query.push('gdpr_consent=' + encodeURIComponent(isPlainObject(gdprConsent) && isStr(gdprConsent?.consentString) ? gdprConsent.consentString : ''));
|
|
392
|
-
if (isPlainObject(gdprConsent) && typeof gdprConsent?.gdprApplies === 'boolean' && gdprConsent.gdprApplies) {
|
|
393
|
-
query.push('gdpr=1');
|
|
394
|
-
} else {
|
|
395
|
-
query.push('gdpr=0');
|
|
396
|
-
}
|
|
397
|
-
if (isPlainObject(uspConsent) && uspConsent?.consentString) {
|
|
398
|
-
query.push(`us_privacy=${encodeURIComponent(uspConsent?.consentString)}`);
|
|
399
|
-
}
|
|
400
|
-
if (isPlainObject(gppConsent) && gppConsent?.gppString) {
|
|
401
|
-
query.push(`gppString=${encodeURIComponent(gppConsent?.gppString)}`);
|
|
402
|
-
}
|
|
403
|
-
if (config.getConfig('coppa')) {
|
|
404
|
-
query.push('coppa=1')
|
|
405
|
-
}
|
|
406
|
-
const q = query.join('&')
|
|
407
|
-
if (syncOptions.iframeEnabled) {
|
|
408
|
-
syncs.push({
|
|
409
|
-
type: 'iframe',
|
|
410
|
-
url: 'https://cm.mgid.com/i.html?' + q.replace('{cbuster}', Math.round(new Date().getTime()))
|
|
411
|
-
});
|
|
412
|
-
} else if (syncOptions.pixelEnabled) {
|
|
413
|
-
if (pixels.length === 0) {
|
|
414
|
-
for (let i = 0; i < spb; i++) {
|
|
415
|
-
syncs.push({
|
|
416
|
-
type: 'image',
|
|
417
|
-
url: 'https://cm.mgid.com/i.gif?' + q.replace('{cbuster}', Math.round(new Date().getTime())) // randomly selects partner if sync required
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
} else {
|
|
421
|
-
for (let i = 0; i < spb && i < pixels.length; i++) {
|
|
422
|
-
syncs.push({
|
|
423
|
-
type: 'image',
|
|
424
|
-
url: pixels[i] + (pixels[i].indexOf('?') > 0 ? '&' : '?') + q.replace('{cbuster}', Math.round(new Date().getTime()))
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
return syncs;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
366
|
+
getUserSyncs: getUserSyncs,
|
|
432
367
|
};
|
|
433
368
|
|
|
434
369
|
registerBidder(spec);
|
|
@@ -479,25 +414,11 @@ function setMediaType(bid, newBid) {
|
|
|
479
414
|
}
|
|
480
415
|
}
|
|
481
416
|
|
|
482
|
-
function
|
|
417
|
+
function extractDomainFromHostExceptLocalhost(pageHost) {
|
|
483
418
|
if (pageHost === 'localhost') {
|
|
484
419
|
return 'localhost'
|
|
485
420
|
}
|
|
486
|
-
|
|
487
|
-
try {
|
|
488
|
-
let domains = /[-\w]+\.([-\w]+|[-\w]{3,}|[-\w]{1,3}\.[-\w]{2})$/i.exec(pageHost);
|
|
489
|
-
if (domains != null && domains.length > 0) {
|
|
490
|
-
domain = domains[0];
|
|
491
|
-
for (let i = 1; i < domains.length; i++) {
|
|
492
|
-
if (domains[i].length > domain.length) {
|
|
493
|
-
domain = domains[i];
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
} catch (e) {
|
|
498
|
-
domain = null;
|
|
499
|
-
}
|
|
500
|
-
return domain;
|
|
421
|
+
return extractDomainFromHost(pageHost)
|
|
501
422
|
}
|
|
502
423
|
|
|
503
424
|
function getLanguage() {
|
|
@@ -675,33 +596,25 @@ function commonNativeRequestObject(nativeAsset, params) {
|
|
|
675
596
|
function parseNativeResponse(bid, newBid) {
|
|
676
597
|
newBid.native = {};
|
|
677
598
|
if (bid.hasOwnProperty('adm')) {
|
|
678
|
-
let
|
|
599
|
+
let nativeAdm = '';
|
|
679
600
|
try {
|
|
680
|
-
|
|
601
|
+
nativeAdm = JSON.parse(bid.adm);
|
|
681
602
|
} catch (ex) {
|
|
682
603
|
logWarn(LOG_WARN_PREFIX + 'Error: Cannot parse native response for ad response: ' + newBid.adm);
|
|
683
604
|
return;
|
|
684
605
|
}
|
|
685
|
-
if (
|
|
606
|
+
if (nativeAdm && nativeAdm.native && nativeAdm.native.assets && nativeAdm.native.assets.length > 0) {
|
|
686
607
|
newBid.mediaType = NATIVE;
|
|
687
|
-
for (let i = 0, len =
|
|
688
|
-
switch (
|
|
608
|
+
for (let i = 0, len = nativeAdm.native.assets.length; i < len; i++) {
|
|
609
|
+
switch (nativeAdm.native.assets[i].id) {
|
|
689
610
|
case NATIVE_ASSETS.TITLE.ID:
|
|
690
|
-
newBid.native.title =
|
|
611
|
+
newBid.native.title = nativeAdm.native.assets[i].title && nativeAdm.native.assets[i].title.text;
|
|
691
612
|
break;
|
|
692
613
|
case NATIVE_ASSETS.IMAGE.ID:
|
|
693
|
-
newBid.native.image =
|
|
694
|
-
url: adm.native.assets[i].img && adm.native.assets[i].img.url,
|
|
695
|
-
height: adm.native.assets[i].img && adm.native.assets[i].img.h,
|
|
696
|
-
width: adm.native.assets[i].img && adm.native.assets[i].img.w,
|
|
697
|
-
};
|
|
614
|
+
newBid.native.image = copyFromAdmAsset(nativeAdm.native.assets[i]);
|
|
698
615
|
break;
|
|
699
616
|
case NATIVE_ASSETS.ICON.ID:
|
|
700
|
-
newBid.native.icon =
|
|
701
|
-
url: adm.native.assets[i].img && adm.native.assets[i].img.url,
|
|
702
|
-
height: adm.native.assets[i].img && adm.native.assets[i].img.h,
|
|
703
|
-
width: adm.native.assets[i].img && adm.native.assets[i].img.w,
|
|
704
|
-
};
|
|
617
|
+
newBid.native.icon = copyFromAdmAsset(nativeAdm.native.assets[i]);
|
|
705
618
|
break;
|
|
706
619
|
case NATIVE_ASSETS.SPONSOREDBY.ID:
|
|
707
620
|
case NATIVE_ASSETS.SPONSORED.ID:
|
|
@@ -711,14 +624,14 @@ function parseNativeResponse(bid, newBid) {
|
|
|
711
624
|
case NATIVE_ASSETS.BODY.ID:
|
|
712
625
|
case NATIVE_ASSETS.DISPLAYURL.ID:
|
|
713
626
|
case NATIVE_ASSETS.CTA.ID:
|
|
714
|
-
newBid.native[spec.NATIVE_ASSET_ID_TO_KEY_MAP[
|
|
627
|
+
newBid.native[spec.NATIVE_ASSET_ID_TO_KEY_MAP[nativeAdm.native.assets[i].id]] = nativeAdm.native.assets[i].data && nativeAdm.native.assets[i].data.value;
|
|
715
628
|
break;
|
|
716
629
|
}
|
|
717
630
|
}
|
|
718
|
-
newBid.native.clickUrl =
|
|
719
|
-
newBid.native.clickTrackers = (
|
|
720
|
-
newBid.native.impressionTrackers =
|
|
721
|
-
newBid.native.jstracker =
|
|
631
|
+
newBid.native.clickUrl = nativeAdm.native.link && nativeAdm.native.link.url;
|
|
632
|
+
newBid.native.clickTrackers = (nativeAdm.native.link && nativeAdm.native.link.clicktrackers) || [];
|
|
633
|
+
newBid.native.impressionTrackers = nativeAdm.native.imptrackers || [];
|
|
634
|
+
newBid.native.jstracker = nativeAdm.native.jstracker || [];
|
|
722
635
|
newBid.width = 0;
|
|
723
636
|
newBid.height = 0;
|
|
724
637
|
}
|
|
@@ -778,3 +691,11 @@ function getBidFloor(bid, cur) {
|
|
|
778
691
|
}
|
|
779
692
|
return {floor: bidFloor, cur: cur}
|
|
780
693
|
}
|
|
694
|
+
|
|
695
|
+
function copyFromAdmAsset(asset) {
|
|
696
|
+
return {
|
|
697
|
+
url: asset.img && asset.img.url,
|
|
698
|
+
height: asset.img && asset.img.h,
|
|
699
|
+
width: asset.img && asset.img.w,
|
|
700
|
+
}
|
|
701
|
+
}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { isPlainObject, isNumber, isArray, isStr } from '../src/utils.js';
|
|
2
1
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
2
|
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
4
|
-
import { config } from '../src/config.js';
|
|
5
|
-
import { USERSYNC_DEFAULT_CONFIG } from '../src/userSync.js';
|
|
6
3
|
import { isBidRequestValid, buildRequestsBase, interpretResponse } from '../libraries/teqblazeUtils/bidderUtils.js';
|
|
4
|
+
import { getUserSyncs } from '../libraries/mgidUtils/mgidUtils.js'
|
|
7
5
|
|
|
8
6
|
const BIDDER_CODE = 'mgidX';
|
|
9
7
|
const GVLID = 358;
|
|
10
8
|
const AD_URL = 'https://#{REGION}#.mgid.com/pbjs';
|
|
11
|
-
const PIXEL_SYNC_URL = 'https://cm.mgid.com/i.gif';
|
|
12
|
-
const IFRAME_SYNC_URL = 'https://cm.mgid.com/i.html';
|
|
13
9
|
|
|
14
10
|
const buildRequests = (validBidRequests = [], bidderRequest = {}) => {
|
|
15
11
|
const request = buildRequestsBase({ adUrl: AD_URL, validBidRequests, bidderRequest });
|
|
@@ -33,67 +29,7 @@ export const spec = {
|
|
|
33
29
|
buildRequests,
|
|
34
30
|
interpretResponse,
|
|
35
31
|
|
|
36
|
-
getUserSyncs:
|
|
37
|
-
const spb = isPlainObject(config.getConfig('userSync')) &&
|
|
38
|
-
isNumber(config.getConfig('userSync').syncsPerBidder)
|
|
39
|
-
? config.getConfig('userSync').syncsPerBidder : USERSYNC_DEFAULT_CONFIG.syncsPerBidder;
|
|
40
|
-
|
|
41
|
-
if (spb > 0 && isPlainObject(syncOptions) && (syncOptions.iframeEnabled || syncOptions.pixelEnabled)) {
|
|
42
|
-
let pixels = [];
|
|
43
|
-
if (serverResponses &&
|
|
44
|
-
isArray(serverResponses) &&
|
|
45
|
-
serverResponses.length > 0 &&
|
|
46
|
-
isPlainObject(serverResponses[0].body) &&
|
|
47
|
-
isPlainObject(serverResponses[0].body.ext) &&
|
|
48
|
-
isArray(serverResponses[0].body.ext.cm) &&
|
|
49
|
-
serverResponses[0].body.ext.cm.length > 0) {
|
|
50
|
-
pixels = serverResponses[0].body.ext.cm;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const syncs = [];
|
|
54
|
-
const query = [];
|
|
55
|
-
query.push('cbuster={cbuster}');
|
|
56
|
-
query.push('gdpr_consent=' + encodeURIComponent(isPlainObject(gdprConsent) && isStr(gdprConsent?.consentString) ? gdprConsent.consentString : ''));
|
|
57
|
-
if (isPlainObject(gdprConsent) && typeof gdprConsent?.gdprApplies === 'boolean' && gdprConsent.gdprApplies) {
|
|
58
|
-
query.push('gdpr=1');
|
|
59
|
-
} else {
|
|
60
|
-
query.push('gdpr=0');
|
|
61
|
-
}
|
|
62
|
-
if (isPlainObject(uspConsent) && uspConsent?.consentString) {
|
|
63
|
-
query.push(`us_privacy=${encodeURIComponent(uspConsent?.consentString)}`);
|
|
64
|
-
}
|
|
65
|
-
if (isPlainObject(gppConsent) && gppConsent?.gppString) {
|
|
66
|
-
query.push(`gppString=${encodeURIComponent(gppConsent?.gppString)}`);
|
|
67
|
-
}
|
|
68
|
-
if (config.getConfig('coppa')) {
|
|
69
|
-
query.push('coppa=1')
|
|
70
|
-
}
|
|
71
|
-
const q = query.join('&')
|
|
72
|
-
if (syncOptions.iframeEnabled) {
|
|
73
|
-
syncs.push({
|
|
74
|
-
type: 'iframe',
|
|
75
|
-
url: IFRAME_SYNC_URL + '?' + q.replace('{cbuster}', Math.round(new Date().getTime()))
|
|
76
|
-
});
|
|
77
|
-
} else if (syncOptions.pixelEnabled) {
|
|
78
|
-
if (pixels.length === 0) {
|
|
79
|
-
for (let i = 0; i < spb; i++) {
|
|
80
|
-
syncs.push({
|
|
81
|
-
type: 'image',
|
|
82
|
-
url: PIXEL_SYNC_URL + '?' + q.replace('{cbuster}', Math.round(new Date().getTime())) // randomly selects partner if sync required
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
} else {
|
|
86
|
-
for (let i = 0; i < spb && i < pixels.length; i++) {
|
|
87
|
-
syncs.push({
|
|
88
|
-
type: 'image',
|
|
89
|
-
url: pixels[i] + (pixels[i].indexOf('?') > 0 ? '&' : '?') + q.replace('{cbuster}', Math.round(new Date().getTime()))
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return syncs;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
32
|
+
getUserSyncs: getUserSyncs,
|
|
97
33
|
};
|
|
98
34
|
|
|
99
35
|
registerBidder(spec);
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This module adds the Mobian RTD provider to the real time data module
|
|
3
3
|
* The {@link module:modules/realTimeData} module is required
|
|
4
|
-
* @module modules/anonymisedRtdProvider
|
|
5
|
-
* @requires module:modules/realTimeData
|
|
6
4
|
*/
|
|
7
5
|
import { submodule } from '../src/hook.js';
|
|
8
6
|
import { ajaxBuilder } from '../src/ajax.js';
|
|
9
|
-
import { deepSetValue } from '../src/utils.js';
|
|
7
|
+
import { deepSetValue, safeJSONParse } from '../src/utils.js';
|
|
10
8
|
|
|
11
9
|
/**
|
|
12
10
|
* @typedef {import('../modules/rtdModule/index.js').RtdSubmodule} RtdSubmodule
|
|
@@ -24,6 +22,7 @@ export const mobianBrandSafetySubmodule = {
|
|
|
24
22
|
function init() {
|
|
25
23
|
return true;
|
|
26
24
|
}
|
|
25
|
+
|
|
27
26
|
function getBidRequestData(bidReqConfig, callback, config) {
|
|
28
27
|
const { site: ortb2Site } = bidReqConfig.ortb2Fragments.global;
|
|
29
28
|
const pageUrl = encodeURIComponent(getPageUrl());
|
|
@@ -33,20 +32,35 @@ function getBidRequestData(bidReqConfig, callback, config) {
|
|
|
33
32
|
|
|
34
33
|
return new Promise((resolve) => {
|
|
35
34
|
ajax(requestUrl, {
|
|
36
|
-
success: function(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (response[risks[i]]) {
|
|
43
|
-
mobianGarmRisk = riskLevels[i];
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
35
|
+
success: function(responseData) {
|
|
36
|
+
let response = safeJSONParse(responseData);
|
|
37
|
+
if (!response) {
|
|
38
|
+
resolve({});
|
|
39
|
+
callback();
|
|
40
|
+
return;
|
|
46
41
|
}
|
|
42
|
+
|
|
43
|
+
let mobianRisk = response.garm_risk || 'unknown';
|
|
44
|
+
|
|
45
|
+
const categories = Object.keys(response)
|
|
46
|
+
.filter(key => key.startsWith('garm_content_category_') && response[key])
|
|
47
|
+
.map(key => key.replace('garm_content_category_', ''));
|
|
48
|
+
|
|
49
|
+
const sentiment = Object.keys(response)
|
|
50
|
+
.find(key => key.startsWith('sentiment_') && response[key])
|
|
51
|
+
?.replace('sentiment_', '') || 'unknown';
|
|
52
|
+
|
|
53
|
+
const emotions = Object.keys(response)
|
|
54
|
+
.filter(key => key.startsWith('emotion_') && response[key])
|
|
55
|
+
.map(key => key.replace('emotion_', ''));
|
|
56
|
+
|
|
47
57
|
const risk = {
|
|
48
|
-
'
|
|
58
|
+
'risk': mobianRisk,
|
|
59
|
+
'contentCategories': categories,
|
|
60
|
+
'sentiment': sentiment,
|
|
61
|
+
'emotions': emotions
|
|
49
62
|
};
|
|
63
|
+
|
|
50
64
|
resolve(risk);
|
|
51
65
|
deepSetValue(ortb2Site.ext, 'data.mobian', risk);
|
|
52
66
|
callback()
|
package/modules/omsBidAdapter.js
CHANGED
|
@@ -136,7 +136,7 @@ function buildRequests(bidReqs, bidderRequest) {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
function isBidRequestValid(bid) {
|
|
139
|
-
if (
|
|
139
|
+
if (!bid.params || !bid.params.publisherId) {
|
|
140
140
|
return false;
|
|
141
141
|
}
|
|
142
142
|
|