prebid.js 5.16.0 → 5.20.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/.devcontainer/Dockerfile +11 -0
- package/.devcontainer/devcontainer.json +27 -0
- package/.devcontainer/postCreate.sh +6 -0
- package/browsers.json +1 -0
- package/integrationExamples/gpt/akamaidap_segments_example.html +132 -0
- package/modules/.submodules.json +1 -0
- package/modules/adfBidAdapter.js +21 -16
- package/modules/adgenerationBidAdapter.js +28 -4
- package/modules/adkernelBidAdapter.js +3 -1
- package/modules/admixerBidAdapter.js +11 -0
- package/modules/adnuntiusBidAdapter.js +1 -0
- package/modules/adtelligentBidAdapter.js +2 -1
- package/modules/airgridRtdProvider.js +1 -1
- package/modules/akamaiDapRtdProvider.js +474 -0
- package/modules/akamaiDapRtdProvider.md +47 -0
- package/modules/aolBidAdapter.js +2 -1
- package/modules/appnexusBidAdapter.js +5 -3
- package/modules/atsAnalyticsAdapter.js +89 -63
- package/modules/atsAnalyticsAdapter.md +1 -0
- package/modules/betweenBidAdapter.js +20 -3
- package/modules/bliinkBidAdapter.js +58 -32
- package/modules/bliinkBidAdapter.md +29 -6
- package/modules/browsiRtdProvider.js +106 -18
- package/modules/cleanioRtdProvider.js +192 -0
- package/modules/cleanioRtdProvider.md +59 -0
- package/modules/codefuelBidAdapter.js +183 -0
- package/modules/codefuelBidAdapter.md +111 -0
- package/modules/connectIdSystem.js +104 -0
- package/modules/connectIdSystem.md +33 -0
- package/modules/cwireBidAdapter.js +272 -0
- package/modules/cwireBidAdapter.md +43 -0
- package/modules/deepintentBidAdapter.js +106 -9
- package/modules/deepintentBidAdapter.md +36 -1
- package/modules/deltaprojectsBidAdapter.js +252 -0
- package/modules/deltaprojectsBidAdapter.md +32 -0
- package/modules/dgkeywordRtdProvider.js +0 -1
- package/modules/engageyaBidAdapter.js +157 -0
- package/modules/glimpseBidAdapter.js +160 -48
- package/modules/glimpseBidAdapter.md +11 -74
- package/modules/gridBidAdapter.js +1 -0
- package/modules/gridNMBidAdapter.js +7 -6
- package/modules/gumgumBidAdapter.js +16 -2
- package/modules/iasRtdProvider.js +83 -67
- package/modules/inskinBidAdapter.js +7 -3
- package/modules/ixBidAdapter.js +8 -1
- package/modules/jixieBidAdapter.js +8 -2
- package/modules/justpremiumBidAdapter.js +6 -1
- package/modules/kargoBidAdapter.js +14 -7
- package/modules/kargoBidAdapter.md +20 -0
- package/modules/limelightDigitalBidAdapter.js +22 -2
- package/modules/livewrappedAnalyticsAdapter.js +53 -3
- package/modules/mediakeysBidAdapter.js +405 -14
- package/modules/mediakeysBidAdapter.md +108 -0
- package/modules/multibid/index.js +3 -3
- package/modules/mytargetBidAdapter.js +112 -0
- package/modules/nativoBidAdapter.js +48 -29
- package/modules/nativoBidAdapter.md +0 -1
- package/modules/nextMillenniumBidAdapter.js +12 -3
- package/modules/nextrollBidAdapter.js +375 -0
- package/modules/nobidBidAdapter.js +2 -1
- package/modules/oguryBidAdapter.js +36 -7
- package/modules/openxBidAdapter.js +34 -22
- package/modules/operaadsBidAdapter.js +21 -1
- package/modules/otmBidAdapter.js +146 -0
- package/modules/otmBidAdapter.md +27 -26
- package/modules/outbrainBidAdapter.js +5 -0
- package/modules/pixfutureBidAdapter.js +24 -4
- package/modules/pixfutureBidAdapter.md +127 -0
- package/modules/playwireBidAdapter.md +61 -0
- package/modules/prebidServerBidAdapter/index.js +1 -1
- package/modules/proxistoreBidAdapter.js +4 -6
- package/modules/publinkIdSystem.js +17 -7
- package/modules/publinkIdSystem.md +7 -2
- package/modules/pubmaticBidAdapter.js +22 -6
- package/modules/pubmaticBidAdapter.md +1 -1
- package/modules/relaidoBidAdapter.js +8 -2
- package/modules/rtdModule/index.js +2 -2
- package/modules/sharethroughBidAdapter.js +12 -19
- package/modules/slimcutBidAdapter.js +121 -0
- package/modules/sonobiBidAdapter.js +7 -0
- package/modules/sortableBidAdapter.js +1 -0
- package/modules/spotxBidAdapter.js +15 -1
- package/modules/sspBCBidAdapter.js +207 -12
- package/modules/sspBCBidAdapter.md +1 -1
- package/modules/talkadsBidAdapter.js +129 -0
- package/modules/talkadsBidAdapter.md +60 -0
- package/modules/tappxBidAdapter.js +6 -5
- package/modules/teadsBidAdapter.js +3 -0
- package/modules/tripleliftBidAdapter.js +22 -5
- package/modules/trustxBidAdapter.js +17 -11
- package/modules/undertoneBidAdapter.js +9 -5
- package/modules/undertoneBidAdapter.md +5 -1
- package/modules/unicornBidAdapter.js +3 -3
- package/modules/userId/eids.js +18 -0
- package/modules/userId/eids.md +7 -0
- package/modules/userId/userId.md +12 -0
- package/modules/ventesBidAdapter.js +370 -0
- package/modules/ventesBidAdapter.md +94 -0
- package/modules/videobyteBidAdapter.js +13 -6
- package/modules/videobyteBidAdapter.md +49 -0
- package/modules/vidoomyBidAdapter.js +20 -12
- package/modules/visxBidAdapter.js +15 -22
- package/modules/yahoosspBidAdapter.js +637 -0
- package/modules/yahoosspBidAdapter.md +795 -0
- package/modules/yieldlabBidAdapter.js +48 -3
- package/modules/yieldlabBidAdapter.md +16 -1
- package/modules/yieldmoBidAdapter.js +20 -6
- package/modules/yieldmoSyntheticInventoryModule.js +46 -0
- package/modules/yieldmoSyntheticInventoryModule.md +68 -0
- package/package.json +1 -1
- package/src/adapterManager.js +5 -0
- package/src/adapters/bidderFactory.js +4 -3
- package/src/auction.js +11 -11
- package/src/constants.json +1 -0
- package/src/secureCreatives.js +6 -7
- package/src/targeting.js +11 -9
- package/test/.eslintrc.js +2 -1
- package/test/spec/modules/adfBidAdapter_spec.js +83 -29
- package/test/spec/modules/adgenerationBidAdapter_spec.js +121 -50
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +68 -0
- package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
- package/test/spec/modules/akamaiDapRtdProvider_spec.js +246 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +2 -1
- package/test/spec/modules/atsAnalyticsAdapter_spec.js +77 -9
- package/test/spec/modules/betweenBidAdapter_spec.js +41 -0
- package/test/spec/modules/bliinkBidAdapter_spec.js +87 -36
- package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
- package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
- package/test/spec/modules/codefuelBidAdapter_spec.js +316 -0
- package/test/spec/modules/connectIdSystem_spec.js +189 -0
- package/test/spec/modules/cwireBidAdapter_spec.js +246 -0
- package/test/spec/modules/deepintentBidAdapter_spec.js +153 -3
- package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
- package/test/spec/modules/engageyaBidAdapter_spec.js +286 -0
- package/test/spec/modules/glimpseBidAdapter_spec.js +302 -204
- package/test/spec/modules/gridNMBidAdapter_spec.js +40 -1
- package/test/spec/modules/gumgumBidAdapter_spec.js +23 -6
- package/test/spec/modules/iasRtdProvider_spec.js +71 -6
- package/test/spec/modules/ixBidAdapter_spec.js +13 -3
- package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
- package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +155 -1
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +67 -12
- package/test/spec/modules/mediakeysBidAdapter_spec.js +406 -51
- package/test/spec/modules/multibid_spec.js +31 -31
- package/test/spec/modules/mytargetBidAdapter_spec.js +199 -0
- package/test/spec/modules/nativoBidAdapter_spec.js +50 -3
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +13 -1
- package/test/spec/modules/nextrollBidAdapter_spec.js +290 -0
- package/test/spec/modules/nobidBidAdapter_spec.js +65 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +125 -37
- package/test/spec/modules/openxBidAdapter_spec.js +85 -13
- package/test/spec/modules/operaadsBidAdapter_spec.js +38 -6
- package/test/spec/modules/otmBidAdapter_spec.js +67 -0
- package/test/spec/modules/outbrainBidAdapter_spec.js +18 -0
- package/test/spec/modules/publinkIdSystem_spec.js +34 -15
- package/test/spec/modules/pubmaticBidAdapter_spec.js +217 -1
- package/test/spec/modules/relaidoBidAdapter_spec.js +21 -20
- package/test/spec/modules/sharethroughBidAdapter_spec.js +156 -136
- package/test/spec/modules/slimcutBidAdapter_spec.js +200 -0
- package/test/spec/modules/sonobiBidAdapter_spec.js +34 -1
- package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
- package/test/spec/modules/spotxBidAdapter_spec.js +36 -0
- package/test/spec/modules/sspBCBidAdapter_spec.js +210 -62
- package/test/spec/modules/talkadsBidAdapter_spec.js +231 -0
- package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
- package/test/spec/modules/tripleliftBidAdapter_spec.js +128 -0
- package/test/spec/modules/trustxBidAdapter_spec.js +38 -5
- package/test/spec/modules/undertoneBidAdapter_spec.js +52 -0
- package/test/spec/modules/unicornBidAdapter_spec.js +4 -4
- package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
- package/test/spec/modules/videobyteBidAdapter_spec.js +2 -2
- package/test/spec/modules/visxBidAdapter_spec.js +48 -4
- package/test/spec/modules/yahoosspBidAdapter_spec.js +1332 -0
- package/test/spec/modules/yieldlabBidAdapter_spec.js +65 -1
- package/test/spec/modules/yieldmoBidAdapter_spec.js +30 -9
- package/test/spec/modules/yieldmoSyntheticInventoryModule_spec.js +89 -0
- package/test/spec/unit/core/adapterManager_spec.js +32 -0
- package/test/spec/unit/core/bidderFactory_spec.js +61 -1
- package/test/spec/unit/pbjs_api_spec.js +37 -2
- package/test/spec/unit/secureCreatives_spec.js +54 -25
- package/modules/turktelekomBidAdapter.md +0 -49
|
@@ -82,7 +82,7 @@ describe('multibid adapter', function () {
|
|
|
82
82
|
'sizes': [[300, 250]]
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
-
'adUnitCode': 'test
|
|
85
|
+
'adUnitCode': 'test.div',
|
|
86
86
|
'transactionId': 'c153f3da-84f0-4be8-95cb-0647c458bc60',
|
|
87
87
|
'sizes': [[300, 250]],
|
|
88
88
|
'bidId': '2408ef83b84c9d',
|
|
@@ -106,7 +106,7 @@ describe('multibid adapter', function () {
|
|
|
106
106
|
'sizes': [[300, 250]]
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
|
-
'adUnitCode': 'test
|
|
109
|
+
'adUnitCode': 'test.div',
|
|
110
110
|
'transactionId': 'c153f3da-84f0-4be8-95cb-0647c458bc60',
|
|
111
111
|
'sizes': [[300, 250]],
|
|
112
112
|
'bidId': '2408ef83b84c9d',
|
|
@@ -197,14 +197,14 @@ describe('multibid adapter', function () {
|
|
|
197
197
|
});
|
|
198
198
|
|
|
199
199
|
it('adds original bids and does not modify', function () {
|
|
200
|
-
let adUnitCode = 'test
|
|
200
|
+
let adUnitCode = 'test.div';
|
|
201
201
|
let bids = [{...bidArray[0]}, {...bidArray[1]}];
|
|
202
202
|
|
|
203
203
|
addBidResponseHook(callbackFn, adUnitCode, {...bids[0]});
|
|
204
204
|
|
|
205
205
|
expect(result).to.not.equal(null);
|
|
206
206
|
expect(result.adUnitCode).to.not.equal(null);
|
|
207
|
-
expect(result.adUnitCode).to.equal('test
|
|
207
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
208
208
|
expect(result.bid).to.not.equal(null);
|
|
209
209
|
expect(result.bid).to.deep.equal(bids[0]);
|
|
210
210
|
|
|
@@ -214,13 +214,13 @@ describe('multibid adapter', function () {
|
|
|
214
214
|
|
|
215
215
|
expect(result).to.not.equal(null);
|
|
216
216
|
expect(result.adUnitCode).to.not.equal(null);
|
|
217
|
-
expect(result.adUnitCode).to.equal('test
|
|
217
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
218
218
|
expect(result.bid).to.not.equal(null);
|
|
219
219
|
expect(result.bid).to.deep.equal(bids[1]);
|
|
220
220
|
});
|
|
221
221
|
|
|
222
222
|
it('modifies and adds both bids based on multibid configuration', function () {
|
|
223
|
-
let adUnitCode = 'test
|
|
223
|
+
let adUnitCode = 'test.div';
|
|
224
224
|
let bids = [{...bidArray[0]}, {...bidArray[1]}];
|
|
225
225
|
|
|
226
226
|
config.setConfig({multibid: [{bidder: 'bidderA', maxBids: 2, targetBiddercodePrefix: 'bidA'}]});
|
|
@@ -232,7 +232,7 @@ describe('multibid adapter', function () {
|
|
|
232
232
|
|
|
233
233
|
expect(result).to.not.equal(null);
|
|
234
234
|
expect(result.adUnitCode).to.not.equal(null);
|
|
235
|
-
expect(result.adUnitCode).to.equal('test
|
|
235
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
236
236
|
expect(result.bid).to.not.equal(null);
|
|
237
237
|
expect(result.bid).to.deep.equal(bids[0]);
|
|
238
238
|
|
|
@@ -250,13 +250,13 @@ describe('multibid adapter', function () {
|
|
|
250
250
|
|
|
251
251
|
expect(result).to.not.equal(null);
|
|
252
252
|
expect(result.adUnitCode).to.not.equal(null);
|
|
253
|
-
expect(result.adUnitCode).to.equal('test
|
|
253
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
254
254
|
expect(result.bid).to.not.equal(null);
|
|
255
255
|
expect(result.bid).to.deep.equal(bids[1]);
|
|
256
256
|
});
|
|
257
257
|
|
|
258
258
|
it('only modifies bids defined in the multibid configuration', function () {
|
|
259
|
-
let adUnitCode = 'test
|
|
259
|
+
let adUnitCode = 'test.div';
|
|
260
260
|
let bids = [{...bidArray[0]}, {...bidArray[1]}];
|
|
261
261
|
|
|
262
262
|
bids.push({
|
|
@@ -276,7 +276,7 @@ describe('multibid adapter', function () {
|
|
|
276
276
|
|
|
277
277
|
expect(result).to.not.equal(null);
|
|
278
278
|
expect(result.adUnitCode).to.not.equal(null);
|
|
279
|
-
expect(result.adUnitCode).to.equal('test
|
|
279
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
280
280
|
expect(result.bid).to.not.equal(null);
|
|
281
281
|
expect(result.bid).to.deep.equal(bids[0]);
|
|
282
282
|
|
|
@@ -292,7 +292,7 @@ describe('multibid adapter', function () {
|
|
|
292
292
|
|
|
293
293
|
expect(result).to.not.equal(null);
|
|
294
294
|
expect(result.adUnitCode).to.not.equal(null);
|
|
295
|
-
expect(result.adUnitCode).to.equal('test
|
|
295
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
296
296
|
expect(result.bid).to.not.equal(null);
|
|
297
297
|
expect(result.bid).to.deep.equal(bids[1]);
|
|
298
298
|
|
|
@@ -302,13 +302,13 @@ describe('multibid adapter', function () {
|
|
|
302
302
|
|
|
303
303
|
expect(result).to.not.equal(null);
|
|
304
304
|
expect(result.adUnitCode).to.not.equal(null);
|
|
305
|
-
expect(result.adUnitCode).to.equal('test
|
|
305
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
306
306
|
expect(result.bid).to.not.equal(null);
|
|
307
307
|
expect(result.bid).to.deep.equal(bids[2]);
|
|
308
308
|
});
|
|
309
309
|
|
|
310
310
|
it('only modifies and returns bids under limit for a specifc bidder in the multibid configuration', function () {
|
|
311
|
-
let adUnitCode = 'test
|
|
311
|
+
let adUnitCode = 'test.div';
|
|
312
312
|
let bids = [{...bidArray[0]}, {...bidArray[1]}];
|
|
313
313
|
|
|
314
314
|
bids.push({
|
|
@@ -328,7 +328,7 @@ describe('multibid adapter', function () {
|
|
|
328
328
|
|
|
329
329
|
expect(result).to.not.equal(null);
|
|
330
330
|
expect(result.adUnitCode).to.not.equal(null);
|
|
331
|
-
expect(result.adUnitCode).to.equal('test
|
|
331
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
332
332
|
expect(result.bid).to.not.equal(null);
|
|
333
333
|
expect(result.bid).to.deep.equal(bids[0]);
|
|
334
334
|
|
|
@@ -344,7 +344,7 @@ describe('multibid adapter', function () {
|
|
|
344
344
|
|
|
345
345
|
expect(result).to.not.equal(null);
|
|
346
346
|
expect(result.adUnitCode).to.not.equal(null);
|
|
347
|
-
expect(result.adUnitCode).to.equal('test
|
|
347
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
348
348
|
expect(result.bid).to.not.equal(null);
|
|
349
349
|
expect(result.bid).to.deep.equal(bids[1]);
|
|
350
350
|
|
|
@@ -356,7 +356,7 @@ describe('multibid adapter', function () {
|
|
|
356
356
|
});
|
|
357
357
|
|
|
358
358
|
it('if no prefix in multibid configuration, modifies and returns bids under limit without preifx property', function () {
|
|
359
|
-
let adUnitCode = 'test
|
|
359
|
+
let adUnitCode = 'test.div';
|
|
360
360
|
let bids = [{...bidArray[0]}, {...bidArray[1]}];
|
|
361
361
|
|
|
362
362
|
bids.push({
|
|
@@ -375,7 +375,7 @@ describe('multibid adapter', function () {
|
|
|
375
375
|
|
|
376
376
|
expect(result).to.not.equal(null);
|
|
377
377
|
expect(result.adUnitCode).to.not.equal(null);
|
|
378
|
-
expect(result.adUnitCode).to.equal('test
|
|
378
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
379
379
|
expect(result.bid).to.not.equal(null);
|
|
380
380
|
expect(result.bid).to.deep.equal(bids[0]);
|
|
381
381
|
|
|
@@ -389,7 +389,7 @@ describe('multibid adapter', function () {
|
|
|
389
389
|
|
|
390
390
|
expect(result).to.not.equal(null);
|
|
391
391
|
expect(result.adUnitCode).to.not.equal(null);
|
|
392
|
-
expect(result.adUnitCode).to.equal('test
|
|
392
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
393
393
|
expect(result.bid).to.not.equal(null);
|
|
394
394
|
expect(result.bid).to.deep.equal(bids[1]);
|
|
395
395
|
|
|
@@ -401,7 +401,7 @@ describe('multibid adapter', function () {
|
|
|
401
401
|
});
|
|
402
402
|
|
|
403
403
|
it('does not include extra bids if cpm is less than floor value', function () {
|
|
404
|
-
let adUnitCode = 'test
|
|
404
|
+
let adUnitCode = 'test.div';
|
|
405
405
|
let bids = [{...bidArrayAlt[1]}, {...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}];
|
|
406
406
|
|
|
407
407
|
bids.map(bid => {
|
|
@@ -418,7 +418,7 @@ describe('multibid adapter', function () {
|
|
|
418
418
|
floorRuleValue: 65,
|
|
419
419
|
floorValue: 65,
|
|
420
420
|
matchedFields: {
|
|
421
|
-
gptSlot: 'test
|
|
421
|
+
gptSlot: 'test.div',
|
|
422
422
|
mediaType: 'banner'
|
|
423
423
|
}
|
|
424
424
|
}
|
|
@@ -435,7 +435,7 @@ describe('multibid adapter', function () {
|
|
|
435
435
|
|
|
436
436
|
expect(result).to.not.equal(null);
|
|
437
437
|
expect(result.adUnitCode).to.not.equal(null);
|
|
438
|
-
expect(result.adUnitCode).to.equal('test
|
|
438
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
439
439
|
expect(result.bid).to.not.equal(null);
|
|
440
440
|
expect(result.bid.bidder).to.equal('bidderA');
|
|
441
441
|
expect(result.bid.targetingBidder).to.equal(undefined);
|
|
@@ -452,7 +452,7 @@ describe('multibid adapter', function () {
|
|
|
452
452
|
|
|
453
453
|
expect(result).to.not.equal(null);
|
|
454
454
|
expect(result.adUnitCode).to.not.equal(null);
|
|
455
|
-
expect(result.adUnitCode).to.equal('test
|
|
455
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
456
456
|
expect(result.bid).to.not.equal(null);
|
|
457
457
|
expect(result.bid.bidder).to.equal('bidderB');
|
|
458
458
|
expect(result.bid.targetingBidder).to.equal(undefined);
|
|
@@ -463,14 +463,14 @@ describe('multibid adapter', function () {
|
|
|
463
463
|
|
|
464
464
|
expect(result).to.not.equal(null);
|
|
465
465
|
expect(result.adUnitCode).to.not.equal(null);
|
|
466
|
-
expect(result.adUnitCode).to.equal('test
|
|
466
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
467
467
|
expect(result.bid).to.not.equal(null);
|
|
468
468
|
expect(result.bid.bidder).to.equal('bidderC');
|
|
469
469
|
expect(result.bid.targetingBidder).to.equal(undefined);
|
|
470
470
|
});
|
|
471
471
|
|
|
472
472
|
it('does include extra bids if cpm is not less than floor value', function () {
|
|
473
|
-
let adUnitCode = 'test
|
|
473
|
+
let adUnitCode = 'test.div';
|
|
474
474
|
let bids = [{...bidArrayAlt[1]}, {...bidArrayAlt[0]}];
|
|
475
475
|
|
|
476
476
|
bids.map(bid => {
|
|
@@ -487,7 +487,7 @@ describe('multibid adapter', function () {
|
|
|
487
487
|
floorRuleValue: 25,
|
|
488
488
|
floorValue: 25,
|
|
489
489
|
matchedFields: {
|
|
490
|
-
gptSlot: 'test
|
|
490
|
+
gptSlot: 'test.div',
|
|
491
491
|
mediaType: 'banner'
|
|
492
492
|
}
|
|
493
493
|
}
|
|
@@ -504,7 +504,7 @@ describe('multibid adapter', function () {
|
|
|
504
504
|
|
|
505
505
|
expect(result).to.not.equal(null);
|
|
506
506
|
expect(result.adUnitCode).to.not.equal(null);
|
|
507
|
-
expect(result.adUnitCode).to.equal('test
|
|
507
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
508
508
|
expect(result.bid).to.not.equal(null);
|
|
509
509
|
expect(result.bid.bidder).to.equal('bidderA');
|
|
510
510
|
expect(result.bid.targetingBidder).to.equal(undefined);
|
|
@@ -518,7 +518,7 @@ describe('multibid adapter', function () {
|
|
|
518
518
|
|
|
519
519
|
expect(result).to.not.equal(null);
|
|
520
520
|
expect(result.adUnitCode).to.not.equal(null);
|
|
521
|
-
expect(result.adUnitCode).to.equal('test
|
|
521
|
+
expect(result.adUnitCode).to.equal('test.div');
|
|
522
522
|
expect(result.bid).to.not.equal(null);
|
|
523
523
|
expect(result.bid.bidder).to.equal('bidderA');
|
|
524
524
|
expect(result.bid.targetingBidder).to.equal('bidA2');
|
|
@@ -578,7 +578,7 @@ describe('multibid adapter', function () {
|
|
|
578
578
|
|
|
579
579
|
it('it sorts and creates dynamic alias on bidsReceived if multibid configuration found with prefix', function () {
|
|
580
580
|
let modifiedBids = [{...bidArray[1]}, {...bidArray[0]}].map(bid => {
|
|
581
|
-
addBidResponseHook(bidResponseCallback, 'test
|
|
581
|
+
addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
|
|
582
582
|
|
|
583
583
|
return bidResult;
|
|
584
584
|
});
|
|
@@ -603,7 +603,7 @@ describe('multibid adapter', function () {
|
|
|
603
603
|
|
|
604
604
|
it('it sorts by cpm treating dynamic alias as unique bid when no bid limit defined', function () {
|
|
605
605
|
let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => {
|
|
606
|
-
addBidResponseHook(bidResponseCallback, 'test
|
|
606
|
+
addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
|
|
607
607
|
|
|
608
608
|
return bidResult;
|
|
609
609
|
});
|
|
@@ -636,7 +636,7 @@ describe('multibid adapter', function () {
|
|
|
636
636
|
|
|
637
637
|
it('it should filter out dynamic bid when bid limit is less than unique bid pool', function () {
|
|
638
638
|
let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => {
|
|
639
|
-
addBidResponseHook(bidResponseCallback, 'test
|
|
639
|
+
addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
|
|
640
640
|
|
|
641
641
|
return bidResult;
|
|
642
642
|
});
|
|
@@ -662,7 +662,7 @@ describe('multibid adapter', function () {
|
|
|
662
662
|
config.setConfig({ multibid: [{bidder: 'bidderA', maxBids: 2, targetBiddercodePrefix: 'bidA'}] });
|
|
663
663
|
|
|
664
664
|
let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => {
|
|
665
|
-
addBidResponseHook(bidResponseCallback, 'test
|
|
665
|
+
addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
|
|
666
666
|
|
|
667
667
|
return bidResult;
|
|
668
668
|
});
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { spec } from 'modules/mytargetBidAdapter';
|
|
3
|
+
|
|
4
|
+
describe('MyTarget Adapter', function() {
|
|
5
|
+
describe('isBidRequestValid', function () {
|
|
6
|
+
it('should return true when required params found', function () {
|
|
7
|
+
let validBid = {
|
|
8
|
+
bidder: 'mytarget',
|
|
9
|
+
params: {
|
|
10
|
+
placementId: '1'
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
expect(spec.isBidRequestValid(validBid)).to.equal(true);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should return false for when required params are not passed', function () {
|
|
18
|
+
let invalidBid = {
|
|
19
|
+
bidder: 'mytarget',
|
|
20
|
+
params: {}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
expect(spec.isBidRequestValid(invalidBid)).to.equal(false);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
describe('buildRequests', function () {
|
|
28
|
+
let bidRequests = [
|
|
29
|
+
{
|
|
30
|
+
bidId: 'bid1',
|
|
31
|
+
bidder: 'mytarget',
|
|
32
|
+
params: {
|
|
33
|
+
placementId: '1'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
bidId: 'bid2',
|
|
38
|
+
bidder: 'mytarget',
|
|
39
|
+
params: {
|
|
40
|
+
placementId: '2',
|
|
41
|
+
position: 1,
|
|
42
|
+
response: 1,
|
|
43
|
+
bidfloor: 10000
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
];
|
|
47
|
+
let bidderRequest = {
|
|
48
|
+
refererInfo: {
|
|
49
|
+
referer: 'https://example.com?param=value'
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
let bidRequest = spec.buildRequests(bidRequests, bidderRequest);
|
|
54
|
+
|
|
55
|
+
it('should build single POST request for multiple bids', function() {
|
|
56
|
+
expect(bidRequest.method).to.equal('POST');
|
|
57
|
+
expect(bidRequest.url).to.equal('//ad.mail.ru/hbid_prebid/');
|
|
58
|
+
expect(bidRequest.data).to.be.an('object');
|
|
59
|
+
expect(bidRequest.data.places).to.be.an('array');
|
|
60
|
+
expect(bidRequest.data.places).to.have.lengthOf(2);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('should pass bid parameters', function() {
|
|
64
|
+
let place1 = bidRequest.data.places[0];
|
|
65
|
+
let place2 = bidRequest.data.places[1];
|
|
66
|
+
|
|
67
|
+
expect(place1.placementId).to.equal('1');
|
|
68
|
+
expect(place2.placementId).to.equal('2');
|
|
69
|
+
expect(place1.id).to.equal('bid1');
|
|
70
|
+
expect(place2.id).to.equal('bid2');
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('should pass default position and response type', function() {
|
|
74
|
+
let place = bidRequest.data.places[0];
|
|
75
|
+
|
|
76
|
+
expect(place.position).to.equal(0);
|
|
77
|
+
expect(place.response).to.equal(0);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('should pass provided position and response type', function() {
|
|
81
|
+
let place = bidRequest.data.places[1];
|
|
82
|
+
|
|
83
|
+
expect(place.position).to.equal(1);
|
|
84
|
+
expect(place.response).to.equal(1);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('should not pass default bidfloor', function() {
|
|
88
|
+
let place = bidRequest.data.places[0];
|
|
89
|
+
|
|
90
|
+
expect(place.bidfloor).not.to.exist;
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('should not pass provided bidfloor', function() {
|
|
94
|
+
let place = bidRequest.data.places[1];
|
|
95
|
+
|
|
96
|
+
expect(place.bidfloor).to.exist;
|
|
97
|
+
expect(place.bidfloor).to.equal(10000);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('should pass site parameters', function() {
|
|
101
|
+
let site = bidRequest.data.site;
|
|
102
|
+
|
|
103
|
+
expect(site).to.be.an('object');
|
|
104
|
+
expect(site.sitename).to.equal('example.com');
|
|
105
|
+
expect(site.page).to.equal('https://example.com?param=value');
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('should pass settings', function() {
|
|
109
|
+
let settings = bidRequest.data.settings;
|
|
110
|
+
|
|
111
|
+
expect(settings).to.be.an('object');
|
|
112
|
+
expect(settings.currency).to.equal('RUB');
|
|
113
|
+
expect(settings.windowSize).to.be.an('object');
|
|
114
|
+
expect(settings.windowSize.width).to.equal(window.screen.width);
|
|
115
|
+
expect(settings.windowSize.height).to.equal(window.screen.height);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
describe('interpretResponse', function () {
|
|
120
|
+
let serverResponse = {
|
|
121
|
+
body: {
|
|
122
|
+
'bidder_status':
|
|
123
|
+
[
|
|
124
|
+
{
|
|
125
|
+
'bidder': 'mail.ru',
|
|
126
|
+
'response_time_ms': 100,
|
|
127
|
+
'num_bids': 2
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
'bids':
|
|
131
|
+
[
|
|
132
|
+
{
|
|
133
|
+
'displayUrl': 'https://ad.mail.ru/hbid_imp/12345',
|
|
134
|
+
'size':
|
|
135
|
+
{
|
|
136
|
+
'height': '400',
|
|
137
|
+
'width': '240'
|
|
138
|
+
},
|
|
139
|
+
'id': '1',
|
|
140
|
+
'currency': 'RUB',
|
|
141
|
+
'price': 100,
|
|
142
|
+
'ttl': 360,
|
|
143
|
+
'creativeId': '123456'
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
'adm': '<p>Ad</p>',
|
|
147
|
+
'size':
|
|
148
|
+
{
|
|
149
|
+
'height': '250',
|
|
150
|
+
'width': '300'
|
|
151
|
+
},
|
|
152
|
+
'id': '2',
|
|
153
|
+
'price': 200
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
let bids = spec.interpretResponse(serverResponse);
|
|
160
|
+
|
|
161
|
+
it('should return empty array for response with no bids', function() {
|
|
162
|
+
let emptyBids = spec.interpretResponse({ body: {} });
|
|
163
|
+
|
|
164
|
+
expect(emptyBids).to.have.lengthOf(0);
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
it('should parse all bids from response', function() {
|
|
168
|
+
expect(bids).to.have.lengthOf(2);
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it('should parse bid with ad url', function() {
|
|
172
|
+
expect(bids[0].requestId).to.equal('1');
|
|
173
|
+
expect(bids[0].cpm).to.equal(100);
|
|
174
|
+
expect(bids[0].width).to.equal('240');
|
|
175
|
+
expect(bids[0].height).to.equal('400');
|
|
176
|
+
expect(bids[0].ttl).to.equal(360);
|
|
177
|
+
expect(bids[0].currency).to.equal('RUB');
|
|
178
|
+
expect(bids[0]).to.have.property('creativeId');
|
|
179
|
+
expect(bids[0].creativeId).to.equal('123456');
|
|
180
|
+
expect(bids[0].netRevenue).to.equal(true);
|
|
181
|
+
expect(bids[0].adUrl).to.equal('https://ad.mail.ru/hbid_imp/12345');
|
|
182
|
+
expect(bids[0]).to.not.have.property('ad');
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it('should parse bid with ad markup', function() {
|
|
186
|
+
expect(bids[1].requestId).to.equal('2');
|
|
187
|
+
expect(bids[1].cpm).to.equal(200);
|
|
188
|
+
expect(bids[1].width).to.equal('300');
|
|
189
|
+
expect(bids[1].height).to.equal('250');
|
|
190
|
+
expect(bids[1].ttl).to.equal(180);
|
|
191
|
+
expect(bids[1].currency).to.equal('RUB');
|
|
192
|
+
expect(bids[1]).to.have.property('creativeId');
|
|
193
|
+
expect(bids[1].creativeId).not.to.equal('123456');
|
|
194
|
+
expect(bids[1].netRevenue).to.equal(true);
|
|
195
|
+
expect(bids[1].ad).to.equal('<p>Ad</p>');
|
|
196
|
+
expect(bids[1]).to.not.have.property('adUrl');
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
});
|
|
@@ -26,11 +26,11 @@ describe('nativoBidAdapterTests', function () {
|
|
|
26
26
|
expect(spec.isBidRequestValid(bid)).to.equal(true)
|
|
27
27
|
})
|
|
28
28
|
|
|
29
|
-
it('should return
|
|
29
|
+
it('should return true when params are not passed', function () {
|
|
30
30
|
let bid2 = Object.assign({}, bid)
|
|
31
31
|
delete bid2.params
|
|
32
32
|
bid2.params = {}
|
|
33
|
-
expect(spec.isBidRequestValid(bid2)).to.equal(
|
|
33
|
+
expect(spec.isBidRequestValid(bid2)).to.equal(true)
|
|
34
34
|
})
|
|
35
35
|
})
|
|
36
36
|
|
|
@@ -129,7 +129,12 @@ describe('interpretResponse', function () {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
// mock
|
|
132
|
-
spec.
|
|
132
|
+
spec.getAdUnitData = () => {
|
|
133
|
+
return {
|
|
134
|
+
bidId: 123456,
|
|
135
|
+
sizes: [300, 250],
|
|
136
|
+
}
|
|
137
|
+
}
|
|
133
138
|
|
|
134
139
|
let result = spec.interpretResponse({ body: response }, { bidderRequest })
|
|
135
140
|
expect(Object.keys(result[0])).to.have.deep.members(
|
|
@@ -232,3 +237,45 @@ describe('getUserSyncs', function () {
|
|
|
232
237
|
)
|
|
233
238
|
})
|
|
234
239
|
})
|
|
240
|
+
|
|
241
|
+
describe('getAdUnitData', () => {
|
|
242
|
+
afterEach(() => {
|
|
243
|
+
if (window.bidRequestMap) delete window.bidRequestMap
|
|
244
|
+
})
|
|
245
|
+
|
|
246
|
+
it('Matches placementId value', () => {
|
|
247
|
+
const adUnitData = {
|
|
248
|
+
bidId: 123456,
|
|
249
|
+
sizes: [300, 250],
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
window.bidRequestMap = {
|
|
253
|
+
9876543: {
|
|
254
|
+
12345: adUnitData,
|
|
255
|
+
},
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const data = spec.getAdUnitData(9876543, { impid: 12345 })
|
|
259
|
+
expect(Object.keys(data)).to.have.deep.members(
|
|
260
|
+
Object.keys(adUnitData)
|
|
261
|
+
)
|
|
262
|
+
})
|
|
263
|
+
|
|
264
|
+
it('Falls back to ad unit code value', () => {
|
|
265
|
+
const adUnitData = {
|
|
266
|
+
bidId: 123456,
|
|
267
|
+
sizes: [300, 250],
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
window.bidRequestMap = {
|
|
271
|
+
9876543: {
|
|
272
|
+
'#test-code': adUnitData,
|
|
273
|
+
},
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const data = spec.getAdUnitData(9876543, { impid: 12345, ext: { ad_unit_code: '#test-code' } })
|
|
277
|
+
expect(Object.keys(data)).to.have.deep.members(
|
|
278
|
+
Object.keys(adUnitData)
|
|
279
|
+
)
|
|
280
|
+
})
|
|
281
|
+
})
|
|
@@ -8,10 +8,22 @@ describe('nextMillenniumBidAdapterTests', function() {
|
|
|
8
8
|
auctionId: 'b06c5141-fe8f-4cdf-9d7d-54415490a917',
|
|
9
9
|
bidder: 'nextMillennium',
|
|
10
10
|
params: { placement_id: '-1' },
|
|
11
|
-
sizes: [[300, 250]]
|
|
11
|
+
sizes: [[300, 250]],
|
|
12
|
+
uspConsent: '1---',
|
|
13
|
+
gdprConsent: {
|
|
14
|
+
consentString: 'kjfdniwjnifwenrif3',
|
|
15
|
+
gdprApplies: true
|
|
16
|
+
}
|
|
12
17
|
}
|
|
13
18
|
];
|
|
14
19
|
|
|
20
|
+
it('Request params check with GDPR Consent', function () {
|
|
21
|
+
const request = spec.buildRequests(bidRequestData, bidRequestData[0]);
|
|
22
|
+
expect(JSON.parse(request[0].data).user.ext.consent).to.equal('kjfdniwjnifwenrif3');
|
|
23
|
+
expect(JSON.parse(request[0].data).regs.ext.us_privacy).to.equal('1---');
|
|
24
|
+
expect(JSON.parse(request[0].data).regs.ext.gdpr).to.equal(1);
|
|
25
|
+
});
|
|
26
|
+
|
|
15
27
|
it('validate_generated_params', function() {
|
|
16
28
|
const request = spec.buildRequests(bidRequestData);
|
|
17
29
|
expect(request[0].bidId).to.equal('bid1234');
|