prebid.js 7.10.0 → 7.13.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 +16 -10
- package/.github/codeql/codeql-config.yml +4 -0
- package/.github/workflows/codeql-analysis.yml +73 -0
- package/.github/workflows/issue_tracker.yml +1 -1
- package/README.md +0 -2
- package/babelConfig.js +10 -4
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/acuityAdsBidAdapter.js +1 -0
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adkernelBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adriverBidAdapter.js +1 -1
- package/dist/adriverIdSystem.js +1 -1
- package/dist/adtelligentBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -0
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/alkimiBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/aniviewBidAdapter.js +1 -1
- package/dist/aolBidAdapter.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/audiencerunBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/beopBidAdapter.js +1 -1
- package/dist/betweenBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/bidwatchAnalyticsAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bluebillywigBidAdapter.js +1 -1
- package/dist/brandmetricsRtdProvider.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/browsiRtdProvider.js +1 -1
- package/dist/cleanioRtdProvider.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consentManagement.js +1 -1
- package/dist/consentManagementUsp.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/cpmstarBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/currency.js +1 -1
- package/dist/datawrkzBidAdapter.js +1 -0
- package/dist/debugging-standalone.js +1 -1
- package/dist/dfpAdServerVideo.js +1 -1
- package/dist/dgkeywordRtdProvider.js +1 -1
- package/dist/displayioBidAdapter.js +1 -3
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/enrichmentFpdModule.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/imRtdProvider.js +1 -1
- package/dist/impactifyBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.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 -0
- package/dist/limelightDigitalBidAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/mabidderBidAdapter.js +1 -0
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediagoBidAdapter.js +1 -0
- package/dist/mediakeysBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/nextMillenniumBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +153 -147
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/oneKeyIdSystem.js +1 -0
- package/dist/oneKeyRtdProvider.js +1 -0
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxAnalyticsAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/permutiveRtdProvider.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +2 -2
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/rasBidAdapter.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/rtbhouseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/tappxBidAdapter.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/trustpidSystem.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/viewability.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspBidAdapter.js +1 -1
- package/integrationExamples/gpt/permutiveRtdProvider_example.html +1 -1
- package/karma.conf.maker.js +2 -13
- package/modules/.submodules.json +2 -0
- package/modules/acuityAdsBidAdapter.js +207 -0
- package/modules/acuityAdsBidAdapter.md +79 -0
- package/modules/adagioBidAdapter.js +2 -3
- package/modules/adgenerationBidAdapter.js +2 -2
- package/modules/adkernelBidAdapter.js +28 -12
- package/modules/admixerBidAdapter.js +1 -1
- package/modules/adnowBidAdapter.js +1 -1
- package/modules/adpod.js +1 -1
- package/modules/adrelevantisBidAdapter.js +2 -2
- package/modules/adriverBidAdapter.js +5 -12
- package/modules/adriverIdSystem.js +2 -1
- package/modules/adtargetBidAdapter.js +1 -1
- package/modules/adtelligentBidAdapter.js +6 -2
- package/modules/adtrgtmeBidAdapter.js +333 -0
- package/modules/adtrgtmeBidAdapter.md +69 -0
- package/modules/adtrueBidAdapter.js +1 -1
- package/modules/adxpremiumAnalyticsAdapter.js +1 -1
- package/modules/adyoulikeBidAdapter.js +1 -1
- package/modules/alkimiBidAdapter.js +2 -1
- package/modules/aniviewBidAdapter.js +1 -1
- package/modules/appnexusBidAdapter.js +13 -93
- package/modules/apstreamBidAdapter.js +2 -2
- package/modules/beopBidAdapter.js +4 -4
- package/modules/betweenBidAdapter.js +4 -4
- package/modules/bidwatchAnalyticsAdapter.js +112 -59
- package/modules/bizzclickBidAdapter.js +1 -1
- package/modules/brightMountainMediaBidAdapter.js +1 -1
- package/modules/browsiRtdProvider.js +24 -10
- package/modules/cleanmedianetBidAdapter.js +1 -1
- package/modules/consentManagement.js +1 -1
- package/modules/consentManagementUsp.js +1 -1
- package/modules/consumableBidAdapter.js +43 -3
- package/modules/cpmstarBidAdapter.js +23 -13
- package/modules/criteoBidAdapter.js +19 -13
- package/modules/currency.js +1 -0
- package/modules/cwireBidAdapter.js +1 -1
- package/modules/datablocksBidAdapter.js +1 -1
- package/modules/datawrkzBidAdapter.js +633 -0
- package/modules/datawrkzBidAdapter.md +160 -0
- package/modules/dfpAdServerVideo.js +2 -2
- package/modules/dgkeywordRtdProvider.js +10 -1
- package/modules/displayioBidAdapter.js +92 -97
- package/modules/dspxBidAdapter.js +1 -1
- package/modules/e_volutionBidAdapter.js +3 -3
- package/modules/ebdrBidAdapter.js +1 -1
- package/modules/emx_digitalBidAdapter.js +1 -1
- package/modules/enrichmentFpdModule.js +11 -0
- package/modules/fabrickIdSystem.js +2 -2
- package/modules/gamoshiBidAdapter.js +1 -1
- package/modules/getintentBidAdapter.js +1 -1
- package/modules/gjirafaBidAdapter.js +2 -2
- package/modules/goldbachBidAdapter.js +8 -8
- package/modules/gothamadsBidAdapter.js +2 -2
- package/modules/gumgumBidAdapter.js +3 -3
- package/modules/h12mediaBidAdapter.js +1 -1
- package/modules/id5AnalyticsAdapter.js +1 -1
- package/modules/id5IdSystem.js +160 -111
- package/modules/id5IdSystem.md +16 -14
- package/modules/imRtdProvider.js +20 -7
- package/modules/imRtdProvider.md +3 -1
- package/modules/impactifyBidAdapter.js +1 -1
- package/modules/improvedigitalBidAdapter.js +50 -28
- package/modules/inskinBidAdapter.js +1 -1
- package/modules/insticatorBidAdapter.js +1 -1
- package/modules/integr8BidAdapter.js +2 -2
- package/modules/intentIqIdSystem.js +2 -2
- package/modules/interactiveOffersBidAdapter.js +1 -1
- package/modules/iqmBidAdapter.js +1 -1
- package/modules/ixBidAdapter.js +21 -328
- package/modules/ixBidAdapter.md +1 -19
- package/modules/kargoBidAdapter.js +4 -5
- package/modules/krushmediaBidAdapter.js +2 -2
- package/modules/lassoBidAdapter.js +3 -3
- package/modules/lifestreetBidAdapter.js +143 -0
- package/modules/limelightDigitalBidAdapter.js +2 -1
- package/modules/livewrappedAnalyticsAdapter.js +3 -3
- package/modules/lkqdBidAdapter.js +3 -3
- package/modules/loganBidAdapter.js +2 -2
- package/modules/luponmediaBidAdapter.js +3 -3
- package/modules/mabidderBidAdapter.js +60 -0
- package/modules/mabidderBidAdapter.md +31 -0
- package/modules/malltvBidAdapter.js +2 -2
- package/modules/mediagoBidAdapter.js +462 -0
- package/modules/mediagoBidAdapter.md +34 -0
- package/modules/mediakeysBidAdapter.js +2 -2
- package/modules/mgidBidAdapter.js +2 -2
- package/modules/nextMillenniumBidAdapter.js +25 -6
- package/modules/nobidBidAdapter.js +2 -2
- package/modules/novatiqIdSystem.js +1 -1
- package/modules/oneKeyIdSystem.js +78 -0
- package/modules/oneKeyIdSystem.md +109 -0
- package/modules/oneKeyRtdProvider.js +98 -0
- package/modules/oneKeyRtdProvider.md +127 -0
- package/modules/open8BidAdapter.js +1 -1
- package/modules/openwebBidAdapter.js +1 -1
- package/modules/openxAnalyticsAdapter.js +5 -744
- package/modules/openxAnalyticsAdapter.md +4 -0
- package/modules/openxBidAdapter.js +3 -3
- package/modules/permutiveRtdProvider.js +55 -8
- package/modules/pixfutureBidAdapter.js +1 -1
- package/modules/prebidmanagerAnalyticsAdapter.js +1 -1
- package/modules/priceFloors.js +1 -1
- package/modules/pubmaticAnalyticsAdapter.js +1 -1
- package/modules/pubmaticBidAdapter.js +19 -1
- package/modules/pubwiseAnalyticsAdapter.js +1 -1
- package/modules/pubwiseBidAdapter.js +3 -3
- package/modules/pubxBidAdapter.js +1 -1
- package/modules/pubxaiAnalyticsAdapter.js +2 -2
- package/modules/quantcastIdSystem.js +1 -1
- package/modules/radsBidAdapter.js +1 -1
- package/modules/rasBidAdapter.js +8 -0
- package/modules/rasBidAdapter.md +14 -13
- package/modules/revcontentBidAdapter.js +1 -1
- package/modules/richaudienceBidAdapter.js +1 -1
- package/modules/rtbhouseBidAdapter.js +25 -1
- package/modules/schain.js +1 -1
- package/modules/seedtagBidAdapter.md +25 -56
- package/modules/showheroes-bsBidAdapter.js +1 -1
- package/modules/sizeMappingV2.js +1 -1
- package/modules/smaatoBidAdapter.js +2 -2
- package/modules/sonobiAnalyticsAdapter.js +1 -1
- package/modules/sonobiBidAdapter.js +4 -3
- package/modules/staqAnalyticsAdapter.js +1 -1
- package/modules/tappxBidAdapter.js +11 -2
- package/modules/targetVideoBidAdapter.js +1 -1
- package/modules/theAdxBidAdapter.js +2 -2
- package/modules/tpmnBidAdapter.js +1 -1
- package/modules/trionBidAdapter.js +2 -2
- package/modules/tripleliftBidAdapter.js +20 -1
- package/modules/trustpidSystem.js +6 -42
- package/modules/trustpidSystem.md +10 -10
- package/modules/underdogmediaBidAdapter.js +1 -1
- package/modules/userId/eids.js +26 -0
- package/modules/userId/userId.md +2 -2
- package/modules/vdoaiBidAdapter.js +1 -1
- package/modules/vidazooBidAdapter.js +7 -5
- package/modules/vidoomyBidAdapter.js +1 -1
- package/modules/viewability.js +14 -14
- package/modules/winrBidAdapter.js +1 -1
- package/modules/yahoosspBidAdapter.js +3 -3
- package/modules/yandexBidAdapter.js +1 -1
- package/modules/yieldmoBidAdapter.js +3 -3
- package/modules/yieldoneBidAdapter.js +2 -2
- package/modules/zeta_global_sspBidAdapter.js +24 -21
- package/package.json +3 -3
- package/src/Renderer.js +1 -1
- package/src/adloader.js +2 -1
- package/src/adserver.js +0 -56
- package/src/auction.js +60 -16
- package/src/bidfactory.js +1 -1
- package/src/native.js +75 -60
- package/src/refererDetection.js +12 -1
- package/src/sizeMapping.js +5 -7
- package/src/targeting.js +1 -1
- package/src/userSync.js +1 -1
- package/src/utils/promise.js +3 -1
- package/src/utils.js +27 -0
- package/src/video.js +5 -4
- package/src/videoCache.js +8 -2
- package/test/pages/instream.html +2 -2
- package/test/spec/modules/acuityAdsBidAdapter_spec.js +398 -0
- package/test/spec/modules/adagioBidAdapter_spec.js +2 -0
- package/test/spec/modules/adkernelBidAdapter_spec.js +11 -2
- package/test/spec/modules/adriverBidAdapter_spec.js +6 -13
- package/test/spec/modules/adriverIdSystem_spec.js +3 -8
- package/test/spec/modules/adtelligentBidAdapter_spec.js +2 -0
- package/test/spec/modules/adtrgtmeBidAdapter_spec.js +802 -0
- package/test/spec/modules/alkimiBidAdapter_spec.js +2 -1
- package/test/spec/modules/appnexusBidAdapter_spec.js +1 -0
- package/test/spec/modules/beopBidAdapter_spec.js +11 -0
- package/test/spec/modules/betweenBidAdapter_spec.js +17 -0
- package/test/spec/modules/bidwatchAnalyticsAdapter_spec.js +28 -12
- package/test/spec/modules/big-richmediaBidAdapter_spec.js +1 -0
- package/test/spec/modules/browsiRtdProvider_spec.js +40 -1
- package/test/spec/modules/consumableBidAdapter_spec.js +158 -0
- package/test/spec/modules/cpmstarBidAdapter_spec.js +1 -1
- package/test/spec/modules/criteoBidAdapter_spec.js +35 -26
- package/test/spec/modules/currency_spec.js +22 -0
- package/test/spec/modules/datawrkzBidAdapter_spec.js +656 -0
- package/test/spec/modules/dgkeywordRtdProvider_spec.js +1 -1
- package/test/spec/modules/displayioBidAdapter_spec.js +16 -52
- package/test/spec/modules/enrichmentFpdModule_spec.js +16 -1
- package/test/spec/modules/fpdModule_spec.js +2 -1
- package/test/spec/modules/id5IdSystem_spec.js +529 -172
- package/test/spec/modules/imRtdProvider_spec.js +10 -5
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +9 -13
- package/test/spec/modules/ixBidAdapter_spec.js +216 -123
- package/test/spec/modules/kargoBidAdapter_spec.js +11 -2
- package/test/spec/modules/lifestreetBidAdapter_spec.js +232 -0
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +59 -7
- package/test/spec/modules/mabidderBidAdapter_spec.js +125 -0
- package/test/spec/modules/mediagoBidAdapter_spec.js +97 -0
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +2 -7
- package/test/spec/modules/oneKeyIdSystem_spec.js +107 -0
- package/test/spec/modules/oneKeyRtdProvider_spec.js +152 -0
- package/test/spec/modules/openxAnalyticsAdapter_spec.js +6 -638
- package/test/spec/modules/permutiveRtdProvider_spec.js +152 -2
- package/test/spec/modules/pubmaticBidAdapter_spec.js +69 -4
- package/test/spec/modules/rasBidAdapter_spec.js +2 -0
- package/test/spec/modules/tripleliftBidAdapter_spec.js +18 -0
- package/test/spec/modules/trustpidSystem_spec.js +27 -45
- package/test/spec/modules/vidazooBidAdapter_spec.js +36 -23
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +59 -0
- package/test/spec/native_spec.js +257 -2
- package/test/spec/videoCache_spec.js +37 -7
|
@@ -321,7 +321,7 @@ function buildRequests(validBidRequests, bidderRequest) {
|
|
|
321
321
|
data.to = to;
|
|
322
322
|
|
|
323
323
|
// ADTS-169 add adUnitCode to requests
|
|
324
|
-
if (adUnitCode) data.aun = adUnitCode
|
|
324
|
+
if (adUnitCode) data.aun = adUnitCode;
|
|
325
325
|
|
|
326
326
|
// ADTS-134 Retrieve ID envelopes
|
|
327
327
|
for (const eid in eids) data[eid] = eids[eid];
|
|
@@ -374,7 +374,7 @@ function buildRequests(validBidRequests, bidderRequest) {
|
|
|
374
374
|
data.pi = 8;
|
|
375
375
|
}
|
|
376
376
|
} else { // legacy params
|
|
377
|
-
data = { ...data, ...handleLegacyParams(params, sizes) }
|
|
377
|
+
data = { ...data, ...handleLegacyParams(params, sizes) };
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
if (gdprConsent) {
|
|
@@ -400,7 +400,7 @@ function buildRequests(validBidRequests, bidderRequest) {
|
|
|
400
400
|
url: BID_ENDPOINT,
|
|
401
401
|
method: 'GET',
|
|
402
402
|
data: Object.assign(data, _getBrowserParams(topWindowUrl), _getDigiTrustQueryParams(userId))
|
|
403
|
-
})
|
|
403
|
+
});
|
|
404
404
|
});
|
|
405
405
|
return bids;
|
|
406
406
|
}
|
|
@@ -141,7 +141,7 @@ const ENABLE_FUNCTION = (config) => {
|
|
|
141
141
|
logInfo('id5Analytics: Tracking events', _this.eventsToTrack);
|
|
142
142
|
if (sampling > 0 && _this.random() < (1 / sampling)) {
|
|
143
143
|
// Init the module only if we got lucky
|
|
144
|
-
logInfo('id5Analytics: Selected by sampling. Starting up!')
|
|
144
|
+
logInfo('id5Analytics: Selected by sampling. Starting up!');
|
|
145
145
|
|
|
146
146
|
// Clean start
|
|
147
147
|
_this.eventBuffer = {};
|
package/modules/id5IdSystem.js
CHANGED
|
@@ -7,19 +7,19 @@
|
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
deepAccess,
|
|
10
|
-
logInfo,
|
|
11
10
|
deepSetValue,
|
|
12
|
-
logError,
|
|
13
11
|
isEmpty,
|
|
14
12
|
isEmptyStr,
|
|
13
|
+
logError,
|
|
14
|
+
logInfo,
|
|
15
15
|
logWarn,
|
|
16
16
|
safeJSONParse
|
|
17
17
|
} from '../src/utils.js';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
18
|
+
import {ajax} from '../src/ajax.js';
|
|
19
|
+
import {submodule} from '../src/hook.js';
|
|
20
|
+
import {getRefererInfo} from '../src/refererDetection.js';
|
|
21
|
+
import {getStorageManager} from '../src/storageManager.js';
|
|
22
|
+
import {uspDataHandler} from '../src/adapterManager.js';
|
|
23
23
|
|
|
24
24
|
const MODULE_NAME = 'id5Id';
|
|
25
25
|
const GVLID = 131;
|
|
@@ -28,10 +28,11 @@ export const ID5_STORAGE_NAME = 'id5id';
|
|
|
28
28
|
export const ID5_PRIVACY_STORAGE_NAME = `${ID5_STORAGE_NAME}_privacy`;
|
|
29
29
|
const LOCAL_STORAGE = 'html5';
|
|
30
30
|
const LOG_PREFIX = 'User ID - ID5 submodule: ';
|
|
31
|
+
const ID5_API_CONFIG_URL = 'https://id5-sync.com/api/config/prebid';
|
|
31
32
|
|
|
32
33
|
// order the legacy cookie names in reverse priority order so the last
|
|
33
34
|
// cookie in the array is the most preferred to use
|
|
34
|
-
const LEGACY_COOKIE_NAMES = [
|
|
35
|
+
const LEGACY_COOKIE_NAMES = ['pbjs-id5id', 'id5id.1st', 'id5id'];
|
|
35
36
|
|
|
36
37
|
export const storage = getStorageManager({gvlid: GVLID, moduleName: MODULE_NAME});
|
|
37
38
|
|
|
@@ -102,92 +103,27 @@ export const id5IdSubmodule = {
|
|
|
102
103
|
/**
|
|
103
104
|
* performs action to obtain id and return a value in the callback's response argument
|
|
104
105
|
* @function getId
|
|
105
|
-
* @param {SubmoduleConfig}
|
|
106
|
+
* @param {SubmoduleConfig} submoduleConfig
|
|
106
107
|
* @param {ConsentData} consentData
|
|
107
108
|
* @param {(Object|undefined)} cacheIdObj
|
|
108
109
|
* @returns {IdResponse|undefined}
|
|
109
110
|
*/
|
|
110
|
-
getId(
|
|
111
|
-
if (!hasRequiredConfig(
|
|
111
|
+
getId(submoduleConfig, consentData, cacheIdObj) {
|
|
112
|
+
if (!hasRequiredConfig(submoduleConfig)) {
|
|
112
113
|
return undefined;
|
|
113
114
|
}
|
|
114
115
|
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
'partner': config.params.partner,
|
|
122
|
-
'gdpr': hasGdpr,
|
|
123
|
-
'nbPage': incrementNb(config.params.partner),
|
|
124
|
-
'o': 'pbjs',
|
|
125
|
-
'rf': referer.topmostLocation,
|
|
126
|
-
'top': referer.reachedTop ? 1 : 0,
|
|
127
|
-
'u': referer.stack[0] || window.location.href,
|
|
128
|
-
'v': '$prebid.version$'
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
// pass in optional data, but only if populated
|
|
132
|
-
if (hasGdpr && typeof consentData.consentString !== 'undefined' && !isEmpty(consentData.consentString) && !isEmptyStr(consentData.consentString)) {
|
|
133
|
-
data.gdpr_consent = consentData.consentString;
|
|
134
|
-
}
|
|
135
|
-
if (typeof usp !== 'undefined' && !isEmpty(usp) && !isEmptyStr(usp)) {
|
|
136
|
-
data.us_privacy = usp;
|
|
137
|
-
}
|
|
138
|
-
if (typeof signature !== 'undefined' && !isEmptyStr(signature)) {
|
|
139
|
-
data.s = signature;
|
|
140
|
-
}
|
|
141
|
-
if (typeof config.params.pd !== 'undefined' && !isEmptyStr(config.params.pd)) {
|
|
142
|
-
data.pd = config.params.pd;
|
|
143
|
-
}
|
|
144
|
-
if (typeof config.params.provider !== 'undefined' && !isEmptyStr(config.params.provider)) {
|
|
145
|
-
data.provider = config.params.provider;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const abTestingConfig = getAbTestingConfig(config);
|
|
149
|
-
if (abTestingConfig.enabled === true) {
|
|
150
|
-
data.ab_testing = {
|
|
151
|
-
enabled: true,
|
|
152
|
-
control_group_pct: abTestingConfig.controlGroupPct // The server validates
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
const resp = function (callback) {
|
|
157
|
-
const callbacks = {
|
|
158
|
-
success: response => {
|
|
159
|
-
let responseObj;
|
|
160
|
-
if (response) {
|
|
161
|
-
try {
|
|
162
|
-
responseObj = JSON.parse(response);
|
|
163
|
-
logInfo(LOG_PREFIX + 'response received from the server', responseObj);
|
|
164
|
-
|
|
165
|
-
resetNb(config.params.partner);
|
|
166
|
-
|
|
167
|
-
if (responseObj.privacy) {
|
|
168
|
-
storeInLocalStorage(ID5_PRIVACY_STORAGE_NAME, JSON.stringify(responseObj.privacy), NB_EXP_DAYS);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// TODO: remove after requiring publishers to use localstorage and
|
|
172
|
-
// all publishers have upgraded
|
|
173
|
-
if (config.storage.type === LOCAL_STORAGE) {
|
|
174
|
-
removeLegacyCookies(config.params.partner);
|
|
175
|
-
}
|
|
176
|
-
} catch (error) {
|
|
177
|
-
logError(LOG_PREFIX + error);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
callback(responseObj);
|
|
181
|
-
},
|
|
182
|
-
error: error => {
|
|
116
|
+
const resp = function (cbFunction) {
|
|
117
|
+
new IdFetchFlow(submoduleConfig, consentData, cacheIdObj, uspDataHandler.getConsentData()).execute()
|
|
118
|
+
.then(response => {
|
|
119
|
+
cbFunction(response)
|
|
120
|
+
})
|
|
121
|
+
.catch(error => {
|
|
183
122
|
logError(LOG_PREFIX + 'getId fetch encountered an error', error);
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
logInfo(LOG_PREFIX + 'requesting an ID from the server', data);
|
|
188
|
-
ajax(url, callbacks, JSON.stringify(data), { method: 'POST', withCredentials: true });
|
|
123
|
+
cbFunction();
|
|
124
|
+
});
|
|
189
125
|
};
|
|
190
|
-
return {
|
|
126
|
+
return {callback: resp};
|
|
191
127
|
},
|
|
192
128
|
|
|
193
129
|
/**
|
|
@@ -212,6 +148,139 @@ export const id5IdSubmodule = {
|
|
|
212
148
|
}
|
|
213
149
|
};
|
|
214
150
|
|
|
151
|
+
class IdFetchFlow {
|
|
152
|
+
constructor(submoduleConfig, gdprConsentData, cacheIdObj, usPrivacyData) {
|
|
153
|
+
this.submoduleConfig = submoduleConfig
|
|
154
|
+
this.gdprConsentData = gdprConsentData
|
|
155
|
+
this.cacheIdObj = cacheIdObj
|
|
156
|
+
this.usPrivacyData = usPrivacyData
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
execute() {
|
|
160
|
+
return this.#callForConfig(this.submoduleConfig)
|
|
161
|
+
.then(fetchFlowConfig => {
|
|
162
|
+
return this.#callForExtensions(fetchFlowConfig.extensionsCall)
|
|
163
|
+
.then(extensionsData => {
|
|
164
|
+
return this.#callId5Fetch(fetchFlowConfig.fetchCall, extensionsData)
|
|
165
|
+
})
|
|
166
|
+
})
|
|
167
|
+
.then(fetchCallResponse => {
|
|
168
|
+
try {
|
|
169
|
+
resetNb(this.submoduleConfig.params.partner);
|
|
170
|
+
if (fetchCallResponse.privacy) {
|
|
171
|
+
storeInLocalStorage(ID5_PRIVACY_STORAGE_NAME, JSON.stringify(fetchCallResponse.privacy), NB_EXP_DAYS);
|
|
172
|
+
}
|
|
173
|
+
} catch (error) {
|
|
174
|
+
logError(LOG_PREFIX + error);
|
|
175
|
+
}
|
|
176
|
+
return fetchCallResponse;
|
|
177
|
+
})
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
#ajaxPromise(url, data, options) {
|
|
181
|
+
return new Promise((resolve, reject) => {
|
|
182
|
+
ajax(url,
|
|
183
|
+
{
|
|
184
|
+
success: function (res) {
|
|
185
|
+
resolve(res)
|
|
186
|
+
},
|
|
187
|
+
error: function (err) {
|
|
188
|
+
reject(err)
|
|
189
|
+
}
|
|
190
|
+
}, data, options)
|
|
191
|
+
})
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// eslint-disable-next-line no-dupe-class-members
|
|
195
|
+
#callForConfig(submoduleConfig) {
|
|
196
|
+
let url = submoduleConfig.params.configUrl || ID5_API_CONFIG_URL; // override for debug/test purposes only
|
|
197
|
+
return this.#ajaxPromise(url, JSON.stringify(submoduleConfig), {method: 'POST'})
|
|
198
|
+
.then(response => {
|
|
199
|
+
let responseObj = JSON.parse(response);
|
|
200
|
+
logInfo(LOG_PREFIX + 'config response received from the server', responseObj);
|
|
201
|
+
return responseObj;
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// eslint-disable-next-line no-dupe-class-members
|
|
206
|
+
#callForExtensions(extensionsCallConfig) {
|
|
207
|
+
if (extensionsCallConfig === undefined) {
|
|
208
|
+
return Promise.resolve(undefined)
|
|
209
|
+
}
|
|
210
|
+
let extensionsUrl = extensionsCallConfig.url
|
|
211
|
+
let method = extensionsCallConfig.method || 'GET'
|
|
212
|
+
let data = method === 'GET' ? undefined : JSON.stringify(extensionsCallConfig.body || {})
|
|
213
|
+
return this.#ajaxPromise(extensionsUrl, data, {'method': method})
|
|
214
|
+
.then(response => {
|
|
215
|
+
let responseObj = JSON.parse(response);
|
|
216
|
+
logInfo(LOG_PREFIX + 'extensions response received from the server', responseObj);
|
|
217
|
+
return responseObj;
|
|
218
|
+
})
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// eslint-disable-next-line no-dupe-class-members
|
|
222
|
+
#callId5Fetch(fetchCallConfig, extensionsData) {
|
|
223
|
+
let url = fetchCallConfig.url;
|
|
224
|
+
let additionalData = fetchCallConfig.overrides || {};
|
|
225
|
+
let data = {
|
|
226
|
+
...this.#createFetchRequestData(),
|
|
227
|
+
...additionalData,
|
|
228
|
+
extensions: extensionsData
|
|
229
|
+
};
|
|
230
|
+
return this.#ajaxPromise(url, JSON.stringify(data), {method: 'POST', withCredentials: true})
|
|
231
|
+
.then(response => {
|
|
232
|
+
let responseObj = JSON.parse(response);
|
|
233
|
+
logInfo(LOG_PREFIX + 'fetch response received from the server', responseObj);
|
|
234
|
+
return responseObj;
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// eslint-disable-next-line no-dupe-class-members
|
|
239
|
+
#createFetchRequestData() {
|
|
240
|
+
const params = this.submoduleConfig.params;
|
|
241
|
+
const hasGdpr = (this.gdprConsentData && typeof this.gdprConsentData.gdprApplies === 'boolean' && this.gdprConsentData.gdprApplies) ? 1 : 0;
|
|
242
|
+
const referer = getRefererInfo();
|
|
243
|
+
const signature = (this.cacheIdObj && this.cacheIdObj.signature) ? this.cacheIdObj.signature : getLegacyCookieSignature();
|
|
244
|
+
const nbPage = incrementNb(params.partner);
|
|
245
|
+
const data = {
|
|
246
|
+
'partner': params.partner,
|
|
247
|
+
'gdpr': hasGdpr,
|
|
248
|
+
'nbPage': nbPage,
|
|
249
|
+
'o': 'pbjs',
|
|
250
|
+
'rf': referer.topmostLocation,
|
|
251
|
+
'top': referer.reachedTop ? 1 : 0,
|
|
252
|
+
'u': referer.stack[0] || window.location.href,
|
|
253
|
+
'v': '$prebid.version$',
|
|
254
|
+
'storage': this.submoduleConfig.storage
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
// pass in optional data, but only if populated
|
|
258
|
+
if (hasGdpr && this.gdprConsentData.consentString !== undefined && !isEmpty(this.gdprConsentData.consentString) && !isEmptyStr(this.gdprConsentData.consentString)) {
|
|
259
|
+
data.gdpr_consent = this.gdprConsentData.consentString;
|
|
260
|
+
}
|
|
261
|
+
if (this.usPrivacyData !== undefined && !isEmpty(this.usPrivacyData) && !isEmptyStr(this.usPrivacyData)) {
|
|
262
|
+
data.us_privacy = this.usPrivacyData;
|
|
263
|
+
}
|
|
264
|
+
if (signature !== undefined && !isEmptyStr(signature)) {
|
|
265
|
+
data.s = signature;
|
|
266
|
+
}
|
|
267
|
+
if (params.pd !== undefined && !isEmptyStr(params.pd)) {
|
|
268
|
+
data.pd = params.pd;
|
|
269
|
+
}
|
|
270
|
+
if (params.provider !== undefined && !isEmptyStr(params.provider)) {
|
|
271
|
+
data.provider = params.provider;
|
|
272
|
+
}
|
|
273
|
+
const abTestingConfig = params.abTesting || {enabled: false};
|
|
274
|
+
|
|
275
|
+
if (abTestingConfig.enabled) {
|
|
276
|
+
data.ab_testing = {
|
|
277
|
+
enabled: true, control_group_pct: abTestingConfig.controlGroupPct // The server validates
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
return data;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
215
284
|
function hasRequiredConfig(config) {
|
|
216
285
|
if (!config || !config.params || !config.params.partner || typeof config.params.partner !== 'number') {
|
|
217
286
|
logError(LOG_PREFIX + 'partner required to be defined as a number');
|
|
@@ -242,25 +311,29 @@ export function expDaysStr(expDays) {
|
|
|
242
311
|
export function nbCacheName(partnerId) {
|
|
243
312
|
return `${ID5_STORAGE_NAME}_${partnerId}_nb`;
|
|
244
313
|
}
|
|
314
|
+
|
|
245
315
|
export function storeNbInCache(partnerId, nb) {
|
|
246
316
|
storeInLocalStorage(nbCacheName(partnerId), nb, NB_EXP_DAYS);
|
|
247
317
|
}
|
|
318
|
+
|
|
248
319
|
export function getNbFromCache(partnerId) {
|
|
249
320
|
let cacheNb = getFromLocalStorage(nbCacheName(partnerId));
|
|
250
321
|
return (cacheNb) ? parseInt(cacheNb) : 0;
|
|
251
322
|
}
|
|
323
|
+
|
|
252
324
|
function incrementNb(partnerId) {
|
|
253
325
|
const nb = (getNbFromCache(partnerId) + 1);
|
|
254
326
|
storeNbInCache(partnerId, nb);
|
|
255
327
|
return nb;
|
|
256
328
|
}
|
|
329
|
+
|
|
257
330
|
function resetNb(partnerId) {
|
|
258
331
|
storeNbInCache(partnerId, 0);
|
|
259
332
|
}
|
|
260
333
|
|
|
261
334
|
function getLegacyCookieSignature() {
|
|
262
335
|
let legacyStoredValue;
|
|
263
|
-
LEGACY_COOKIE_NAMES.forEach(function(cookie) {
|
|
336
|
+
LEGACY_COOKIE_NAMES.forEach(function (cookie) {
|
|
264
337
|
if (storage.getCookie(cookie)) {
|
|
265
338
|
legacyStoredValue = safeJSONParse(storage.getCookie(cookie)) || legacyStoredValue;
|
|
266
339
|
}
|
|
@@ -268,21 +341,6 @@ function getLegacyCookieSignature() {
|
|
|
268
341
|
return (legacyStoredValue && legacyStoredValue.signature) || '';
|
|
269
342
|
}
|
|
270
343
|
|
|
271
|
-
/**
|
|
272
|
-
* Remove our legacy cookie values. Needed until we move all publishers
|
|
273
|
-
* to html5 storage in a future release
|
|
274
|
-
* @param {integer} partnerId
|
|
275
|
-
*/
|
|
276
|
-
function removeLegacyCookies(partnerId) {
|
|
277
|
-
logInfo(LOG_PREFIX + 'removing legacy cookies');
|
|
278
|
-
LEGACY_COOKIE_NAMES.forEach(function(cookie) {
|
|
279
|
-
storage.setCookie(`${cookie}`, ' ', expDaysStr(-1));
|
|
280
|
-
storage.setCookie(`${cookie}_nb`, ' ', expDaysStr(-1));
|
|
281
|
-
storage.setCookie(`${cookie}_${partnerId}_nb`, ' ', expDaysStr(-1));
|
|
282
|
-
storage.setCookie(`${cookie}_last`, ' ', expDaysStr(-1));
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
|
|
286
344
|
/**
|
|
287
345
|
* This will make sure we check for expiration before accessing local storage
|
|
288
346
|
* @param {string} key
|
|
@@ -303,6 +361,7 @@ export function getFromLocalStorage(key) {
|
|
|
303
361
|
storage.removeDataFromLocalStorage(key);
|
|
304
362
|
return null;
|
|
305
363
|
}
|
|
364
|
+
|
|
306
365
|
/**
|
|
307
366
|
* Ensure that we always set an expiration in local storage since
|
|
308
367
|
* by default it's not required
|
|
@@ -315,14 +374,4 @@ export function storeInLocalStorage(key, value, expDays) {
|
|
|
315
374
|
storage.setDataInLocalStorage(`${key}`, value);
|
|
316
375
|
}
|
|
317
376
|
|
|
318
|
-
/**
|
|
319
|
-
* gets the existing abTesting config or generates a default config with abTesting off
|
|
320
|
-
*
|
|
321
|
-
* @param {SubmoduleConfig|undefined} config
|
|
322
|
-
* @returns {Object} an object which always contains at least the property "enabled"
|
|
323
|
-
*/
|
|
324
|
-
function getAbTestingConfig(config) {
|
|
325
|
-
return deepAccess(config, 'params.abTesting', { enabled: false });
|
|
326
|
-
}
|
|
327
|
-
|
|
328
377
|
submodule('userId', id5IdSubmodule);
|
package/modules/id5IdSystem.md
CHANGED
|
@@ -29,7 +29,8 @@ pbjs.setConfig({
|
|
|
29
29
|
abTesting: { // optional
|
|
30
30
|
enabled: true, // false by default
|
|
31
31
|
controlGroupPct: 0.1 // valid values are 0.0 - 1.0 (inclusive)
|
|
32
|
-
}
|
|
32
|
+
},
|
|
33
|
+
disableExtensions: false // optional
|
|
33
34
|
},
|
|
34
35
|
storage: {
|
|
35
36
|
type: 'html5', // "html5" is the required storage type
|
|
@@ -43,21 +44,22 @@ pbjs.setConfig({
|
|
|
43
44
|
});
|
|
44
45
|
```
|
|
45
46
|
|
|
46
|
-
| Param under userSync.userIds[] | Scope | Type | Description
|
|
47
|
+
| Param under userSync.userIds[] | Scope | Type | Description | Example |
|
|
47
48
|
| --- | --- | --- | --- | --- |
|
|
48
|
-
| name | Required | String | The name of this module: `"id5Id"`
|
|
49
|
-
| params | Required | Object | Details for the ID5 ID.
|
|
50
|
-
| params.partner | Required | Number | This is the ID5 Partner Number obtained from registering with ID5.
|
|
51
|
-
| params.pd | Optional | String | Partner-supplied data used for linking ID5 IDs across domains. See [our documentation](https://support.id5.io/portal/en/kb/articles/passing-partner-data-to-id5) for details on generating the string. Omit the parameter or leave as an empty string if no data to supply
|
|
52
|
-
| params.provider | Optional | String | An identifier provided by ID5 to technology partners who manage Prebid setups on behalf of publishers. Reach out to [ID5](mailto:prebid@id5.io) if you have questions about this parameter
|
|
53
|
-
| params.abTesting | Optional | Object | Allows publishers to easily run an A/B Test. If enabled and the user is in the Control Group, the ID5 ID will NOT be exposed to bid adapters for that request
|
|
54
|
-
| params.abTesting.enabled | Optional | Boolean | Set this to `true` to turn on this feature
|
|
49
|
+
| name | Required | String | The name of this module: `"id5Id"` | `"id5Id"` |
|
|
50
|
+
| params | Required | Object | Details for the ID5 ID. | |
|
|
51
|
+
| params.partner | Required | Number | This is the ID5 Partner Number obtained from registering with ID5. | `173` |
|
|
52
|
+
| params.pd | Optional | String | Partner-supplied data used for linking ID5 IDs across domains. See [our documentation](https://support.id5.io/portal/en/kb/articles/passing-partner-data-to-id5) for details on generating the string. Omit the parameter or leave as an empty string if no data to supply | `"MT1iNTBjY..."` |
|
|
53
|
+
| params.provider | Optional | String | An identifier provided by ID5 to technology partners who manage Prebid setups on behalf of publishers. Reach out to [ID5](mailto:prebid@id5.io) if you have questions about this parameter | `pubmatic-identity-hub` |
|
|
54
|
+
| params.abTesting | Optional | Object | Allows publishers to easily run an A/B Test. If enabled and the user is in the Control Group, the ID5 ID will NOT be exposed to bid adapters for that request | Disabled by default |
|
|
55
|
+
| params.abTesting.enabled | Optional | Boolean | Set this to `true` to turn on this feature | `true` or `false` |
|
|
55
56
|
| params.abTesting.controlGroupPct | Optional | Number | Must be a number between `0.0` and `1.0` (inclusive) and is used to determine the percentage of requests that fall into the control group (and thus not exposing the ID5 ID). For example, a value of `0.20` will result in 20% of requests without an ID5 ID and 80% with an ID. | `0.1` |
|
|
56
|
-
|
|
|
57
|
-
| storage
|
|
58
|
-
| storage.
|
|
59
|
-
| storage.
|
|
60
|
-
| storage.
|
|
57
|
+
| params.disableExtensions | Optional | Boolean | Set this to `true` to force turn off extensions call. Default `false` | `true` or `false` |
|
|
58
|
+
| storage | Required | Object | Storage settings for how the User ID module will cache the ID5 ID locally | |
|
|
59
|
+
| storage.type | Required | String | This is where the results of the user ID will be stored. ID5 **requires** `"html5"`. | `"html5"` |
|
|
60
|
+
| storage.name | Required | String | The name of the local storage where the user ID will be stored. ID5 **requires** `"id5id"`. | `"id5id"` |
|
|
61
|
+
| storage.expires | Optional | Integer | How long (in days) the user ID information will be stored. ID5 recommends `90`. | `90` |
|
|
62
|
+
| storage.refreshInSeconds | Optional | Integer | How many seconds until the ID5 ID will be refreshed. ID5 strongly recommends 8 hours between refreshes | `8*3600` |
|
|
61
63
|
|
|
62
64
|
**ATTENTION:** As of Prebid.js v4.14.0, ID5 requires `storage.type` to be `"html5"` and `storage.name` to be `"id5id"`. Using other values will display a warning today, but in an upcoming release, it will prevent the ID5 module from loading. This change is to ensure the ID5 module in Prebid.js interoperates properly with the [ID5 API](https://github.com/id5io/id5-api.js) and to reduce the size of publishers' first-party cookies that are sent to their web servers. If you have any questions, please reach out to us at [prebid@id5.io](mailto:prebid@id5.io).
|
|
63
65
|
|
package/modules/imRtdProvider.js
CHANGED
|
@@ -37,28 +37,40 @@ function setImDataInCookie(value) {
|
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* @param {Object} segments
|
|
42
|
+
* @param {Object} moduleConfig
|
|
43
|
+
*/
|
|
44
|
+
function getSegments(segments, moduleConfig) {
|
|
45
|
+
if (!segments) return;
|
|
46
|
+
const maxSegments = !Number.isNaN(moduleConfig.params.maxSegments) ? moduleConfig.params.maxSegments : 200;
|
|
47
|
+
return segments.slice(0, maxSegments);
|
|
48
|
+
}
|
|
49
|
+
|
|
40
50
|
/**
|
|
41
51
|
* @param {string} bidderName
|
|
42
52
|
*/
|
|
43
53
|
export function getBidderFunction(bidderName) {
|
|
44
54
|
const biddersFunction = {
|
|
45
|
-
pubmatic: function (bid, data) {
|
|
55
|
+
pubmatic: function (bid, data, moduleConfig) {
|
|
46
56
|
if (data.im_segments && data.im_segments.length) {
|
|
57
|
+
const segments = getSegments(data.im_segments, moduleConfig);
|
|
47
58
|
const dctr = deepAccess(bid, 'params.dctr');
|
|
48
59
|
deepSetValue(
|
|
49
60
|
bid,
|
|
50
61
|
'params.dctr',
|
|
51
|
-
`${dctr ? dctr + '|' : ''}im_segments=${
|
|
62
|
+
`${dctr ? dctr + '|' : ''}im_segments=${segments.join(',')}`
|
|
52
63
|
);
|
|
53
64
|
}
|
|
54
65
|
return bid
|
|
55
66
|
},
|
|
56
|
-
fluct: function (bid, data) {
|
|
67
|
+
fluct: function (bid, data, moduleConfig) {
|
|
57
68
|
if (data.im_segments && data.im_segments.length) {
|
|
69
|
+
const segments = getSegments(data.im_segments, moduleConfig);
|
|
58
70
|
deepSetValue(
|
|
59
71
|
bid,
|
|
60
72
|
'params.kv.imsids',
|
|
61
|
-
|
|
73
|
+
segments
|
|
62
74
|
);
|
|
63
75
|
}
|
|
64
76
|
return bid
|
|
@@ -88,14 +100,15 @@ export function setRealTimeData(bidConfig, moduleConfig, data) {
|
|
|
88
100
|
const utils = {deepSetValue, deepAccess, logInfo, logError, mergeDeep};
|
|
89
101
|
|
|
90
102
|
if (data.im_segments) {
|
|
103
|
+
const segments = getSegments(data.im_segments, moduleConfig);
|
|
91
104
|
const ortb2 = bidConfig.ortb2Fragments?.global || {};
|
|
92
|
-
deepSetValue(ortb2, 'user.ext.data.im_segments',
|
|
105
|
+
deepSetValue(ortb2, 'user.ext.data.im_segments', segments);
|
|
93
106
|
|
|
94
107
|
if (moduleConfig.params.setGptKeyValues || !moduleConfig.params.hasOwnProperty('setGptKeyValues')) {
|
|
95
108
|
window.googletag = window.googletag || {cmd: []};
|
|
96
109
|
window.googletag.cmd = window.googletag.cmd || [];
|
|
97
110
|
window.googletag.cmd.push(() => {
|
|
98
|
-
window.googletag.pubads().setTargeting('im_segments',
|
|
111
|
+
window.googletag.pubads().setTargeting('im_segments', segments);
|
|
99
112
|
});
|
|
100
113
|
}
|
|
101
114
|
}
|
|
@@ -107,7 +120,7 @@ export function setRealTimeData(bidConfig, moduleConfig, data) {
|
|
|
107
120
|
if (overwriteFunction) {
|
|
108
121
|
overwriteFunction(bid, data, utils, config);
|
|
109
122
|
} else if (bidderFunction) {
|
|
110
|
-
bidderFunction(bid, data);
|
|
123
|
+
bidderFunction(bid, data, moduleConfig);
|
|
111
124
|
}
|
|
112
125
|
})
|
|
113
126
|
});
|
package/modules/imRtdProvider.md
CHANGED
|
@@ -21,7 +21,8 @@ pbjs.setConfig(
|
|
|
21
21
|
waitForIt: true,
|
|
22
22
|
params: {
|
|
23
23
|
cid: 5126, // Set your Intimate Merger Customer ID here for production
|
|
24
|
-
setGptKeyValues: true
|
|
24
|
+
setGptKeyValues: true,
|
|
25
|
+
maxSegments: 200 // maximum number is 200
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
]
|
|
@@ -39,3 +40,4 @@ pbjs.setConfig(
|
|
|
39
40
|
| params | Required | Object | Details of module params. | |
|
|
40
41
|
| params.cid | Required | Number | This is the Customer ID value obtained via Intimate Merger. | `5126` |
|
|
41
42
|
| params.setGptKeyValues | Optional | Boolean | This is set targeting for GPT/GAM. Default setting is true. | `true` |
|
|
43
|
+
| params.maxSegments | Optional | Number | This is set maximum number of rtd segments at once. Default setting is 200. | `200` |
|
|
@@ -19,6 +19,7 @@ import {Renderer} from '../src/Renderer.js';
|
|
|
19
19
|
import {createEidsArray} from './userId/eids.js';
|
|
20
20
|
import {hasPurpose1Consent} from '../src/utils/gpdr.js';
|
|
21
21
|
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
|
|
22
|
+
import {loadExternalScript} from '../src/adloader.js';
|
|
22
23
|
|
|
23
24
|
const BIDDER_CODE = 'improvedigital';
|
|
24
25
|
const CREATIVE_TTL = 300;
|
|
@@ -212,7 +213,7 @@ export const spec = {
|
|
|
212
213
|
|
|
213
214
|
ID_RESPONSE.buildAd(bid, bidRequest, bidObject);
|
|
214
215
|
|
|
215
|
-
ID_RAZR.
|
|
216
|
+
ID_RAZR.forwardBid({
|
|
216
217
|
bidRequest,
|
|
217
218
|
bid
|
|
218
219
|
});
|
|
@@ -640,37 +641,58 @@ const ID_OUTSTREAM = {
|
|
|
640
641
|
};
|
|
641
642
|
|
|
642
643
|
const ID_RAZR = {
|
|
643
|
-
RENDERER_URL: 'https://
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
config: {bidRequest}
|
|
649
|
-
});
|
|
650
|
-
bid.renderer.setRender(this.render);
|
|
644
|
+
RENDERER_URL: 'https://cdn.360yield.com/razr/tag.js',
|
|
645
|
+
|
|
646
|
+
forwardBid({bidRequest, bid}) {
|
|
647
|
+
if (bid.mediaType !== BANNER) {
|
|
648
|
+
return;
|
|
651
649
|
}
|
|
652
|
-
},
|
|
653
650
|
|
|
654
|
-
|
|
655
|
-
|
|
651
|
+
const cfg = {
|
|
652
|
+
prebid: {
|
|
653
|
+
bidRequest,
|
|
654
|
+
bid
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
const cfgStr = JSON.stringify(cfg).replace(/<\/script>/g, '\\x3C/script>');
|
|
659
|
+
const s = `<script>window.__razr_config = ${cfgStr};</script>`;
|
|
660
|
+
bid.ad = bid.ad.replace(/<body[^>]*>/, match => match + s);
|
|
661
|
+
|
|
662
|
+
this.installListener();
|
|
656
663
|
},
|
|
657
664
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
)
|
|
670
|
-
|
|
665
|
+
installListener() {
|
|
666
|
+
if (this._listenerInstalled) {
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
window.addEventListener('message', function(e) {
|
|
671
|
+
const data = e.data?.razr?.load;
|
|
672
|
+
if (!data) {
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
if (e.source) {
|
|
677
|
+
data.source = e.source;
|
|
678
|
+
if (data.id) {
|
|
679
|
+
e.source.postMessage({
|
|
680
|
+
razr: {
|
|
681
|
+
id: data.id
|
|
682
|
+
}
|
|
683
|
+
}, '*');
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
const ns = window.razr = window.razr || {};
|
|
688
|
+
ns.q = ns.q || [];
|
|
689
|
+
ns.q.push(data);
|
|
690
|
+
|
|
691
|
+
if (!ns.loaded) {
|
|
692
|
+
loadExternalScript(ID_RAZR.RENDERER_URL, BIDDER_CODE);
|
|
693
|
+
}
|
|
694
|
+
});
|
|
671
695
|
|
|
672
|
-
|
|
673
|
-
razr.queue = razr.queue || [];
|
|
674
|
-
razr.queue.push(payload);
|
|
696
|
+
this._listenerInstalled = true;
|
|
675
697
|
}
|
|
676
698
|
};
|
|
@@ -184,7 +184,7 @@ export const spec = {
|
|
|
184
184
|
bid.currency = 'USD';
|
|
185
185
|
bid.creativeId = decision.adId;
|
|
186
186
|
bid.ttl = 360;
|
|
187
|
-
bid.meta = { advertiserDomains: decision.adomain ? decision.adomain : [] }
|
|
187
|
+
bid.meta = { advertiserDomains: decision.adomain ? decision.adomain : [] };
|
|
188
188
|
bid.netRevenue = true;
|
|
189
189
|
|
|
190
190
|
bidResponses.push(bid);
|