prebid.js 7.50.0 → 7.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adhashBidAdapter.js +1 -1
- package/dist/adkernelBidAdapter.js +1 -1
- package/dist/admanBidAdapter.js +1 -1
- package/dist/adnuntiusBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adrinoBidAdapter.js +1 -1
- package/dist/adriverIdSystem.js +1 -1
- package/dist/adtelligentBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/allowActivities.js +1 -0
- 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/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/cleanioRtdProvider.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectIdSystem.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dependencies.json +6 -0
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/gdprEnforcement.js +1 -1
- package/dist/glimpseBidAdapter.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/growthCodeRtdProvider.js +1 -0
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.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/kueezRtbBidAdapter.js +1 -1
- package/dist/kulturemediaBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.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/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +144 -140
- package/dist/objectGuard.js +1 -0
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/oxxionAnalyticsAdapter.js +1 -0
- package/dist/pairIdSystem.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rtdModule.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/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/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/growthcode.html +20 -9
- package/libraries/objectGuard/objectGuard.js +108 -0
- package/libraries/objectGuard/ortbGuard.js +88 -0
- package/modules/adgenerationBidAdapter.js +14 -5
- package/modules/adhashBidAdapter.js +28 -17
- package/modules/adkernelBidAdapter.js +2 -1
- package/modules/admanBidAdapter.js +30 -22
- package/modules/adnuntiusBidAdapter.js +98 -79
- package/modules/adnuntiusBidAdapter.md +2 -1
- package/modules/adqueryBidAdapter.js +7 -1
- package/modules/adrinoBidAdapter.js +1 -0
- package/modules/adriverIdSystem.js +1 -1
- package/modules/adtelligentBidAdapter.js +4 -2
- package/modules/allowActivities.js +74 -0
- package/modules/appnexusBidAdapter.js +1 -0
- package/modules/cleanioRtdProvider.js +2 -4
- package/modules/connectIdSystem.js +89 -13
- package/modules/connectIdSystem.md +4 -7
- package/modules/criteoBidAdapter.js +50 -3
- package/modules/freewheel-sspBidAdapter.js +10 -2
- package/modules/gdprEnforcement.js +98 -169
- package/modules/growthCodeRtdProvider.js +131 -0
- package/modules/growthCodeRtdProvider.md +55 -0
- package/modules/gumgumBidAdapter.js +5 -0
- package/modules/ixBidAdapter.js +5 -2
- package/modules/minutemediaBidAdapter.js +13 -3
- package/modules/oxxionAnalyticsAdapter.js +212 -0
- package/modules/oxxionAnalyticsAdapter.md +33 -0
- package/modules/pairIdSystem.js +6 -6
- package/modules/prebidServerBidAdapter/index.js +7 -8
- package/modules/pubmaticBidAdapter.js +1 -0
- package/modules/riseBidAdapter.js +13 -3
- package/modules/rtbhouseBidAdapter.md +24 -0
- package/modules/rtdModule/index.js +12 -1
- package/modules/sharethroughBidAdapter.js +2 -2
- package/modules/smartadserverBidAdapter.js +5 -0
- package/modules/stvBidAdapter.js +34 -1
- package/modules/undertoneBidAdapter.js +9 -1
- package/modules/userId/index.js +69 -41
- package/modules/yahoosspBidAdapter.js +45 -3
- package/modules/yahoosspBidAdapter.md +1 -1
- package/modules/zeta_global_sspBidAdapter.js +1 -0
- package/package.json +1 -1
- package/src/activities/activities.js +47 -0
- package/src/activities/activityParams.js +8 -0
- package/src/activities/modules.js +1 -1
- package/src/activities/params.js +59 -0
- package/src/activities/redactor.js +157 -0
- package/src/activities/rules.js +95 -0
- package/src/adapterManager.js +45 -8
- package/src/adloader.js +2 -1
- package/src/fpd/rootDomain.js +1 -1
- package/src/native.js +20 -4
- package/src/prebid.js +1 -1
- package/src/storageManager.js +57 -44
- package/src/userSync.js +35 -18
- package/test/spec/activities/allowActivites_spec.js +138 -0
- package/test/spec/activities/objectGuard_spec.js +144 -0
- package/test/spec/activities/ortbGuard_spec.js +140 -0
- package/test/spec/activities/params_spec.js +25 -0
- package/test/spec/activities/redactor_spec.js +296 -0
- package/test/spec/activities/rules_spec.js +135 -0
- package/test/spec/modules/adgenerationBidAdapter_spec.js +52 -12
- package/test/spec/modules/adhashBidAdapter_spec.js +51 -1
- package/test/spec/modules/admanBidAdapter_spec.js +1 -2
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +535 -264
- package/test/spec/modules/adqueryBidAdapter_spec.js +9 -0
- package/test/spec/modules/adrinoBidAdapter_spec.js +4 -0
- package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
- package/test/spec/modules/cleanioRtdProvider_spec.js +7 -8
- package/test/spec/modules/connectIdSystem_spec.js +291 -23
- package/test/spec/modules/criteoBidAdapter_spec.js +134 -2
- package/test/spec/modules/freewheel-sspBidAdapter_spec.js +5 -2
- package/test/spec/modules/gdprEnforcement_spec.js +127 -414
- package/test/spec/modules/growthCodeRtdProvider_spec.js +127 -0
- package/test/spec/modules/gumgumBidAdapter_spec.js +14 -0
- package/test/spec/modules/ixBidAdapter_spec.js +2 -1
- package/test/spec/modules/minutemediaBidAdapter_spec.js +69 -1
- package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +324 -0
- package/test/spec/modules/pairIdSystem_spec.js +16 -3
- package/test/spec/modules/prebidServerBidAdapter_spec.js +3 -1
- package/test/spec/modules/pubmaticBidAdapter_spec.js +7 -0
- package/test/spec/modules/realTimeDataModule_spec.js +1 -1
- package/test/spec/modules/riseBidAdapter_spec.js +69 -1
- package/test/spec/modules/sharethroughBidAdapter_spec.js +1 -1
- package/test/spec/modules/smartadserverBidAdapter_spec.js +42 -0
- package/test/spec/modules/stvBidAdapter_spec.js +13 -1
- package/test/spec/modules/undertoneBidAdapter_spec.js +57 -1
- package/test/spec/modules/userId_spec.js +80 -21
- package/test/spec/modules/yahoosspBidAdapter_spec.js +103 -51
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +4 -0
- package/test/spec/native_spec.js +12 -12
- package/test/spec/unit/core/adapterManager_spec.js +181 -1
- package/test/spec/unit/core/storageManager_spec.js +76 -68
- package/test/spec/unit/pbjs_api_spec.js +15 -25
- package/test/spec/userSync_spec.js +45 -16
|
@@ -111,6 +111,7 @@ describe('PubMatic adapter', function () {
|
|
|
111
111
|
battr: [13, 14],
|
|
112
112
|
linearity: 1,
|
|
113
113
|
placement: 2,
|
|
114
|
+
plcmt: 1,
|
|
114
115
|
minbitrate: 10,
|
|
115
116
|
maxbitrate: 10
|
|
116
117
|
}
|
|
@@ -162,6 +163,7 @@ describe('PubMatic adapter', function () {
|
|
|
162
163
|
battr: [13, 14],
|
|
163
164
|
linearity: 1,
|
|
164
165
|
placement: 2,
|
|
166
|
+
plcmt: 1,
|
|
165
167
|
minbitrate: 100,
|
|
166
168
|
maxbitrate: 4096
|
|
167
169
|
}
|
|
@@ -382,6 +384,7 @@ describe('PubMatic adapter', function () {
|
|
|
382
384
|
battr: [13, 14],
|
|
383
385
|
linearity: 1,
|
|
384
386
|
placement: 2,
|
|
387
|
+
plcmt: 1,
|
|
385
388
|
minbitrate: 100,
|
|
386
389
|
maxbitrate: 4096
|
|
387
390
|
}
|
|
@@ -508,6 +511,7 @@ describe('PubMatic adapter', function () {
|
|
|
508
511
|
battr: [13, 14],
|
|
509
512
|
linearity: 1,
|
|
510
513
|
placement: 2,
|
|
514
|
+
plcmt: 1,
|
|
511
515
|
minbitrate: 100,
|
|
512
516
|
maxbitrate: 4096
|
|
513
517
|
}
|
|
@@ -577,6 +581,7 @@ describe('PubMatic adapter', function () {
|
|
|
577
581
|
battr: [13, 14],
|
|
578
582
|
linearity: 1,
|
|
579
583
|
placement: 2,
|
|
584
|
+
plcmt: 1,
|
|
580
585
|
minbitrate: 100,
|
|
581
586
|
maxbitrate: 4096
|
|
582
587
|
}
|
|
@@ -2738,6 +2743,7 @@ describe('PubMatic adapter', function () {
|
|
|
2738
2743
|
|
|
2739
2744
|
expect(data.imp[1]['video']['linearity']).to.equal(multipleMediaRequests[1].params.video['linearity']);
|
|
2740
2745
|
expect(data.imp[1]['video']['placement']).to.equal(multipleMediaRequests[1].params.video['placement']);
|
|
2746
|
+
expect(data.imp[1]['video']['plcmt']).to.equal(multipleMediaRequests[1].params.video['plcmt']);
|
|
2741
2747
|
expect(data.imp[1]['video']['minbitrate']).to.equal(multipleMediaRequests[1].params.video['minbitrate']);
|
|
2742
2748
|
expect(data.imp[1]['video']['maxbitrate']).to.equal(multipleMediaRequests[1].params.video['maxbitrate']);
|
|
2743
2749
|
|
|
@@ -3033,6 +3039,7 @@ describe('PubMatic adapter', function () {
|
|
|
3033
3039
|
|
|
3034
3040
|
expect(data.imp[0]['video']['linearity']).to.equal(videoBidRequests[0].params.video['linearity']);
|
|
3035
3041
|
expect(data.imp[0]['video']['placement']).to.equal(videoBidRequests[0].params.video['placement']);
|
|
3042
|
+
expect(data.imp[0]['video']['plcmt']).to.equal(videoBidRequests[0].params.video['plcmt']);
|
|
3036
3043
|
expect(data.imp[0]['video']['minbitrate']).to.equal(videoBidRequests[0].params.video['minbitrate']);
|
|
3037
3044
|
expect(data.imp[0]['video']['maxbitrate']).to.equal(videoBidRequests[0].params.video['maxbitrate']);
|
|
3038
3045
|
|
|
@@ -128,7 +128,7 @@ describe('Real time module', function () {
|
|
|
128
128
|
it('should be able to modify bid request', function (done) {
|
|
129
129
|
rtdModule.setBidRequestsData(() => {
|
|
130
130
|
assert(getBidRequestDataSpy.calledTwice);
|
|
131
|
-
assert(getBidRequestDataSpy.calledWith({bidRequest: {}}));
|
|
131
|
+
assert(getBidRequestDataSpy.calledWith(sinon.match({bidRequest: {}})));
|
|
132
132
|
done();
|
|
133
133
|
}, {bidRequest: {}})
|
|
134
134
|
});
|
|
@@ -62,7 +62,8 @@ describe('riseAdapter', function () {
|
|
|
62
62
|
'mediaTypes': {
|
|
63
63
|
'video': {
|
|
64
64
|
'playerSize': [[640, 480]],
|
|
65
|
-
'context': 'instream'
|
|
65
|
+
'context': 'instream',
|
|
66
|
+
'plcmt': 1
|
|
66
67
|
}
|
|
67
68
|
},
|
|
68
69
|
'vastXml': '"<VAST version=\\\"2.0\\\">...</VAST>"'
|
|
@@ -116,6 +117,11 @@ describe('riseAdapter', function () {
|
|
|
116
117
|
expect(request.data.bids[0].placementId).to.equal(placementId);
|
|
117
118
|
});
|
|
118
119
|
|
|
120
|
+
it('sends the plcmt to ENDPOINT via POST', function () {
|
|
121
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
122
|
+
expect(request.data.bids[0].plcmt).to.equal(1);
|
|
123
|
+
});
|
|
124
|
+
|
|
119
125
|
it('sends the is_wrapper parameter to ENDPOINT via POST', function() {
|
|
120
126
|
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
121
127
|
expect(request.data.params).to.be.an('object');
|
|
@@ -342,6 +348,68 @@ describe('riseAdapter', function () {
|
|
|
342
348
|
expect(request.data.bids[0]).to.have.property('floorPrice', 1.5);
|
|
343
349
|
});
|
|
344
350
|
|
|
351
|
+
it('should check sua param in bid request', function() {
|
|
352
|
+
const sua = {
|
|
353
|
+
'platform': {
|
|
354
|
+
'brand': 'macOS',
|
|
355
|
+
'version': ['12', '4', '0']
|
|
356
|
+
},
|
|
357
|
+
'browsers': [
|
|
358
|
+
{
|
|
359
|
+
'brand': 'Chromium',
|
|
360
|
+
'version': [ '106', '0', '5249', '119' ]
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
'brand': 'Google Chrome',
|
|
364
|
+
'version': [ '106', '0', '5249', '119' ]
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
'brand': 'Not;A=Brand',
|
|
368
|
+
'version': [ '99', '0', '0', '0' ]
|
|
369
|
+
}
|
|
370
|
+
],
|
|
371
|
+
'mobile': 0,
|
|
372
|
+
'model': '',
|
|
373
|
+
'bitness': '64',
|
|
374
|
+
'architecture': 'x86'
|
|
375
|
+
}
|
|
376
|
+
const bid = utils.deepClone(bidRequests[0]);
|
|
377
|
+
bid.ortb2 = {
|
|
378
|
+
'device': {
|
|
379
|
+
'sua': {
|
|
380
|
+
'platform': {
|
|
381
|
+
'brand': 'macOS',
|
|
382
|
+
'version': [ '12', '4', '0' ]
|
|
383
|
+
},
|
|
384
|
+
'browsers': [
|
|
385
|
+
{
|
|
386
|
+
'brand': 'Chromium',
|
|
387
|
+
'version': [ '106', '0', '5249', '119' ]
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
'brand': 'Google Chrome',
|
|
391
|
+
'version': [ '106', '0', '5249', '119' ]
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
'brand': 'Not;A=Brand',
|
|
395
|
+
'version': [ '99', '0', '0', '0' ]
|
|
396
|
+
}
|
|
397
|
+
],
|
|
398
|
+
'mobile': 0,
|
|
399
|
+
'model': '',
|
|
400
|
+
'bitness': '64',
|
|
401
|
+
'architecture': 'x86'
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
const requestWithSua = spec.buildRequests([bid], bidderRequest);
|
|
406
|
+
const data = requestWithSua.data;
|
|
407
|
+
expect(data.bids[0].sua).to.exist;
|
|
408
|
+
expect(data.bids[0].sua).to.deep.equal(sua);
|
|
409
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
410
|
+
expect(request.data.bids[0].sua).to.not.exist;
|
|
411
|
+
});
|
|
412
|
+
|
|
345
413
|
describe('COPPA Param', function() {
|
|
346
414
|
it('should set coppa equal 0 in bid request if coppa is set to false', function() {
|
|
347
415
|
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
2
|
import { BANNER, VIDEO } from 'src/mediaTypes.js';
|
|
3
3
|
import { config } from 'src/config.js';
|
|
4
|
+
import { deepClone } from 'src/utils.js';
|
|
4
5
|
import { spec } from 'modules/smartadserverBidAdapter.js';
|
|
5
6
|
|
|
6
7
|
// Default params with optional ones
|
|
@@ -1339,4 +1340,45 @@ describe('Smart bid adapter tests', function () {
|
|
|
1339
1340
|
expect(bannerRequest).to.have.property('formatid').and.to.equal('90');
|
|
1340
1341
|
});
|
|
1341
1342
|
});
|
|
1343
|
+
|
|
1344
|
+
describe('Global Placement ID (GPID)', function () {
|
|
1345
|
+
it('should not include gpid by default', () => {
|
|
1346
|
+
const request = spec.buildRequests(DEFAULT_PARAMS_WO_OPTIONAL);
|
|
1347
|
+
const requestContent = JSON.parse(request[0].data);
|
|
1348
|
+
|
|
1349
|
+
expect(requestContent).to.not.have.property('gdid');
|
|
1350
|
+
});
|
|
1351
|
+
|
|
1352
|
+
it('should include gpid if pbadslot in ortb2Imp', () => {
|
|
1353
|
+
const gpid = '/19968336/header-bid-tag-1';
|
|
1354
|
+
const bidRequests = deepClone(DEFAULT_PARAMS_WO_OPTIONAL);
|
|
1355
|
+
|
|
1356
|
+
bidRequests[0].ortb2Imp = {
|
|
1357
|
+
ext: {
|
|
1358
|
+
data: {
|
|
1359
|
+
pbadslot: gpid
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
};
|
|
1363
|
+
|
|
1364
|
+
const request = spec.buildRequests(bidRequests);
|
|
1365
|
+
const requestContent = JSON.parse(request[0].data);
|
|
1366
|
+
|
|
1367
|
+
expect(requestContent).to.have.property('gpid').and.to.equal(gpid);
|
|
1368
|
+
});
|
|
1369
|
+
|
|
1370
|
+
it('should include gpid if imp[].ext.gpid exists', () => {
|
|
1371
|
+
const gpid = '/1111/homepage#div-leftnav';
|
|
1372
|
+
const bidRequests = deepClone(DEFAULT_PARAMS_WO_OPTIONAL);
|
|
1373
|
+
|
|
1374
|
+
bidRequests[0].ortb2Imp = {
|
|
1375
|
+
ext: { gpid }
|
|
1376
|
+
};
|
|
1377
|
+
|
|
1378
|
+
const request = spec.buildRequests(bidRequests);
|
|
1379
|
+
const requestContent = JSON.parse(request[0].data);
|
|
1380
|
+
|
|
1381
|
+
expect(requestContent).to.have.property('gpid').and.to.equal(gpid);
|
|
1382
|
+
});
|
|
1383
|
+
});
|
|
1342
1384
|
});
|
|
@@ -60,6 +60,18 @@ describe('stvAdapter', function() {
|
|
|
60
60
|
'bidderRequestId': '22edbae2733bf61',
|
|
61
61
|
'auctionId': '1d1a030790a475',
|
|
62
62
|
'adUnitCode': 'testDiv1',
|
|
63
|
+
'schain': {
|
|
64
|
+
'ver': '1.0',
|
|
65
|
+
'complete': 0,
|
|
66
|
+
'nodes': [
|
|
67
|
+
{
|
|
68
|
+
'asi': 'reseller.com',
|
|
69
|
+
'sid': 'aaaaa',
|
|
70
|
+
'rid': 'BidRequest4',
|
|
71
|
+
'hp': 1
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
63
75
|
},
|
|
64
76
|
{
|
|
65
77
|
'bidder': 'stv',
|
|
@@ -169,7 +181,7 @@ describe('stvAdapter', function() {
|
|
|
169
181
|
expect(request1.method).to.equal('GET');
|
|
170
182
|
expect(request1.url).to.equal(ENDPOINT_URL);
|
|
171
183
|
let data = request1.data.replace(/rnd=\d+\&/g, '').replace(/ref=.*\&bid/g, 'bid').replace(/pbver=.*?&/g, 'pbver=test&');
|
|
172
|
-
expect(data).to.equal('_f=html&alternative=prebid_js&_ps=6682&srw=300&srh=250&idt=100&bid_id=30b31c1838de1e1&pbver=test&pfilter%5Bfloorprice%5D=1000000&pfilter%5Bgeo%5D%5Bcountry%5D=DE&gdpr_consent=BOJ%2FP2HOJ%2FP2HABABMAAAAAZ%2BA%3D%3D&gdpr=true&bcat=IAB2%2CIAB4&dvt=desktop&pbcode=testDiv1&media_types%5Bbanner%5D=300x250');
|
|
184
|
+
expect(data).to.equal('_f=html&alternative=prebid_js&_ps=6682&srw=300&srh=250&idt=100&bid_id=30b31c1838de1e1&pbver=test&schain=1.0,0!reseller.com,aaaaa,1,BidRequest4,,,&pfilter%5Bfloorprice%5D=1000000&pfilter%5Bgeo%5D%5Bcountry%5D=DE&gdpr_consent=BOJ%2FP2HOJ%2FP2HABABMAAAAAZ%2BA%3D%3D&gdpr=true&bcat=IAB2%2CIAB4&dvt=desktop&pbcode=testDiv1&media_types%5Bbanner%5D=300x250');
|
|
173
185
|
});
|
|
174
186
|
|
|
175
187
|
var request2 = spec.buildRequests([bidRequests[1]], bidderRequest)[0];
|
|
@@ -41,7 +41,9 @@ const videoBidReq = [{
|
|
|
41
41
|
},
|
|
42
42
|
mediaTypes: {video: {
|
|
43
43
|
context: 'outstream',
|
|
44
|
-
playerSize: [640, 480]
|
|
44
|
+
playerSize: [640, 480],
|
|
45
|
+
placement: 1,
|
|
46
|
+
plcmt: 1
|
|
45
47
|
}},
|
|
46
48
|
sizes: [[300, 250], [300, 600]],
|
|
47
49
|
bidId: '263be71e91dd9d',
|
|
@@ -184,6 +186,31 @@ const bidderReqCcpaAndGdpr = {
|
|
|
184
186
|
uspConsent: 'NY12'
|
|
185
187
|
};
|
|
186
188
|
|
|
189
|
+
const bidderReqGpp = {
|
|
190
|
+
refererInfo: {
|
|
191
|
+
topmostLocation: 'http://prebid.org/dev-docs/bidder-adaptor.html'
|
|
192
|
+
},
|
|
193
|
+
gppConsent: {
|
|
194
|
+
gppString: 'DBACNYA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA~1YNN',
|
|
195
|
+
applicableSections: [7]
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const bidderReqFullGppCcpaGdpr = {
|
|
200
|
+
refererInfo: {
|
|
201
|
+
topmostLocation: 'http://prebid.org/dev-docs/bidder-adaptor.html'
|
|
202
|
+
},
|
|
203
|
+
gppConsent: {
|
|
204
|
+
gppString: 'DBACNYA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA~1YNN',
|
|
205
|
+
applicableSections: [7]
|
|
206
|
+
},
|
|
207
|
+
gdprConsent: {
|
|
208
|
+
gdprApplies: true,
|
|
209
|
+
consentString: 'gdprConsent'
|
|
210
|
+
},
|
|
211
|
+
uspConsent: '1YNN'
|
|
212
|
+
};
|
|
213
|
+
|
|
187
214
|
const validBidRes = {
|
|
188
215
|
ad: '<div>Hello</div>',
|
|
189
216
|
publisherId: 12345,
|
|
@@ -381,6 +408,31 @@ describe('Undertone Adapter', () => {
|
|
|
381
408
|
expect(request.url).to.equal(REQ_URL);
|
|
382
409
|
expect(request.method).to.equal('POST');
|
|
383
410
|
});
|
|
411
|
+
it(`should have gppConsent fields`, function () {
|
|
412
|
+
const request = spec.buildRequests(bidReq, bidderReqGpp);
|
|
413
|
+
const domainStart = bidderReq.refererInfo.topmostLocation.indexOf('//');
|
|
414
|
+
const domainEnd = bidderReq.refererInfo.topmostLocation.indexOf('/', domainStart + 2);
|
|
415
|
+
const domain = bidderReq.refererInfo.topmostLocation.substring(domainStart + 2, domainEnd);
|
|
416
|
+
const gppStr = bidderReqGpp.gppConsent.gppString;
|
|
417
|
+
const gppSid = bidderReqGpp.gppConsent.applicableSections;
|
|
418
|
+
const REQ_URL = `${URL}?pid=${bidReq[0].params.publisherId}&domain=${domain}&gpp=${gppStr}&gpp_sid=${gppSid}`;
|
|
419
|
+
expect(request.url).to.equal(REQ_URL);
|
|
420
|
+
expect(request.method).to.equal('POST');
|
|
421
|
+
});
|
|
422
|
+
it(`should have gpp, ccpa and gdpr fields`, function () {
|
|
423
|
+
const request = spec.buildRequests(bidReq, bidderReqFullGppCcpaGdpr);
|
|
424
|
+
const domainStart = bidderReq.refererInfo.topmostLocation.indexOf('//');
|
|
425
|
+
const domainEnd = bidderReq.refererInfo.topmostLocation.indexOf('/', domainStart + 2);
|
|
426
|
+
const domain = bidderReq.refererInfo.topmostLocation.substring(domainStart + 2, domainEnd);
|
|
427
|
+
const gppStr = bidderReqFullGppCcpaGdpr.gppConsent.gppString;
|
|
428
|
+
const gppSid = bidderReqFullGppCcpaGdpr.gppConsent.applicableSections;
|
|
429
|
+
const ccpa = bidderReqFullGppCcpaGdpr.uspConsent;
|
|
430
|
+
const gdpr = bidderReqFullGppCcpaGdpr.gdprConsent.gdprApplies ? 1 : 0;
|
|
431
|
+
const gdprStr = bidderReqFullGppCcpaGdpr.gdprConsent.consentString;
|
|
432
|
+
const REQ_URL = `${URL}?pid=${bidReq[0].params.publisherId}&domain=${domain}&gdpr=${gdpr}&gdprstr=${gdprStr}&ccpa=${ccpa}&gpp=${gppStr}&gpp_sid=${gppSid}`;
|
|
433
|
+
expect(request.url).to.equal(REQ_URL);
|
|
434
|
+
expect(request.method).to.equal('POST');
|
|
435
|
+
});
|
|
384
436
|
it('should have all relevant fields', function () {
|
|
385
437
|
const request = spec.buildRequests(bidReq, bidderReq);
|
|
386
438
|
const bid1 = JSON.parse(request.data)['x-ut-hb-params'][0];
|
|
@@ -409,10 +461,14 @@ describe('Undertone Adapter', () => {
|
|
|
409
461
|
expect(bidVideo.video.playbackMethod).to.equal(2);
|
|
410
462
|
expect(bidVideo.video.maxDuration).to.equal(30);
|
|
411
463
|
expect(bidVideo.video.skippable).to.equal(true);
|
|
464
|
+
expect(bidVideo.video.placement).to.equal(1);
|
|
465
|
+
expect(bidVideo.video.plcmt).to.equal(1);
|
|
412
466
|
|
|
413
467
|
expect(bidVideo2.video.skippable).to.equal(null);
|
|
414
468
|
expect(bidVideo2.video.maxDuration).to.equal(null);
|
|
415
469
|
expect(bidVideo2.video.playbackMethod).to.equal(null);
|
|
470
|
+
expect(bidVideo2.video.placement).to.equal(null);
|
|
471
|
+
expect(bidVideo2.video.plcmt).to.equal(null);
|
|
416
472
|
});
|
|
417
473
|
it('should send all userIds data to server', function () {
|
|
418
474
|
const request = spec.buildRequests(bidReqUserIds, bidderReq);
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attachIdSystem,
|
|
3
3
|
auctionDelay,
|
|
4
|
-
coreStorage,
|
|
4
|
+
coreStorage, dep,
|
|
5
|
+
findRootDomain,
|
|
5
6
|
init,
|
|
7
|
+
PBJS_USER_ID_OPTOUT_NAME,
|
|
6
8
|
requestBidsHook,
|
|
9
|
+
requestDataDeletion,
|
|
7
10
|
setStoredConsentData,
|
|
8
11
|
setStoredValue,
|
|
9
12
|
setSubmoduleRegistry,
|
|
10
13
|
syncDelay,
|
|
11
|
-
PBJS_USER_ID_OPTOUT_NAME,
|
|
12
|
-
findRootDomain, requestDataDeletion,
|
|
13
14
|
} from 'modules/userId/index.js';
|
|
14
15
|
import {createEidsArray} from 'modules/userId/eids.js';
|
|
15
16
|
import {config} from 'src/config.js';
|
|
16
17
|
import * as utils from 'src/utils.js';
|
|
18
|
+
import {getPrebidInternal} from 'src/utils.js';
|
|
17
19
|
import * as events from 'src/events.js';
|
|
18
20
|
import CONSTANTS from 'src/constants.json';
|
|
19
21
|
import {getGlobal} from 'src/prebidGlobal.js';
|
|
20
|
-
import {
|
|
21
|
-
resetConsentData,
|
|
22
|
-
} from 'modules/consentManagement.js';
|
|
22
|
+
import {resetConsentData, } from 'modules/consentManagement.js';
|
|
23
23
|
import {server} from 'test/mocks/xhr.js';
|
|
24
24
|
import {find} from 'src/polyfill.js';
|
|
25
25
|
import {unifiedIdSubmodule} from 'modules/unifiedIdSystem.js';
|
|
@@ -27,7 +27,10 @@ import {britepoolIdSubmodule} from 'modules/britepoolIdSystem.js';
|
|
|
27
27
|
import {id5IdSubmodule} from 'modules/id5IdSystem.js';
|
|
28
28
|
import {identityLinkSubmodule} from 'modules/identityLinkIdSystem.js';
|
|
29
29
|
import {dmdIdSubmodule} from 'modules/dmdIdSystem.js';
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
liveIntentIdSubmodule,
|
|
32
|
+
setEventFiredFlag as liveIntentIdSubmoduleDoNotFireEvent
|
|
33
|
+
} from 'modules/liveIntentIdSystem.js';
|
|
31
34
|
import {merkleIdSubmodule} from 'modules/merkleIdSystem.js';
|
|
32
35
|
import {netIdSubmodule} from 'modules/netIdSystem.js';
|
|
33
36
|
import {intentIqIdSubmodule} from 'modules/intentIqIdSystem.js';
|
|
@@ -39,7 +42,6 @@ import {criteoIdSubmodule} from 'modules/criteoIdSystem.js';
|
|
|
39
42
|
import {mwOpenLinkIdSubModule} from 'modules/mwOpenLinkIdSystem.js';
|
|
40
43
|
import {tapadIdSubmodule} from 'modules/tapadIdSystem.js';
|
|
41
44
|
import {tncidSubModule} from 'modules/tncIdSystem.js';
|
|
42
|
-
import {getPrebidInternal} from 'src/utils.js';
|
|
43
45
|
import {uid2IdSubmodule} from 'modules/uid2IdSystem.js';
|
|
44
46
|
import {admixerIdSubmodule} from 'modules/admixerIdSystem.js';
|
|
45
47
|
import {deepintentDpesSubmodule} from 'modules/deepintentDpesIdSystem.js';
|
|
@@ -55,6 +57,8 @@ import {getPPID} from '../../../src/adserver.js';
|
|
|
55
57
|
import {uninstall as uninstallGdprEnforcement} from 'modules/gdprEnforcement.js';
|
|
56
58
|
import {GDPR_GVLIDS} from '../../../src/consentHandler.js';
|
|
57
59
|
import {MODULE_TYPE_UID} from '../../../src/activities/modules.js';
|
|
60
|
+
import {ACTIVITY_ENRICH_EIDS} from '../../../src/activities/activities.js';
|
|
61
|
+
import {ACTIVITY_PARAM_COMPONENT_NAME, ACTIVITY_PARAM_COMPONENT_TYPE} from '../../../src/activities/params.js';
|
|
58
62
|
|
|
59
63
|
let assert = require('chai').assert;
|
|
60
64
|
let expect = require('chai').expect;
|
|
@@ -188,8 +192,7 @@ describe('User ID', function () {
|
|
|
188
192
|
mockGpt.disable();
|
|
189
193
|
mockGpt.enable();
|
|
190
194
|
coreStorage.setCookie('pubcid', '', EXPIRED_COOKIE_DATE);
|
|
191
|
-
coreStorage.setCookie('pubcid_alt', 'altpubcid200000', (new Date(Date.now() +
|
|
192
|
-
let origSK = coreStorage.setCookie.bind(coreStorage);
|
|
195
|
+
coreStorage.setCookie('pubcid_alt', 'altpubcid200000', (new Date(Date.now() + 20000).toUTCString()));
|
|
193
196
|
sinon.spy(coreStorage, 'setCookie');
|
|
194
197
|
sinon.stub(utils, 'logWarn');
|
|
195
198
|
});
|
|
@@ -320,10 +323,6 @@ describe('User ID', function () {
|
|
|
320
323
|
});
|
|
321
324
|
});
|
|
322
325
|
});
|
|
323
|
-
// Because the consent cookie doesn't exist yet, we'll have 2 setCookie calls:
|
|
324
|
-
// 1) for the consent cookie
|
|
325
|
-
// 2) from the getId() call that results in a new call to store the results
|
|
326
|
-
expect(coreStorage.setCookie.callCount).to.equal(2);
|
|
327
326
|
});
|
|
328
327
|
});
|
|
329
328
|
|
|
@@ -350,7 +349,6 @@ describe('User ID', function () {
|
|
|
350
349
|
});
|
|
351
350
|
});
|
|
352
351
|
});
|
|
353
|
-
expect(coreStorage.setCookie.callCount).to.equal(2);
|
|
354
352
|
});
|
|
355
353
|
});
|
|
356
354
|
|
|
@@ -2506,6 +2504,53 @@ describe('User ID', function () {
|
|
|
2506
2504
|
done();
|
|
2507
2505
|
}, {adUnits});
|
|
2508
2506
|
});
|
|
2507
|
+
|
|
2508
|
+
describe('activity controls', () => {
|
|
2509
|
+
let isAllowed;
|
|
2510
|
+
const MOCK_IDS = ['mockId1', 'mockId2']
|
|
2511
|
+
beforeEach(() => {
|
|
2512
|
+
isAllowed = sinon.stub(dep, 'isAllowed');
|
|
2513
|
+
init(config);
|
|
2514
|
+
setSubmoduleRegistry([]);
|
|
2515
|
+
const mods = MOCK_IDS.map((name) => ({
|
|
2516
|
+
name,
|
|
2517
|
+
decode: function (value) {
|
|
2518
|
+
return {
|
|
2519
|
+
[name]: value
|
|
2520
|
+
};
|
|
2521
|
+
},
|
|
2522
|
+
getId: function () {
|
|
2523
|
+
return {id: `${name}Value`};
|
|
2524
|
+
}
|
|
2525
|
+
}));
|
|
2526
|
+
mods.forEach(attachIdSystem);
|
|
2527
|
+
});
|
|
2528
|
+
afterEach(() => {
|
|
2529
|
+
isAllowed.restore();
|
|
2530
|
+
});
|
|
2531
|
+
|
|
2532
|
+
it('should check for enrichEids activity permissions', (done) => {
|
|
2533
|
+
isAllowed.callsFake((activity, params) => {
|
|
2534
|
+
return !(activity === ACTIVITY_ENRICH_EIDS &&
|
|
2535
|
+
params[ACTIVITY_PARAM_COMPONENT_TYPE] === MODULE_TYPE_UID &&
|
|
2536
|
+
params[ACTIVITY_PARAM_COMPONENT_NAME] === MOCK_IDS[0])
|
|
2537
|
+
})
|
|
2538
|
+
|
|
2539
|
+
config.setConfig({
|
|
2540
|
+
userSync: {
|
|
2541
|
+
syncDelay: 0,
|
|
2542
|
+
userIds: MOCK_IDS.map(name => ({
|
|
2543
|
+
name, storage: {name, type: 'cookie'}
|
|
2544
|
+
}))
|
|
2545
|
+
}
|
|
2546
|
+
});
|
|
2547
|
+
requestBidsHook((req) => {
|
|
2548
|
+
const activeIds = req.adUnits.flatMap(au => au.bids).flatMap(bid => Object.keys(bid.userId));
|
|
2549
|
+
expect(Array.from(new Set(activeIds))).to.have.members([MOCK_IDS[1]]);
|
|
2550
|
+
done();
|
|
2551
|
+
}, {adUnits})
|
|
2552
|
+
});
|
|
2553
|
+
})
|
|
2509
2554
|
});
|
|
2510
2555
|
|
|
2511
2556
|
describe('callbacks at the end of auction', function () {
|
|
@@ -2591,15 +2636,21 @@ describe('User ID', function () {
|
|
|
2591
2636
|
});
|
|
2592
2637
|
|
|
2593
2638
|
describe('Set cookie behavior', function () {
|
|
2594
|
-
let
|
|
2639
|
+
let cookie, cookieStub;
|
|
2640
|
+
|
|
2595
2641
|
beforeEach(function () {
|
|
2596
|
-
coreStorageSpy = sinon.spy(coreStorage, 'setCookie');
|
|
2597
2642
|
setSubmoduleRegistry([sharedIdSystemSubmodule]);
|
|
2598
2643
|
init(config);
|
|
2644
|
+
cookie = document.cookie;
|
|
2645
|
+
cookieStub = sinon.stub(document, 'cookie');
|
|
2646
|
+
cookieStub.get(() => cookie);
|
|
2647
|
+
cookieStub.set((val) => cookie = val);
|
|
2599
2648
|
});
|
|
2649
|
+
|
|
2600
2650
|
afterEach(function () {
|
|
2601
|
-
|
|
2651
|
+
cookieStub.restore();
|
|
2602
2652
|
});
|
|
2653
|
+
|
|
2603
2654
|
it('should allow submodules to override the domain', function () {
|
|
2604
2655
|
const submodule = {
|
|
2605
2656
|
submodule: {
|
|
@@ -2608,26 +2659,34 @@ describe('User ID', function () {
|
|
|
2608
2659
|
}
|
|
2609
2660
|
},
|
|
2610
2661
|
config: {
|
|
2662
|
+
name: 'mockId',
|
|
2611
2663
|
storage: {
|
|
2612
2664
|
type: 'cookie'
|
|
2613
2665
|
}
|
|
2666
|
+
},
|
|
2667
|
+
storageMgr: {
|
|
2668
|
+
setCookie: sinon.stub()
|
|
2614
2669
|
}
|
|
2615
2670
|
}
|
|
2616
2671
|
setStoredValue(submodule, 'bar');
|
|
2617
|
-
expect(
|
|
2672
|
+
expect(submodule.storageMgr.setCookie.getCall(0).args[4]).to.equal('foo.com');
|
|
2618
2673
|
});
|
|
2619
2674
|
|
|
2620
|
-
it('should pass
|
|
2675
|
+
it('should pass no domain if submodule does not override the domain', function () {
|
|
2621
2676
|
const submodule = {
|
|
2622
2677
|
submodule: {},
|
|
2623
2678
|
config: {
|
|
2679
|
+
name: 'mockId',
|
|
2624
2680
|
storage: {
|
|
2625
2681
|
type: 'cookie'
|
|
2626
2682
|
}
|
|
2683
|
+
},
|
|
2684
|
+
storageMgr: {
|
|
2685
|
+
setCookie: sinon.stub()
|
|
2627
2686
|
}
|
|
2628
2687
|
}
|
|
2629
2688
|
setStoredValue(submodule, 'bar');
|
|
2630
|
-
expect(
|
|
2689
|
+
expect(submodule.storageMgr.setCookie.getCall(0).args[4]).to.equal(null);
|
|
2631
2690
|
});
|
|
2632
2691
|
});
|
|
2633
2692
|
|