prebid.js 6.3.0 → 6.7.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/.circleci/config.yml +1 -1
- package/gulpfile.js +87 -74
- package/integrationExamples/gpt/amp/creative.html +11 -33
- package/karma.conf.maker.js +1 -1
- package/modules/.submodules.json +2 -1
- package/modules/adbookpspBidAdapter.js +27 -10
- package/modules/adhashBidAdapter.js +3 -3
- package/modules/adkernelBidAdapter.js +148 -62
- package/modules/adlooxAdServerVideo.js +2 -2
- package/modules/adlooxAnalyticsAdapter.js +4 -4
- package/modules/admanBidAdapter.js +10 -4
- package/modules/adomikAnalyticsAdapter.js +27 -9
- package/modules/adqueryIdSystem.js +103 -0
- package/modules/adqueryIdSystem.md +35 -0
- package/modules/adyoulikeBidAdapter.js +13 -9
- package/modules/aniviewBidAdapter.js +1 -1
- package/modules/beopBidAdapter.js +1 -1
- package/modules/bidViewability.js +3 -3
- package/modules/bidViewabilityIO.js +3 -3
- package/modules/bliinkBidAdapter.js +3 -2
- package/modules/colossussspBidAdapter.js +12 -8
- package/modules/colossussspBidAdapter.md +15 -1
- package/modules/compassBidAdapter.js +208 -0
- package/modules/compassBidAdapter.md +79 -0
- package/modules/consentManagement.js +7 -1
- package/modules/consumableBidAdapter.md +1 -1
- package/modules/criteoBidAdapter.js +1 -1
- package/modules/criteoIdSystem.js +29 -7
- package/modules/currency.js +2 -2
- package/modules/dailyhuntBidAdapter.js +435 -0
- package/modules/dailyhuntBidAdapter.md +4 -0
- package/modules/docereeBidAdapter.js +10 -1
- package/modules/docereeBidAdapter.md +2 -0
- package/modules/engageyaBidAdapter.js +1 -1
- package/modules/feedadBidAdapter.js +2 -2
- package/modules/feedadBidAdapter.md +4 -2
- package/modules/glimpseBidAdapter.js +66 -44
- package/modules/gnetBidAdapter.js +3 -3
- package/modules/gnetBidAdapter.md +4 -4
- package/modules/gptPreAuction.js +55 -7
- package/modules/gridBidAdapter.js +4 -3
- package/modules/gumgumBidAdapter.js +4 -4
- package/modules/idImportLibrary.js +45 -8
- package/modules/idImportLibrary.md +4 -0
- package/modules/improvedigitalBidAdapter.js +42 -4
- package/modules/instreamTracking.js +4 -4
- package/modules/invibesBidAdapter.js +49 -5
- package/modules/invibesBidAdapter.md +2 -1
- package/modules/ixBidAdapter.js +53 -18
- package/modules/jwplayerRtdProvider.js +71 -6
- package/modules/jwplayerRtdProvider.md +27 -11
- package/modules/kargoBidAdapter.js +2 -2
- package/modules/limelightDigitalBidAdapter.js +2 -1
- package/modules/livewrappedAnalyticsAdapter.js +3 -1
- package/modules/livewrappedBidAdapter.js +8 -2
- package/modules/loglyliftBidAdapter.js +79 -0
- package/modules/loglyliftBidAdapter.md +55 -0
- package/modules/nextMillenniumBidAdapter.js +11 -7
- package/modules/oguryBidAdapter.js +9 -2
- package/modules/onetagBidAdapter.js +4 -2
- package/modules/optimeraRtdProvider.js +8 -1
- package/modules/ozoneBidAdapter.js +21 -64
- package/modules/pilotxBidAdapter.js +147 -0
- package/modules/pilotxBidAdapter.md +50 -0
- package/modules/proxistoreBidAdapter.js +0 -2
- package/modules/pubgeniusBidAdapter.js +1 -1
- package/modules/pubmaticAnalyticsAdapter.js +16 -0
- package/modules/pubxaiAnalyticsAdapter.js +17 -0
- package/modules/richaudienceBidAdapter.js +3 -2
- package/modules/riseBidAdapter.js +1 -1
- package/modules/rtbhouseBidAdapter.js +14 -4
- package/modules/rtdModule/index.js +14 -15
- package/modules/rubiconAnalyticsAdapter.js +3 -2
- package/modules/rubiconBidAdapter.js +21 -11
- package/modules/seedingAllianceBidAdapter.js +3 -3
- package/modules/sharethroughBidAdapter.js +12 -17
- package/modules/showheroes-bsBidAdapter.js +13 -2
- package/modules/synacormediaBidAdapter.js +31 -10
- package/modules/tappxBidAdapter.js +8 -5
- package/modules/teadsBidAdapter.js +1 -2
- package/modules/telariaBidAdapter.js +2 -2
- package/modules/trustxBidAdapter.js +8 -16
- package/modules/userId/eids.js +7 -1
- package/modules/userId/userId.md +8 -0
- package/modules/viewability.js +177 -0
- package/modules/viewability.md +87 -0
- package/modules/welectBidAdapter.js +106 -0
- package/modules/yieldmoBidAdapter.js +23 -5
- package/modules/zeta_global_sspAnalyticsAdapter.js +97 -0
- package/modules/zeta_global_sspAnalyticsAdapter.md +24 -0
- package/package.json +1 -1
- package/src/auction.js +2 -2
- package/src/config.js +27 -3
- package/src/hook.js +5 -1
- package/src/prebid.js +20 -4
- package/src/secureCreatives.js +3 -2
- package/src/utils.js +12 -1
- package/test/helpers/prebidGlobal.js +1 -0
- package/test/spec/config_spec.js +279 -0
- package/test/spec/modules/adbookpspBidAdapter_spec.js +17 -3
- package/test/spec/modules/adhashBidAdapter_spec.js +2 -2
- package/test/spec/modules/adlooxAnalyticsAdapter_spec.js +6 -6
- package/test/spec/modules/admanBidAdapter_spec.js +2 -2
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +9 -1
- package/test/spec/modules/adqueryIdSystem_spec.js +74 -0
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +49 -0
- package/test/spec/modules/beopBidAdapter_spec.js +1 -1
- package/test/spec/modules/bidViewabilityIO_spec.js +2 -2
- package/test/spec/modules/bidViewability_spec.js +4 -4
- package/test/spec/modules/bliinkBidAdapter_spec.js +2 -0
- package/test/spec/modules/colossussspBidAdapter_spec.js +5 -2
- package/test/spec/modules/compassBidAdapter_spec.js +398 -0
- package/test/spec/modules/consentManagement_spec.js +20 -0
- package/test/spec/modules/criteoIdSystem_spec.js +6 -3
- package/test/spec/modules/dailyhuntBidAdapter_spec.js +404 -0
- package/test/spec/modules/docereeBidAdapter_spec.js +9 -1
- package/test/spec/modules/eids_spec.js +15 -0
- package/test/spec/modules/feedadBidAdapter_spec.js +15 -0
- package/test/spec/modules/glimpseBidAdapter_spec.js +0 -18
- package/test/spec/modules/gnetBidAdapter_spec.js +6 -6
- package/test/spec/modules/gptPreAuction_spec.js +177 -2
- package/test/spec/modules/idImportLibrary_spec.js +197 -10
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +45 -1
- package/test/spec/modules/invibesBidAdapter_spec.js +119 -0
- package/test/spec/modules/ixBidAdapter_spec.js +112 -62
- package/test/spec/modules/jwplayerRtdProvider_spec.js +195 -2
- package/test/spec/modules/kargoBidAdapter_spec.js +1 -1
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +75 -17
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +22 -0
- package/test/spec/modules/livewrappedBidAdapter_spec.js +31 -0
- package/test/spec/modules/loglyliftBidAdapter_spec.js +172 -0
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +9 -2
- package/test/spec/modules/oguryBidAdapter_spec.js +10 -2
- package/test/spec/modules/optimeraRtdProvider_spec.js +14 -1
- package/test/spec/modules/ozoneBidAdapter_spec.js +43 -31
- package/test/spec/modules/pilotxBidAdapter_spec.js +244 -0
- package/test/spec/modules/pubgeniusBidAdapter_spec.js +3 -3
- package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +13 -1
- package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +11 -0
- package/test/spec/modules/realTimeDataModule_spec.js +67 -5
- package/test/spec/modules/richaudienceBidAdapter_spec.js +40 -0
- package/test/spec/modules/riseBidAdapter_spec.js +1 -1
- package/test/spec/modules/rtbhouseBidAdapter_spec.js +20 -0
- package/test/spec/modules/rubiconAnalyticsAdapter_spec.js +30 -0
- package/test/spec/modules/rubiconBidAdapter_spec.js +48 -9
- package/test/spec/modules/sharethroughBidAdapter_spec.js +91 -6
- package/test/spec/modules/showheroes-bsBidAdapter_spec.js +2 -0
- package/test/spec/modules/synacormediaBidAdapter_spec.js +70 -0
- package/test/spec/modules/tappxBidAdapter_spec.js +0 -19
- package/test/spec/modules/teadsBidAdapter_spec.js +14 -59
- package/test/spec/modules/userId_spec.js +68 -19
- package/test/spec/modules/viewability_spec.js +280 -0
- package/test/spec/modules/welectBidAdapter_spec.js +211 -0
- package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +427 -0
- package/test/spec/unit/pbjs_api_spec.js +3 -1
- package/test/test_deps.js +3 -0
- package/test/test_index.js +1 -3
|
@@ -1408,7 +1408,7 @@ describe('the rubicon adapter', function () {
|
|
|
1408
1408
|
expect(data['tg_i.pbadslot']).to.equal('abc');
|
|
1409
1409
|
});
|
|
1410
1410
|
|
|
1411
|
-
it('should send \"tg_i.pbadslot\" if \"ortb2Imp.ext.data.pbadslot\" value is a valid string
|
|
1411
|
+
it('should send \"tg_i.pbadslot\" if \"ortb2Imp.ext.data.pbadslot\" value is a valid string', function () {
|
|
1412
1412
|
bidderRequest.bids[0].ortb2Imp = {
|
|
1413
1413
|
ext: {
|
|
1414
1414
|
data: {
|
|
@@ -1422,7 +1422,45 @@ describe('the rubicon adapter', function () {
|
|
|
1422
1422
|
|
|
1423
1423
|
expect(data).to.be.an('Object');
|
|
1424
1424
|
expect(data).to.have.property('tg_i.pbadslot');
|
|
1425
|
-
expect(data['tg_i.pbadslot']).to.equal('a/b/c');
|
|
1425
|
+
expect(data['tg_i.pbadslot']).to.equal('/a/b/c');
|
|
1426
|
+
});
|
|
1427
|
+
|
|
1428
|
+
it('should send gpid as p_gpid if valid', function () {
|
|
1429
|
+
bidderRequest.bids[0].ortb2Imp = {
|
|
1430
|
+
ext: {
|
|
1431
|
+
gpid: '/1233/sports&div1'
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
const [request] = spec.buildRequests(bidderRequest.bids, bidderRequest);
|
|
1436
|
+
const data = parseQuery(request.data);
|
|
1437
|
+
|
|
1438
|
+
expect(data).to.be.an('Object');
|
|
1439
|
+
expect(data).to.have.property('p_gpid');
|
|
1440
|
+
expect(data['p_gpid']).to.equal('/1233/sports&div1');
|
|
1441
|
+
});
|
|
1442
|
+
|
|
1443
|
+
it('should send gpid and pbadslot since it is prefered over dfp code', function () {
|
|
1444
|
+
bidderRequest.bids[0].ortb2Imp = {
|
|
1445
|
+
ext: {
|
|
1446
|
+
gpid: '/1233/sports&div1',
|
|
1447
|
+
data: {
|
|
1448
|
+
pbadslot: 'pb_slot',
|
|
1449
|
+
adserver: {
|
|
1450
|
+
adslot: '/1234/sports',
|
|
1451
|
+
name: 'gam'
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
const [request] = spec.buildRequests(bidderRequest.bids, bidderRequest);
|
|
1458
|
+
const data = parseQuery(request.data);
|
|
1459
|
+
|
|
1460
|
+
expect(data).to.be.an('Object');
|
|
1461
|
+
expect(data['p_gpid']).to.equal('/1233/sports&div1');
|
|
1462
|
+
expect(data).to.not.have.property('tg_i.dfp_ad_unit_code');
|
|
1463
|
+
expect(data['tg_i.pbadslot']).to.equal('pb_slot');
|
|
1426
1464
|
});
|
|
1427
1465
|
});
|
|
1428
1466
|
|
|
@@ -1470,12 +1508,13 @@ describe('the rubicon adapter', function () {
|
|
|
1470
1508
|
expect(data).to.not.have.property('tg_i.dfp_ad_unit_code');
|
|
1471
1509
|
});
|
|
1472
1510
|
|
|
1473
|
-
it('should send \"tg_i.dfp_ad_unit_code\" if \"ortb2Imp.ext.data.adServer.adslot\" value is a valid string', function () {
|
|
1511
|
+
it('should send NOT \"tg_i.dfp_ad_unit_code\" if \"ortb2Imp.ext.data.adServer.adslot\" value is a valid string but not gam', function () {
|
|
1474
1512
|
bidderRequest.bids[0].ortb2Imp = {
|
|
1475
1513
|
ext: {
|
|
1476
1514
|
data: {
|
|
1477
1515
|
adserver: {
|
|
1478
|
-
adslot: '
|
|
1516
|
+
adslot: '/a/b/c',
|
|
1517
|
+
name: 'not gam'
|
|
1479
1518
|
}
|
|
1480
1519
|
}
|
|
1481
1520
|
}
|
|
@@ -1485,16 +1524,16 @@ describe('the rubicon adapter', function () {
|
|
|
1485
1524
|
const data = parseQuery(request.data);
|
|
1486
1525
|
|
|
1487
1526
|
expect(data).to.be.an('Object');
|
|
1488
|
-
expect(data).to.have.property('tg_i.dfp_ad_unit_code');
|
|
1489
|
-
expect(data['tg_i.dfp_ad_unit_code']).to.equal('abc');
|
|
1527
|
+
expect(data).to.not.have.property('tg_i.dfp_ad_unit_code');
|
|
1490
1528
|
});
|
|
1491
1529
|
|
|
1492
|
-
it('should send \"tg_i.dfp_ad_unit_code\" if \"ortb2Imp.ext.data.adServer.adslot\" value is a valid string
|
|
1530
|
+
it('should send \"tg_i.dfp_ad_unit_code\" if \"ortb2Imp.ext.data.adServer.adslot\" value is a valid string and name is gam', function () {
|
|
1493
1531
|
bidderRequest.bids[0].ortb2Imp = {
|
|
1494
1532
|
ext: {
|
|
1495
1533
|
data: {
|
|
1496
1534
|
adserver: {
|
|
1497
|
-
|
|
1535
|
+
name: 'gam',
|
|
1536
|
+
adslot: '/a/b/c'
|
|
1498
1537
|
}
|
|
1499
1538
|
}
|
|
1500
1539
|
}
|
|
@@ -1505,7 +1544,7 @@ describe('the rubicon adapter', function () {
|
|
|
1505
1544
|
|
|
1506
1545
|
expect(data).to.be.an('Object');
|
|
1507
1546
|
expect(data).to.have.property('tg_i.dfp_ad_unit_code');
|
|
1508
|
-
expect(data['tg_i.dfp_ad_unit_code']).to.equal('a/b/c');
|
|
1547
|
+
expect(data['tg_i.dfp_ad_unit_code']).to.equal('/a/b/c');
|
|
1509
1548
|
});
|
|
1510
1549
|
});
|
|
1511
1550
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
|
+
import * as sinon from 'sinon';
|
|
2
3
|
import { sharethroughAdapterSpec, sharethroughInternal } from 'modules/sharethroughBidAdapter.js';
|
|
3
4
|
import { newBidder } from 'src/adapters/bidderFactory.js';
|
|
4
5
|
import { config } from 'src/config';
|
|
@@ -157,7 +158,6 @@ describe('sharethrough adapter spec', function () {
|
|
|
157
158
|
startdelay: 42,
|
|
158
159
|
skipmin: 10,
|
|
159
160
|
skipafter: 20,
|
|
160
|
-
placement: 1,
|
|
161
161
|
delivery: 1,
|
|
162
162
|
companiontype: 'companion type',
|
|
163
163
|
companionad: 'companion ad',
|
|
@@ -205,6 +205,7 @@ describe('sharethrough adapter spec', function () {
|
|
|
205
205
|
expect(openRtbReq.cur).to.deep.equal(['USD']);
|
|
206
206
|
expect(openRtbReq.tmax).to.equal(242);
|
|
207
207
|
|
|
208
|
+
expect(Object.keys(openRtbReq.site)).to.have.length(3);
|
|
208
209
|
expect(openRtbReq.site.domain).not.to.be.undefined;
|
|
209
210
|
expect(openRtbReq.site.page).not.to.be.undefined;
|
|
210
211
|
expect(openRtbReq.site.ref).to.equal('https://referer.com');
|
|
@@ -256,6 +257,17 @@ describe('sharethrough adapter spec', function () {
|
|
|
256
257
|
});
|
|
257
258
|
});
|
|
258
259
|
|
|
260
|
+
describe('no referer provided', () => {
|
|
261
|
+
beforeEach(() => {
|
|
262
|
+
bidderRequest = {};
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
it('should set referer to undefined', () => {
|
|
266
|
+
const openRtbReq = spec.buildRequests(bidRequests, bidderRequest)[0].data;
|
|
267
|
+
expect(openRtbReq.site.ref).to.be.undefined;
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
|
|
259
271
|
describe('regulation', () => {
|
|
260
272
|
describe('gdpr', () => {
|
|
261
273
|
it('should populate request accordingly when gdpr applies', () => {
|
|
@@ -419,17 +431,90 @@ describe('sharethrough adapter spec', function () {
|
|
|
419
431
|
expect(videoImp.startdelay).to.equal(0);
|
|
420
432
|
expect(videoImp.skipmin).to.equal(0);
|
|
421
433
|
expect(videoImp.skipafter).to.equal(0);
|
|
422
|
-
expect(videoImp.placement).to.
|
|
434
|
+
expect(videoImp.placement).to.equal(1);
|
|
423
435
|
expect(videoImp.delivery).to.be.undefined;
|
|
424
436
|
expect(videoImp.companiontype).to.be.undefined;
|
|
425
437
|
expect(videoImp.companionad).to.be.undefined;
|
|
426
438
|
});
|
|
427
439
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
440
|
+
describe('outstream', () => {
|
|
441
|
+
it('should use placement value if provided', () => {
|
|
442
|
+
bidRequests[1].mediaTypes.video.context = 'outstream';
|
|
443
|
+
bidRequests[1].mediaTypes.video.placement = 3;
|
|
444
|
+
|
|
445
|
+
const builtRequest = spec.buildRequests(bidRequests, bidderRequest)[1];
|
|
446
|
+
const videoImp = builtRequest.data.imp[0].video;
|
|
447
|
+
|
|
448
|
+
expect(videoImp.placement).to.equal(3);
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
it('should default placement to 4 if not provided', () => {
|
|
452
|
+
bidRequests[1].mediaTypes.video.context = 'outstream';
|
|
453
|
+
|
|
454
|
+
const builtRequest = spec.buildRequests(bidRequests, bidderRequest)[1];
|
|
455
|
+
const videoImp = builtRequest.data.imp[0].video;
|
|
456
|
+
|
|
457
|
+
expect(videoImp.placement).to.equal(4);
|
|
458
|
+
});
|
|
459
|
+
});
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
describe('first party data', () => {
|
|
463
|
+
const firstPartyData = {
|
|
464
|
+
site: {
|
|
465
|
+
name: 'example',
|
|
466
|
+
keywords: 'power tools, drills',
|
|
467
|
+
search: 'drill',
|
|
468
|
+
content: {
|
|
469
|
+
userrating: '4',
|
|
470
|
+
},
|
|
471
|
+
ext: {
|
|
472
|
+
data: {
|
|
473
|
+
pageType: 'article',
|
|
474
|
+
category: 'repair',
|
|
475
|
+
},
|
|
476
|
+
},
|
|
477
|
+
},
|
|
478
|
+
user: {
|
|
479
|
+
yob: 1985,
|
|
480
|
+
gender: 'm',
|
|
481
|
+
ext: {
|
|
482
|
+
data: {
|
|
483
|
+
registered: true,
|
|
484
|
+
interests: ['cars'],
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
let configStub;
|
|
491
|
+
|
|
492
|
+
beforeEach(() => {
|
|
493
|
+
configStub = sinon.stub(config, 'getConfig');
|
|
494
|
+
configStub.withArgs('ortb2').returns(firstPartyData);
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
afterEach(() => {
|
|
498
|
+
configStub.restore();
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
it('should include first party data in open rtb request, site section', () => {
|
|
502
|
+
const openRtbReq = spec.buildRequests(bidRequests, bidderRequest)[0].data;
|
|
503
|
+
|
|
504
|
+
expect(openRtbReq.site.name).to.equal(firstPartyData.site.name);
|
|
505
|
+
expect(openRtbReq.site.keywords).to.equal(firstPartyData.site.keywords);
|
|
506
|
+
expect(openRtbReq.site.search).to.equal(firstPartyData.site.search);
|
|
507
|
+
expect(openRtbReq.site.content).to.deep.equal(firstPartyData.site.content);
|
|
508
|
+
expect(openRtbReq.site.ext).to.deep.equal(firstPartyData.site.ext);
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
it('should include first party data in open rtb request, user section', () => {
|
|
512
|
+
const openRtbReq = spec.buildRequests(bidRequests, bidderRequest)[0].data;
|
|
431
513
|
|
|
432
|
-
expect(
|
|
514
|
+
expect(openRtbReq.user.yob).to.equal(firstPartyData.user.yob);
|
|
515
|
+
expect(openRtbReq.user.gender).to.equal(firstPartyData.user.gender);
|
|
516
|
+
expect(openRtbReq.user.ext.data).to.deep.equal(firstPartyData.user.ext.data);
|
|
517
|
+
expect(openRtbReq.user.ext.eids).not.to.be.undefined;
|
|
433
518
|
});
|
|
434
519
|
});
|
|
435
520
|
});
|
|
@@ -13,6 +13,7 @@ const adomain = ['showheroes.com'];
|
|
|
13
13
|
|
|
14
14
|
const gdpr = {
|
|
15
15
|
'gdprConsent': {
|
|
16
|
+
'apiVersion': 2,
|
|
16
17
|
'consentString': 'BOEFEAyOEFEAyAHABDENAI4AAAB9vABAASA',
|
|
17
18
|
'gdprApplies': true
|
|
18
19
|
}
|
|
@@ -332,6 +333,7 @@ describe('shBidAdapter', function () {
|
|
|
332
333
|
{
|
|
333
334
|
'cpm': 5,
|
|
334
335
|
'creativeId': 'c_38b373e1e31c18',
|
|
336
|
+
'adUnitCode': 'adunit-code-1',
|
|
335
337
|
'currency': 'EUR',
|
|
336
338
|
'width': 640,
|
|
337
339
|
'height': 480,
|
|
@@ -1231,4 +1231,74 @@ describe('synacormediaBidAdapter ', function () {
|
|
|
1231
1231
|
expect(usersyncs).to.be.an('array').that.is.empty;
|
|
1232
1232
|
});
|
|
1233
1233
|
});
|
|
1234
|
+
|
|
1235
|
+
describe('Bid Requests with price module should use if available', function () {
|
|
1236
|
+
let validVideoBidRequest = {
|
|
1237
|
+
bidder: 'synacormedia',
|
|
1238
|
+
params: {
|
|
1239
|
+
bidfloor: '0.50',
|
|
1240
|
+
seatId: 'prebid',
|
|
1241
|
+
placementId: 'demo1',
|
|
1242
|
+
pos: 1,
|
|
1243
|
+
video: {}
|
|
1244
|
+
},
|
|
1245
|
+
renderer: {
|
|
1246
|
+
url: '../syncOutstreamPlayer.js'
|
|
1247
|
+
},
|
|
1248
|
+
mediaTypes: {
|
|
1249
|
+
video: {
|
|
1250
|
+
playerSize: [[300, 250]],
|
|
1251
|
+
context: 'outstream'
|
|
1252
|
+
}
|
|
1253
|
+
},
|
|
1254
|
+
adUnitCode: 'div-1',
|
|
1255
|
+
transactionId: '0869f34e-090b-4b20-84ee-46ff41405a39',
|
|
1256
|
+
sizes: [[300, 250]],
|
|
1257
|
+
bidId: '22b3a2268d9f0e',
|
|
1258
|
+
bidderRequestId: '1d195910597e13',
|
|
1259
|
+
auctionId: '3375d336-2aea-4ee7-804c-6d26b621ad20',
|
|
1260
|
+
src: 'client',
|
|
1261
|
+
bidRequestsCount: 1,
|
|
1262
|
+
bidderRequestsCount: 1,
|
|
1263
|
+
bidderWinsCount: 0
|
|
1264
|
+
};
|
|
1265
|
+
|
|
1266
|
+
let validBannerBidRequest = {
|
|
1267
|
+
bidId: '9876abcd',
|
|
1268
|
+
sizes: [[300, 250]],
|
|
1269
|
+
params: {
|
|
1270
|
+
bidfloor: '0.50',
|
|
1271
|
+
seatId: 'prebid',
|
|
1272
|
+
placementId: '1234',
|
|
1273
|
+
}
|
|
1274
|
+
};
|
|
1275
|
+
|
|
1276
|
+
let bidderRequest = {
|
|
1277
|
+
refererInfo: {
|
|
1278
|
+
referer: 'http://localhost:9999/'
|
|
1279
|
+
},
|
|
1280
|
+
bidderCode: 'synacormedia',
|
|
1281
|
+
auctionId: 'f8a75621-d672-4cbb-9275-3db7d74fb110'
|
|
1282
|
+
};
|
|
1283
|
+
|
|
1284
|
+
it('should return valid bidfloor using price module for banner/video impression', function () {
|
|
1285
|
+
let bannerRequest = spec.buildRequests([validBannerBidRequest], bidderRequest);
|
|
1286
|
+
let videoRequest = spec.buildRequests([validVideoBidRequest], bidderRequest);
|
|
1287
|
+
|
|
1288
|
+
expect(bannerRequest.data.imp[0].bidfloor).to.equal(0.5);
|
|
1289
|
+
expect(videoRequest.data.imp[0].bidfloor).to.equal(0.5);
|
|
1290
|
+
|
|
1291
|
+
let priceModuleFloor = 3;
|
|
1292
|
+
let floorResponse = { currency: 'USD', floor: priceModuleFloor };
|
|
1293
|
+
|
|
1294
|
+
validBannerBidRequest.getFloor = () => { return floorResponse; };
|
|
1295
|
+
validVideoBidRequest.getFloor = () => { return floorResponse; };
|
|
1296
|
+
|
|
1297
|
+
bannerRequest = spec.buildRequests([validBannerBidRequest], bidderRequest);
|
|
1298
|
+
videoRequest = spec.buildRequests([validVideoBidRequest], bidderRequest);
|
|
1299
|
+
|
|
1300
|
+
expect(bannerRequest.data.imp[0].bidfloor).to.equal(priceModuleFloor);
|
|
1301
|
+
expect(videoRequest.data.imp[0].bidfloor).to.equal(priceModuleFloor);
|
|
1302
|
+
});
|
|
1303
|
+
});
|
|
1234
1304
|
});
|
|
@@ -134,12 +134,6 @@ describe('Tappx bid adapter', function () {
|
|
|
134
134
|
assert.isTrue(spec.isBidRequestValid(c_BIDREQUEST.bids[0]), JSON.stringify(c_BIDREQUEST));
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
-
it('should return false when params are missing', function () {
|
|
138
|
-
let badBidRequestParam = JSON.parse(JSON.stringify(c_BIDREQUEST));
|
|
139
|
-
delete badBidRequestParam.bids[0].params;
|
|
140
|
-
assert.isFalse(spec.isBidRequestValid(badBidRequestParam.bids[0]));
|
|
141
|
-
});
|
|
142
|
-
|
|
143
137
|
it('should return false when tappxkey is missing', function () {
|
|
144
138
|
let badBidRequestTpxkey = JSON.parse(JSON.stringify(c_BIDREQUEST)); ;
|
|
145
139
|
delete badBidRequestTpxkey.bids[0].params.tappxkey;
|
|
@@ -165,21 +159,11 @@ describe('Tappx bid adapter', function () {
|
|
|
165
159
|
assert.isTrue(spec.isBidRequestValid(badBidRequestNwEp.bids[0]));
|
|
166
160
|
});
|
|
167
161
|
|
|
168
|
-
it('should return false mimes param is missing', function () {
|
|
169
|
-
let badBidRequest_mimes = c_BIDDERREQUEST_V;
|
|
170
|
-
delete badBidRequest_mimes.bids.mediaTypes.video;
|
|
171
|
-
badBidRequest_mimes.bids.mediaTypes.video = {};
|
|
172
|
-
badBidRequest_mimes.bids.mediaTypes.video.context = 'instream';
|
|
173
|
-
badBidRequest_mimes.bids.mediaTypes.video.playerSize = [320, 250];
|
|
174
|
-
assert.isFalse(spec.isBidRequestValid(badBidRequest_mimes.bids), badBidRequest_mimes);
|
|
175
|
-
});
|
|
176
|
-
|
|
177
162
|
it('should return false for not instream/outstream requests', function () {
|
|
178
163
|
let badBidRequest_v = c_BIDDERREQUEST_V;
|
|
179
164
|
delete badBidRequest_v.bids.mediaTypes.banner;
|
|
180
165
|
badBidRequest_v.bids.mediaTypes.video = {};
|
|
181
166
|
badBidRequest_v.bids.mediaTypes.video.context = '';
|
|
182
|
-
badBidRequest_v.bids.mediaTypes.video.mimes = [ 'video/mp4', 'application/javascript' ];
|
|
183
167
|
badBidRequest_v.bids.mediaTypes.video.playerSize = [320, 250];
|
|
184
168
|
assert.isFalse(spec.isBidRequestValid(badBidRequest_v.bids));
|
|
185
169
|
});
|
|
@@ -232,7 +216,6 @@ describe('Tappx bid adapter', function () {
|
|
|
232
216
|
validBidRequests_V[0].mediaTypes.video = {};
|
|
233
217
|
validBidRequests_V[0].mediaTypes.video.playerSize = [640, 480];
|
|
234
218
|
validBidRequests_V[0].mediaTypes.video.context = 'instream';
|
|
235
|
-
validBidRequests_V[0].mediaTypes.video.mimes = [ 'video/mp4', 'application/javascript' ];
|
|
236
219
|
|
|
237
220
|
bidderRequest_V.bids.mediaTypes.context = 'instream';
|
|
238
221
|
|
|
@@ -252,7 +235,6 @@ describe('Tappx bid adapter', function () {
|
|
|
252
235
|
validBidRequests_Voutstream[0].mediaTypes.video = {};
|
|
253
236
|
validBidRequests_Voutstream[0].mediaTypes.video.playerSize = [640, 480];
|
|
254
237
|
validBidRequests_Voutstream[0].mediaTypes.video.context = 'outstream';
|
|
255
|
-
validBidRequests_Voutstream[0].mediaTypes.video.mimes = [ 'video/mp4', 'application/javascript' ];
|
|
256
238
|
|
|
257
239
|
bidderRequest_VOutstream.bids.mediaTypes.context = 'outstream';
|
|
258
240
|
|
|
@@ -273,7 +255,6 @@ describe('Tappx bid adapter', function () {
|
|
|
273
255
|
validBidRequests_Voutstream[0].mediaTypes.video.rewarded = 1;
|
|
274
256
|
validBidRequests_Voutstream[0].mediaTypes.video.playerSize = [640, 480];
|
|
275
257
|
validBidRequests_Voutstream[0].mediaTypes.video.context = 'outstream';
|
|
276
|
-
validBidRequests_Voutstream[0].mediaTypes.video.mimes = [ 'video/mp4', 'application/javascript' ];
|
|
277
258
|
|
|
278
259
|
bidderRequest_VOutstream.bids.mediaTypes.context = 'outstream';
|
|
279
260
|
|
|
@@ -614,15 +614,13 @@ describe('teadsBidAdapter', () => {
|
|
|
614
614
|
}
|
|
615
615
|
];
|
|
616
616
|
|
|
617
|
-
it('should add gpid if ortb2Imp.ext.
|
|
617
|
+
it('should add gpid if ortb2Imp.ext.gpid is present and is non empty', function () {
|
|
618
618
|
const updatedBidRequests = bidRequests.map(function(bidRequest, index) {
|
|
619
619
|
return {
|
|
620
620
|
...bidRequest,
|
|
621
621
|
ortb2Imp: {
|
|
622
622
|
ext: {
|
|
623
|
-
|
|
624
|
-
pbadslot: '1111/home-left-' + index
|
|
625
|
-
}
|
|
623
|
+
gpid: '1111/home-left-' + index
|
|
626
624
|
}
|
|
627
625
|
}
|
|
628
626
|
};
|
|
@@ -635,41 +633,12 @@ describe('teadsBidAdapter', () => {
|
|
|
635
633
|
expect(payload.data[1].gpid).to.equal('1111/home-left-1');
|
|
636
634
|
});
|
|
637
635
|
|
|
638
|
-
it('should add gpid if ortb2Imp.ext.
|
|
639
|
-
const updatedBidRequests = bidRequests.map(function(bidRequest, index) {
|
|
640
|
-
return {
|
|
641
|
-
...bidRequest,
|
|
642
|
-
ortb2Imp: {
|
|
643
|
-
ext: {
|
|
644
|
-
data: {
|
|
645
|
-
pbadslot: '1111/home-left-' + index,
|
|
646
|
-
adserver: {
|
|
647
|
-
adslot: '1111/home-left/div-' + index
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
};
|
|
653
|
-
}
|
|
654
|
-
);
|
|
655
|
-
const request = spec.buildRequests(updatedBidRequests, bidderResquestDefault);
|
|
656
|
-
const payload = JSON.parse(request.data);
|
|
657
|
-
|
|
658
|
-
expect(payload.data[0].gpid).to.equal('1111/home-left-0');
|
|
659
|
-
expect(payload.data[1].gpid).to.equal('1111/home-left-1');
|
|
660
|
-
});
|
|
661
|
-
|
|
662
|
-
it('should not add gpid if both ortb2Imp.ext.data.pbadslot and ortb2Imp.ext.data.adserver.adslot are present but empty', function () {
|
|
636
|
+
it('should not add gpid if ortb2Imp.ext.gpid is present but empty', function () {
|
|
663
637
|
const updatedBidRequests = bidRequests.map(bidRequest => ({
|
|
664
638
|
...bidRequest,
|
|
665
639
|
ortb2Imp: {
|
|
666
640
|
ext: {
|
|
667
|
-
|
|
668
|
-
pbadslot: '',
|
|
669
|
-
adserver: {
|
|
670
|
-
adslot: ''
|
|
671
|
-
}
|
|
672
|
-
}
|
|
641
|
+
gpid: ''
|
|
673
642
|
}
|
|
674
643
|
}
|
|
675
644
|
}));
|
|
@@ -682,36 +651,22 @@ describe('teadsBidAdapter', () => {
|
|
|
682
651
|
});
|
|
683
652
|
});
|
|
684
653
|
|
|
685
|
-
it('should not add gpid if
|
|
686
|
-
const
|
|
654
|
+
it('should not add gpid if ortb2Imp.ext.gpid is not present', function () {
|
|
655
|
+
const updatedBidRequests = bidRequests.map(bidRequest => ({
|
|
656
|
+
...bidRequest,
|
|
657
|
+
ortb2Imp: {
|
|
658
|
+
ext: {
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}));
|
|
662
|
+
|
|
663
|
+
const request = spec.buildRequests(updatedBidRequests, bidderResquestDefault);
|
|
687
664
|
const payload = JSON.parse(request.data);
|
|
688
665
|
|
|
689
666
|
return payload.data.forEach(bid => {
|
|
690
667
|
expect(bid).not.to.have.property('gpid');
|
|
691
668
|
});
|
|
692
669
|
});
|
|
693
|
-
|
|
694
|
-
it('should add gpid if ortb2Imp.ext.data.pbadslot is not present but ortb2Imp.ext.data.adserver.adslot is present and is non empty', function () {
|
|
695
|
-
const updatedBidRequests = bidRequests.map(function(bidRequest, index) {
|
|
696
|
-
return {
|
|
697
|
-
...bidRequest,
|
|
698
|
-
ortb2Imp: {
|
|
699
|
-
ext: {
|
|
700
|
-
data: {
|
|
701
|
-
adserver: {
|
|
702
|
-
adslot: '1111/home-left-' + index
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
};
|
|
708
|
-
});
|
|
709
|
-
const request = spec.buildRequests(updatedBidRequests, bidderResquestDefault);
|
|
710
|
-
const payload = JSON.parse(request.data);
|
|
711
|
-
|
|
712
|
-
expect(payload.data[0].gpid).to.equal('1111/home-left-0');
|
|
713
|
-
expect(payload.data[1].gpid).to.equal('1111/home-left-1');
|
|
714
|
-
});
|
|
715
670
|
});
|
|
716
671
|
|
|
717
672
|
function checkMediaTypesSizes(mediaTypes, expectedSizes) {
|