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
|
@@ -238,14 +238,17 @@ describe('SonobiBidAdapter', function () {
|
|
|
238
238
|
});
|
|
239
239
|
|
|
240
240
|
describe('.buildRequests', function () {
|
|
241
|
+
let sandbox;
|
|
241
242
|
beforeEach(function() {
|
|
242
243
|
sinon.stub(userSync, 'canBidderRegisterSync');
|
|
243
244
|
sinon.stub(utils, 'getGptSlotInfoForAdUnitCode')
|
|
244
|
-
.onFirstCall().returns({gptSlot: '/123123/gpt_publisher/adunit-code-3', divId: 'adunit-code-3-div-id'})
|
|
245
|
+
.onFirstCall().returns({gptSlot: '/123123/gpt_publisher/adunit-code-3', divId: 'adunit-code-3-div-id'});
|
|
246
|
+
sandbox = sinon.createSandbox();
|
|
245
247
|
});
|
|
246
248
|
afterEach(function() {
|
|
247
249
|
userSync.canBidderRegisterSync.restore();
|
|
248
250
|
utils.getGptSlotInfoForAdUnitCode.restore();
|
|
251
|
+
sandbox.restore();
|
|
249
252
|
});
|
|
250
253
|
let bidRequest = [{
|
|
251
254
|
'schain': {
|
|
@@ -333,6 +336,36 @@ describe('SonobiBidAdapter', function () {
|
|
|
333
336
|
uspConsent: 'someCCPAString'
|
|
334
337
|
};
|
|
335
338
|
|
|
339
|
+
it('should set fpd if there is any data in ortb2', function() {
|
|
340
|
+
const ortb2 = {
|
|
341
|
+
site: {
|
|
342
|
+
ext: {
|
|
343
|
+
data: {
|
|
344
|
+
pageType: 'article',
|
|
345
|
+
category: 'tools'
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
user: {
|
|
350
|
+
ext: {
|
|
351
|
+
data: {
|
|
352
|
+
registered: true,
|
|
353
|
+
interests: ['cars']
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
sandbox.stub(config, 'getConfig').callsFake(key => {
|
|
360
|
+
const config = {
|
|
361
|
+
ortb2: ortb2
|
|
362
|
+
};
|
|
363
|
+
return utils.deepAccess(config, key);
|
|
364
|
+
});
|
|
365
|
+
const bidRequests = spec.buildRequests(bidRequest, bidderRequests);
|
|
366
|
+
expect(bidRequests.data.fpd).to.equal(JSON.stringify(ortb2));
|
|
367
|
+
});
|
|
368
|
+
|
|
336
369
|
it('should populate coppa as 1 if set in config', function () {
|
|
337
370
|
config.setConfig({coppa: true});
|
|
338
371
|
const bidRequests = spec.buildRequests(bidRequest, bidderRequests);
|
|
@@ -112,6 +112,13 @@ describe('sortableBidAdapter', function() {
|
|
|
112
112
|
'key2': 'val2'
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
|
+
'ortb2Imp': {
|
|
116
|
+
'ext': {
|
|
117
|
+
'data': {
|
|
118
|
+
'pbadslot': 'abc/123'
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
115
122
|
'sizes': [
|
|
116
123
|
[300, 250]
|
|
117
124
|
],
|
|
@@ -176,6 +183,10 @@ describe('sortableBidAdapter', function() {
|
|
|
176
183
|
expect(requestBody.imp[0].floor).to.equal(0.21);
|
|
177
184
|
});
|
|
178
185
|
|
|
186
|
+
it('includes pbadslot in the bid request', function () {
|
|
187
|
+
expect(requestBody.imp[0].ext.gpid).to.equal('abc/123');
|
|
188
|
+
});
|
|
189
|
+
|
|
179
190
|
it('sets domain and href correctly', function () {
|
|
180
191
|
expect(requestBody.site.domain).to.equal('example.com');
|
|
181
192
|
expect(requestBody.site.page).to.equal('http://example.com/page?param=val');
|
|
@@ -403,6 +403,42 @@ describe('the spotx adapter', function () {
|
|
|
403
403
|
expect(request.data.ext.wrap_response).to.equal(0);
|
|
404
404
|
config.getConfig.restore();
|
|
405
405
|
});
|
|
406
|
+
|
|
407
|
+
it('should pass price floor in USD from the floors module if available', function () {
|
|
408
|
+
var request;
|
|
409
|
+
|
|
410
|
+
bid.getFloor = function () {
|
|
411
|
+
return { currency: 'USD', floor: 3 };
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
bid.params.price_floor = 2;
|
|
415
|
+
|
|
416
|
+
request = spec.buildRequests([bid], bidRequestObj)[0];
|
|
417
|
+
|
|
418
|
+
expect(request.data.imp.bidfloor).to.equal(3);
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
it('should not pass price floor if price floors module gives a non-USD currency', function () {
|
|
422
|
+
var request;
|
|
423
|
+
|
|
424
|
+
bid.getFloor = function () {
|
|
425
|
+
return { currency: 'EUR', floor: 3 };
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
request = spec.buildRequests([bid], bidRequestObj)[0];
|
|
429
|
+
|
|
430
|
+
expect(request.data.imp.bidfloor).to.be.undefined;
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
it('if floors module is not available, should pass price floor from price_floor param if available', function () {
|
|
434
|
+
var request;
|
|
435
|
+
|
|
436
|
+
bid.params.price_floor = 2;
|
|
437
|
+
|
|
438
|
+
request = spec.buildRequests([bid], bidRequestObj)[0];
|
|
439
|
+
|
|
440
|
+
expect(request.data.imp.bidfloor).to.equal(2);
|
|
441
|
+
});
|
|
406
442
|
});
|
|
407
443
|
|
|
408
444
|
describe('interpretResponse', function() {
|
|
@@ -40,13 +40,6 @@ describe('SSPBC adapter', function () {
|
|
|
40
40
|
bidderRequestId,
|
|
41
41
|
bidId: auctionId + '1',
|
|
42
42
|
transactionId,
|
|
43
|
-
ortb2Imp: {
|
|
44
|
-
ext: {
|
|
45
|
-
data: {
|
|
46
|
-
pbadslot: 'test_wideboard'
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
43
|
},
|
|
51
44
|
{
|
|
52
45
|
adUnitCode: 'test_rectangle',
|
|
@@ -69,28 +62,6 @@ describe('SSPBC adapter', function () {
|
|
|
69
62
|
bidderRequestId,
|
|
70
63
|
bidId: auctionId + '2',
|
|
71
64
|
transactionId,
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
adUnitCode: 'test_rectangle_2',
|
|
75
|
-
bidder: BIDDER_CODE,
|
|
76
|
-
mediaTypes: {
|
|
77
|
-
banner: {
|
|
78
|
-
sizes: [
|
|
79
|
-
[300, 250]
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
sizes: [
|
|
84
|
-
[300, 250]
|
|
85
|
-
],
|
|
86
|
-
params: {
|
|
87
|
-
id: '011',
|
|
88
|
-
siteId: '8816',
|
|
89
|
-
},
|
|
90
|
-
auctionId,
|
|
91
|
-
bidderRequestId,
|
|
92
|
-
bidId: auctionId + '3',
|
|
93
|
-
transactionId,
|
|
94
65
|
}
|
|
95
66
|
];
|
|
96
67
|
const bid_OneCode = {
|
|
@@ -115,6 +86,67 @@ describe('SSPBC adapter', function () {
|
|
|
115
86
|
bidId: auctionId + '1',
|
|
116
87
|
transactionId,
|
|
117
88
|
};
|
|
89
|
+
const bid_native = {
|
|
90
|
+
adUnitCode: 'test_native',
|
|
91
|
+
bidder: BIDDER_CODE,
|
|
92
|
+
mediaTypes: {
|
|
93
|
+
native: {
|
|
94
|
+
image: {
|
|
95
|
+
required: true,
|
|
96
|
+
sizes: [150, 50],
|
|
97
|
+
},
|
|
98
|
+
title: {
|
|
99
|
+
required: true,
|
|
100
|
+
len: 80
|
|
101
|
+
},
|
|
102
|
+
sponsoredBy: {
|
|
103
|
+
required: true,
|
|
104
|
+
},
|
|
105
|
+
clickUrl: {
|
|
106
|
+
required: true,
|
|
107
|
+
},
|
|
108
|
+
privacyLink: {
|
|
109
|
+
required: false,
|
|
110
|
+
},
|
|
111
|
+
body: {
|
|
112
|
+
required: true,
|
|
113
|
+
},
|
|
114
|
+
icon: {
|
|
115
|
+
required: true,
|
|
116
|
+
sizes: [50, 50]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
sizes: [
|
|
121
|
+
[1, 1],
|
|
122
|
+
],
|
|
123
|
+
auctionId,
|
|
124
|
+
bidderRequestId,
|
|
125
|
+
bidId: auctionId + '1',
|
|
126
|
+
transactionId,
|
|
127
|
+
};
|
|
128
|
+
const bid_video = {
|
|
129
|
+
adUnitCode: 'test_video',
|
|
130
|
+
bidder: BIDDER_CODE,
|
|
131
|
+
mediaTypes: {
|
|
132
|
+
video: {
|
|
133
|
+
context: 'instream',
|
|
134
|
+
playerSize: [[640, 480]],
|
|
135
|
+
mimes: ['video/mp4', 'video/x-ms-wmv', 'video/webm', 'video/3gpp', 'application/javascript'],
|
|
136
|
+
protocols: [2, 3, 5, 6],
|
|
137
|
+
api: [2],
|
|
138
|
+
maxduration: 30,
|
|
139
|
+
linearity: 1
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
sizes: [
|
|
143
|
+
[640, 480],
|
|
144
|
+
],
|
|
145
|
+
auctionId,
|
|
146
|
+
bidderRequestId,
|
|
147
|
+
bidId: auctionId + '1',
|
|
148
|
+
transactionId,
|
|
149
|
+
};
|
|
118
150
|
const bids_timeouted = [{
|
|
119
151
|
adUnitCode: 'test_wideboard',
|
|
120
152
|
bidder: BIDDER_CODE,
|
|
@@ -193,6 +225,30 @@ describe('SSPBC adapter', function () {
|
|
|
193
225
|
stack: ['https://test.site.pl/'],
|
|
194
226
|
}
|
|
195
227
|
};
|
|
228
|
+
const bidRequestNative = {
|
|
229
|
+
auctionId,
|
|
230
|
+
bidderCode: BIDDER_CODE,
|
|
231
|
+
bidderRequestId,
|
|
232
|
+
bids: [bid_native],
|
|
233
|
+
gdprConsent,
|
|
234
|
+
refererInfo: {
|
|
235
|
+
reachedTop: true,
|
|
236
|
+
referer: 'https://test.site.pl/',
|
|
237
|
+
stack: ['https://test.site.pl/'],
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
const bidRequestVideo = {
|
|
241
|
+
auctionId,
|
|
242
|
+
bidderCode: BIDDER_CODE,
|
|
243
|
+
bidderRequestId,
|
|
244
|
+
bids: [bid_video],
|
|
245
|
+
gdprConsent,
|
|
246
|
+
refererInfo: {
|
|
247
|
+
reachedTop: true,
|
|
248
|
+
referer: 'https://test.site.pl/',
|
|
249
|
+
stack: ['https://test.site.pl/'],
|
|
250
|
+
}
|
|
251
|
+
};
|
|
196
252
|
const bidRequestOneCode = {
|
|
197
253
|
auctionId,
|
|
198
254
|
bidderCode: BIDDER_CODE,
|
|
@@ -264,21 +320,6 @@ describe('SSPBC adapter', function () {
|
|
|
264
320
|
}],
|
|
265
321
|
'seat': 'dsp2',
|
|
266
322
|
'group': 0
|
|
267
|
-
}, {
|
|
268
|
-
'bid': [{
|
|
269
|
-
'id': '2d766853-ea07-4529-8299-5f0ebaddfaza',
|
|
270
|
-
'impid': '011',
|
|
271
|
-
'siteid': '8816',
|
|
272
|
-
'slotid': '011',
|
|
273
|
-
'price': 2,
|
|
274
|
-
'adm': 'AD CODE 3',
|
|
275
|
-
'cid': '57745',
|
|
276
|
-
'crid': '858253',
|
|
277
|
-
'w': 300,
|
|
278
|
-
'h': 250
|
|
279
|
-
}],
|
|
280
|
-
'seat': 'dsp3',
|
|
281
|
-
'group': 0
|
|
282
323
|
}],
|
|
283
324
|
'cur': 'PLN'
|
|
284
325
|
}
|
|
@@ -335,6 +376,58 @@ describe('SSPBC adapter', function () {
|
|
|
335
376
|
'cur': 'PLN'
|
|
336
377
|
}
|
|
337
378
|
};
|
|
379
|
+
const serverResponseVideo = {
|
|
380
|
+
'body': {
|
|
381
|
+
'id': auctionId,
|
|
382
|
+
'seatbid': [{
|
|
383
|
+
'bid': [{
|
|
384
|
+
'id': '3347324c-6889-46d2-a800-ae78a5214c06',
|
|
385
|
+
'impid': 'bidid-' + auctionId + '1',
|
|
386
|
+
'price': 1,
|
|
387
|
+
'adid': 'lxHWkB7OnZeso3QiN1N4',
|
|
388
|
+
'nurl': '',
|
|
389
|
+
'adm': '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><VAST version=\"3.0\"><Ad id=\"12345\"><Wrapper><AdSystem version=\"3.0\">adnxs</AdSystem><VASTAdTagURI><![CDATA[https://video.tag.uri]]></VASTAdTagURI><Impression><![CDATA[https://video.tag.tracker]]></Impression><Creatives><Creative adID=\"305683174\"><Linear></Linear></Creative></Creatives></Wrapper></Ad></VAST>',
|
|
390
|
+
'adomain': ['adomain.pl'],
|
|
391
|
+
'cid': 'BZ4gAg21T5nNtxlUCDSW',
|
|
392
|
+
'crid': 'lxHWkB7OnZeso3QiN1N4',
|
|
393
|
+
'w': 640,
|
|
394
|
+
'h': 480,
|
|
395
|
+
'ext': {
|
|
396
|
+
'siteid': '8816',
|
|
397
|
+
'slotid': '150',
|
|
398
|
+
},
|
|
399
|
+
}],
|
|
400
|
+
'seat': 'dsp1',
|
|
401
|
+
'group': 0
|
|
402
|
+
}],
|
|
403
|
+
'cur': 'PLN'
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
const serverResponseNative = {
|
|
407
|
+
'body': {
|
|
408
|
+
'id': auctionId,
|
|
409
|
+
'seatbid': [{
|
|
410
|
+
'bid': [{
|
|
411
|
+
'id': '3347324c-6889-46d2-a800-ae78a5214c06',
|
|
412
|
+
'impid': 'bidid-' + auctionId + '1',
|
|
413
|
+
'price': 1,
|
|
414
|
+
'adid': 'lxHWkB7OnZeso3QiN1N4',
|
|
415
|
+
'nurl': '',
|
|
416
|
+
'adm': '{\"native\":{\"assets\":[{\"id\":3,\"img\":{\"url\":\"native_image\",\"w\":300,\"h\":150}},{\"id\":2,\"img\":{\"url\":\"native_icon\",\"w\":50,\"h\":50}},{\"id\":0,\"title\":{\"text\":\"native_title\"}},{\"id\":5,\"data\":{\"value\":\"native adomain\"}},{\"id\":4,\"data\":{\"value\":\"native_text\"}}],\"link\":{\"url\":\"native_url\"},\"imptrackers\":[\"native_tracker\"]}}',
|
|
417
|
+
'adomain': ['adomain.pl'],
|
|
418
|
+
'cid': 'BZ4gAg21T5nNtxlUCDSW',
|
|
419
|
+
'crid': 'lxHWkB7OnZeso3QiN1N4',
|
|
420
|
+
'ext': {
|
|
421
|
+
'siteid': '8816',
|
|
422
|
+
'slotid': '80',
|
|
423
|
+
},
|
|
424
|
+
}],
|
|
425
|
+
'seat': 'dsp1',
|
|
426
|
+
'group': 0
|
|
427
|
+
}],
|
|
428
|
+
'cur': 'PLN'
|
|
429
|
+
}
|
|
430
|
+
};
|
|
338
431
|
const emptyResponse = {
|
|
339
432
|
'body': {
|
|
340
433
|
'id': auctionId,
|
|
@@ -345,14 +438,20 @@ describe('SSPBC adapter', function () {
|
|
|
345
438
|
bids,
|
|
346
439
|
bids_test,
|
|
347
440
|
bids_timeouted,
|
|
441
|
+
bid_native,
|
|
442
|
+
bid_video,
|
|
348
443
|
bidRequest,
|
|
349
444
|
bidRequestOneCode,
|
|
350
445
|
bidRequestSingle,
|
|
446
|
+
bidRequestNative,
|
|
447
|
+
bidRequestVideo,
|
|
351
448
|
bidRequestTest,
|
|
352
449
|
bidRequestTestNoGDPR,
|
|
353
450
|
serverResponse,
|
|
354
451
|
serverResponseOneCode,
|
|
355
452
|
serverResponseSingle,
|
|
453
|
+
serverResponseVideo,
|
|
454
|
+
serverResponseNative,
|
|
356
455
|
emptyResponse
|
|
357
456
|
};
|
|
358
457
|
};
|
|
@@ -377,14 +476,15 @@ describe('SSPBC adapter', function () {
|
|
|
377
476
|
});
|
|
378
477
|
|
|
379
478
|
describe('buildRequests', function () {
|
|
380
|
-
const { bids, bidRequest, bidRequestSingle } = prepareTestData();
|
|
479
|
+
const { bids, bid_native, bid_video, bidRequest, bidRequestSingle, bidRequestNative, bidRequestVideo } = prepareTestData();
|
|
381
480
|
const request = spec.buildRequests(bids, bidRequest);
|
|
382
481
|
const requestSingle = spec.buildRequests([bids[0]], bidRequestSingle);
|
|
482
|
+
const requestNative = spec.buildRequests([bid_native], bidRequestNative);
|
|
483
|
+
const requestVideo = spec.buildRequests([bid_video], bidRequestVideo);
|
|
383
484
|
const payload = request ? JSON.parse(request.data) : { site: false, imp: false };
|
|
384
|
-
const payloadSingle =
|
|
385
|
-
const
|
|
386
|
-
const
|
|
387
|
-
const payloadExt2 = payload.imp ? payload.imp[2].ext : {};
|
|
485
|
+
const payloadSingle = requestSingle ? JSON.parse(requestSingle.data) : { site: false, imp: false };
|
|
486
|
+
const payloadNative = requestNative ? JSON.parse(requestNative.data) : { site: false, imp: false };
|
|
487
|
+
const payloadVideo = requestVideo ? JSON.parse(requestVideo.data) : { site: false, imp: false };
|
|
388
488
|
|
|
389
489
|
it('should send bid request to endpoint via POST', function () {
|
|
390
490
|
expect(request.url).to.contain(BIDDER_URL);
|
|
@@ -401,17 +501,6 @@ describe('SSPBC adapter', function () {
|
|
|
401
501
|
expect(payloadSingle.imp.length).to.equal(1);
|
|
402
502
|
});
|
|
403
503
|
|
|
404
|
-
it('should add first party data (pbslot)', function () {
|
|
405
|
-
expect(payloadExt0.data).to.be.an('object').and.to.have.property('pbadslot');
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
it('should add maximum size of adunit, and how many times this size has been requested (pbsize)', function () {
|
|
409
|
-
expect(payloadExt0.data).to.be.an('object').and.to.have.property('pbsize');
|
|
410
|
-
expect(payloadExt0.data.pbsize).to.equal('750x200_1');
|
|
411
|
-
expect(payloadExt1.data.pbsize).to.equal('300x250_1');
|
|
412
|
-
expect(payloadExt2.data.pbsize).to.equal('300x250_2');
|
|
413
|
-
});
|
|
414
|
-
|
|
415
504
|
it('should save bidder request data', function () {
|
|
416
505
|
expect(request.bidderRequest).to.deep.equal(bidRequest);
|
|
417
506
|
});
|
|
@@ -428,13 +517,49 @@ describe('SSPBC adapter', function () {
|
|
|
428
517
|
expect(payload.regs).to.be.an('object').and.to.have.property('[ortb_extensions.gdpr]', 1);
|
|
429
518
|
expect(payload.user).to.be.an('object').and.to.have.property('[ortb_extensions.consent]', bidRequest.gdprConsent.consentString);
|
|
430
519
|
});
|
|
520
|
+
|
|
521
|
+
it('should build correct native payload', function () {
|
|
522
|
+
const nativeAssets = payloadNative.imp && payloadNative.imp[0].native.request;
|
|
523
|
+
|
|
524
|
+
expect(payloadNative.imp.length).to.equal(1);
|
|
525
|
+
expect(nativeAssets).to.contain('{"id":0,"required":true,"title":{"len":80}}');
|
|
526
|
+
expect(nativeAssets).to.contain('{"id":2,"required":true,"img":{"type":1,"w":50,"h":50}}');
|
|
527
|
+
expect(nativeAssets).to.contain('{"id":3,"required":true,"img":{"type":3,"w":150,"h":50}}');
|
|
528
|
+
expect(nativeAssets).to.contain('{"id":4,"required":true,"data":{"type":2}');
|
|
529
|
+
expect(nativeAssets).to.contain('{"id":5,"required":true,"data":{"type":1}');
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
it('should build correct video payload', function () {
|
|
533
|
+
const videoAssets = payloadVideo.imp && payloadVideo.imp[0].video;
|
|
534
|
+
|
|
535
|
+
expect(payloadVideo.imp.length).to.equal(1);
|
|
536
|
+
expect(videoAssets).to.have.property('w').that.equals(640);
|
|
537
|
+
expect(videoAssets).to.have.property('h').that.equals(480);
|
|
538
|
+
expect(videoAssets).to.have.property('context').that.equals('instream');
|
|
539
|
+
expect(videoAssets).to.have.property('maxduration').that.equals(30);
|
|
540
|
+
expect(videoAssets).to.have.property('linearity').that.equals(1);
|
|
541
|
+
expect(videoAssets).to.have.property('mimes').that.is.an('array');
|
|
542
|
+
expect(videoAssets).to.have.property('protocols').that.is.an('array');
|
|
543
|
+
expect(videoAssets).to.have.property('api').that.is.an('array');
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
it('should create auxilary placement identifier (size_numUsed)', function () {
|
|
547
|
+
const extAssets1 = payload.imp && payload.imp[0].ext.data;
|
|
548
|
+
const extAssets2 = payloadSingle.imp && payloadSingle.imp[0].ext.data;
|
|
549
|
+
|
|
550
|
+
// note that payload comes from first, and payloadSingle from second auction in the test run
|
|
551
|
+
expect(extAssets1).to.have.property('pbsize').that.equals('750x200_1')
|
|
552
|
+
expect(extAssets2).to.have.property('pbsize').that.equals('750x200_2')
|
|
553
|
+
});
|
|
431
554
|
});
|
|
432
555
|
|
|
433
556
|
describe('interpretResponse', function () {
|
|
434
|
-
const { bid_OneCode, bids, emptyResponse, serverResponse, serverResponseOneCode, serverResponseSingle, bidRequest, bidRequestOneCode, bidRequestSingle } = prepareTestData();
|
|
557
|
+
const { bid_OneCode, bid_video, bid_native, bids, emptyResponse, serverResponse, serverResponseOneCode, serverResponseSingle, serverResponseVideo, serverResponseNative, bidRequest, bidRequestOneCode, bidRequestSingle, bidRequestVideo, bidRequestNative } = prepareTestData();
|
|
435
558
|
const request = spec.buildRequests(bids, bidRequest);
|
|
436
559
|
const requestSingle = spec.buildRequests([bids[0]], bidRequestSingle);
|
|
437
560
|
const requestOneCode = spec.buildRequests([bid_OneCode], bidRequestOneCode);
|
|
561
|
+
const requestVideo = spec.buildRequests([bid_video], bidRequestVideo);
|
|
562
|
+
const requestNative = spec.buildRequests([bid_native], bidRequestNative);
|
|
438
563
|
|
|
439
564
|
it('should handle nobid responses', function () {
|
|
440
565
|
let result = spec.interpretResponse(emptyResponse, request);
|
|
@@ -476,7 +601,30 @@ describe('SSPBC adapter', function () {
|
|
|
476
601
|
expect(adcode).to.contain('window.mcad');
|
|
477
602
|
expect(adcode).to.contain('window.gdpr');
|
|
478
603
|
expect(adcode).to.contain('window.page');
|
|
479
|
-
})
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
it('should create a correct video bid', function () {
|
|
607
|
+
let resultVideo = spec.interpretResponse(serverResponseVideo, requestVideo);
|
|
608
|
+
|
|
609
|
+
expect(resultVideo.length).to.equal(1);
|
|
610
|
+
|
|
611
|
+
let videoBid = resultVideo[0];
|
|
612
|
+
expect(videoBid).to.have.keys('adType', 'bidderCode', 'cpm', 'creativeId', 'currency', 'width', 'height', 'meta', 'mediaType', 'netRevenue', 'requestId', 'ttl', 'vastContent', 'vastXml');
|
|
613
|
+
expect(videoBid.adType).to.equal('instream');
|
|
614
|
+
expect(videoBid.mediaType).to.equal('video');
|
|
615
|
+
expect(videoBid.vastXml).to.match(/^<\?xml.*<\/VAST>$/);
|
|
616
|
+
expect(videoBid.vastContent).to.match(/^<\?xml.*<\/VAST>$/);
|
|
617
|
+
});
|
|
618
|
+
|
|
619
|
+
it('should create a correct native bid', function () {
|
|
620
|
+
let resultNative = spec.interpretResponse(serverResponseNative, requestNative);
|
|
621
|
+
|
|
622
|
+
expect(resultNative.length).to.equal(1);
|
|
623
|
+
|
|
624
|
+
let nativeBid = resultNative[0];
|
|
625
|
+
expect(nativeBid).to.have.keys('bidderCode', 'cpm', 'creativeId', 'currency', 'width', 'height', 'meta', 'mediaType', 'netRevenue', 'requestId', 'ttl', 'native');
|
|
626
|
+
expect(nativeBid.native).to.have.keys('image', 'icon', 'title', 'sponsoredBy', 'body', 'clickUrl', 'impressionTrackers');
|
|
627
|
+
});
|
|
480
628
|
});
|
|
481
629
|
|
|
482
630
|
describe('getUserSyncs', function () {
|