prebid.js 6.4.0 → 6.8.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/integrationExamples/gpt/amp/creative.html +11 -33
- package/integrationExamples/gpt/x-domain/creative.html +53 -26
- package/modules/.submodules.json +2 -1
- package/modules/adagioBidAdapter.js +0 -8
- package/modules/adagioBidAdapter.md +1 -1
- package/modules/adbookpspBidAdapter.js +27 -10
- package/modules/adhashBidAdapter.js +3 -3
- package/modules/adkernelBidAdapter.js +2 -1
- package/modules/admanBidAdapter.js +10 -4
- package/modules/adomikAnalyticsAdapter.js +23 -11
- package/modules/adqueryIdSystem.js +103 -0
- package/modules/adqueryIdSystem.md +35 -0
- package/modules/adyoulikeBidAdapter.js +13 -9
- package/modules/appnexusBidAdapter.js +11 -0
- package/modules/bliinkBidAdapter.js +3 -2
- package/modules/brandmetricsRtdProvider.js +168 -0
- package/modules/brandmetricsRtdProvider.md +40 -0
- package/modules/colossussspBidAdapter.js +12 -8
- package/modules/colossussspBidAdapter.md +15 -1
- package/modules/compassBidAdapter.js +10 -3
- package/modules/consentManagement.js +7 -1
- package/modules/consumableBidAdapter.md +1 -1
- package/modules/criteoBidAdapter.js +10 -1
- package/modules/criteoIdSystem.js +29 -7
- package/modules/currency.js +26 -1
- package/modules/displayioBidAdapter.js +157 -0
- package/modules/displayioBidAdapter.md +148 -0
- package/modules/docereeBidAdapter.js +10 -1
- package/modules/docereeBidAdapter.md +2 -0
- package/modules/e_volutionBidAdapter.js +158 -0
- 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/gumgumBidAdapter.js +56 -42
- package/modules/idImportLibrary.js +45 -8
- package/modules/idImportLibrary.md +4 -0
- package/modules/improvedigitalBidAdapter.js +24 -2
- package/modules/interactiveOffersBidAdapter.js +9 -6
- package/modules/ixBidAdapter.js +29 -12
- 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/loglyliftBidAdapter.js +79 -0
- package/modules/loglyliftBidAdapter.md +55 -0
- package/modules/nextMillenniumBidAdapter.js +3 -1
- 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/pubmaticAnalyticsAdapter.js +16 -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/seedingAllianceBidAdapter.js +3 -3
- package/modules/sharethroughBidAdapter.js +12 -17
- package/modules/showheroes-bsBidAdapter.js +13 -2
- package/modules/sovrnBidAdapter.js +93 -18
- package/modules/sovrnBidAdapter.md +80 -2
- package/modules/synacormediaBidAdapter.js +31 -10
- package/modules/tappxBidAdapter.js +8 -5
- package/modules/teadsBidAdapter.js +1 -2
- package/modules/undertoneBidAdapter.js +17 -1
- 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/yahoosspBidAdapter.js +2 -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/adRendering.js +38 -0
- package/src/auction.js +44 -9
- package/src/config.js +27 -3
- package/src/hook.js +5 -1
- package/src/prebid.js +21 -21
- package/src/secureCreatives.js +114 -44
- package/src/utils.js +25 -4
- package/test/helpers/syncPromise.js +71 -0
- package/test/spec/auctionmanager_spec.js +148 -16
- package/test/spec/config_spec.js +279 -0
- package/test/spec/modules/adagioBidAdapter_spec.js +0 -10
- package/test/spec/modules/adbookpspBidAdapter_spec.js +17 -3
- package/test/spec/modules/adhashBidAdapter_spec.js +2 -2
- package/test/spec/modules/admanBidAdapter_spec.js +2 -2
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +3 -1
- package/test/spec/modules/adqueryIdSystem_spec.js +74 -0
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +49 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +27 -0
- package/test/spec/modules/bliinkBidAdapter_spec.js +2 -0
- package/test/spec/modules/brandmetricsRtdProvider_spec.js +191 -0
- package/test/spec/modules/colossussspBidAdapter_spec.js +5 -2
- package/test/spec/modules/compassBidAdapter_spec.js +1 -0
- package/test/spec/modules/consentManagement_spec.js +20 -0
- package/test/spec/modules/criteoBidAdapter_spec.js +21 -0
- package/test/spec/modules/criteoIdSystem_spec.js +6 -3
- package/test/spec/modules/currency_spec.js +21 -6
- package/test/spec/modules/displayioBidAdapter_spec.js +239 -0
- package/test/spec/modules/docereeBidAdapter_spec.js +9 -1
- package/test/spec/modules/e_volutionBidAdapter_spec.js +242 -0
- package/test/spec/modules/eids_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/gumgumBidAdapter_spec.js +46 -0
- package/test/spec/modules/idImportLibrary_spec.js +197 -10
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +42 -0
- package/test/spec/modules/ixBidAdapter_spec.js +104 -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/loglyliftBidAdapter_spec.js +172 -0
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +1 -1
- 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/pubmaticAnalyticsAdapter_spec.js +13 -1
- 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/sharethroughBidAdapter_spec.js +91 -6
- package/test/spec/modules/showheroes-bsBidAdapter_spec.js +2 -0
- package/test/spec/modules/sovrnBidAdapter_spec.js +413 -333
- 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/undertoneBidAdapter_spec.js +55 -2
- 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/yahoosspBidAdapter_spec.js +10 -0
- package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +427 -0
- package/test/spec/unit/pbjs_api_spec.js +20 -2
- package/test/spec/unit/secureCreatives_spec.js +85 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { fetchTargetingForMediaId, getVatFromCache, extractPublisherParams,
|
|
2
2
|
formatTargetingResponse, getVatFromPlayer, enrichAdUnits, addTargetingToBid,
|
|
3
|
-
fetchTargetingInformation, jwplayerSubmodule } from 'modules/jwplayerRtdProvider.js';
|
|
3
|
+
fetchTargetingInformation, jwplayerSubmodule, getContentId, getContentData } from 'modules/jwplayerRtdProvider.js';
|
|
4
4
|
import { server } from 'test/mocks/xhr.js';
|
|
5
|
+
import {addOrtbSiteContent} from '../../../modules/jwplayerRtdProvider';
|
|
5
6
|
|
|
6
7
|
describe('jwplayerRtdProvider', function() {
|
|
7
8
|
const testIdForSuccess = 'test_id_for_success';
|
|
@@ -412,7 +413,7 @@ describe('jwplayerRtdProvider', function() {
|
|
|
412
413
|
});
|
|
413
414
|
});
|
|
414
415
|
|
|
415
|
-
describe('
|
|
416
|
+
describe('Extract Publisher Params', function () {
|
|
416
417
|
const config = { mediaID: 'test' };
|
|
417
418
|
|
|
418
419
|
it('should exclude adUnits that do not support instream video and do not specify jwTargeting', function () {
|
|
@@ -480,6 +481,198 @@ describe('jwplayerRtdProvider', function() {
|
|
|
480
481
|
})
|
|
481
482
|
});
|
|
482
483
|
|
|
484
|
+
describe('Get content id', function() {
|
|
485
|
+
it('prefixes jw_ to the media id', function () {
|
|
486
|
+
const mediaId = 'mediaId';
|
|
487
|
+
const contentId = getContentId(mediaId);
|
|
488
|
+
expect(contentId).to.equal('jw_mediaId');
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
it('returns undefined when media id is empty', function () {
|
|
492
|
+
let contentId = getContentId();
|
|
493
|
+
expect(contentId).to.be.undefined;
|
|
494
|
+
contentId = getContentId('');
|
|
495
|
+
expect(contentId).to.be.undefined;
|
|
496
|
+
contentId = getContentId(null);
|
|
497
|
+
expect(contentId).to.be.undefined;
|
|
498
|
+
});
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
describe('Get Content Data', function () {
|
|
502
|
+
it('returns undefined when segments are empty', function () {
|
|
503
|
+
let data = getContentData(null);
|
|
504
|
+
expect(data).to.be.undefined;
|
|
505
|
+
data = getContentData(undefined);
|
|
506
|
+
expect(data).to.be.undefined;
|
|
507
|
+
data = getContentData([]);
|
|
508
|
+
expect(data).to.be.undefined;
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
it('returns proper format', function () {
|
|
512
|
+
const segment1 = 'segment1';
|
|
513
|
+
const segment2 = 'segment2';
|
|
514
|
+
const segment3 = 'segment3';
|
|
515
|
+
const data = getContentData([segment1, segment2, segment3]);
|
|
516
|
+
expect(data).to.have.property('name', 'jwplayer');
|
|
517
|
+
expect(data.ext).to.have.property('segtax', 502);
|
|
518
|
+
expect(data.segment[0]).to.deep.equal({ id: segment1, value: segment1 });
|
|
519
|
+
expect(data.segment[1]).to.deep.equal({ id: segment2, value: segment2 });
|
|
520
|
+
expect(data.segment[2]).to.deep.equal({ id: segment3, value: segment3 });
|
|
521
|
+
});
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
describe(' Add Ortb Site Content', function () {
|
|
525
|
+
it('should maintain object structure when id and data params are empty', function () {
|
|
526
|
+
const bid = {
|
|
527
|
+
ortb2: {
|
|
528
|
+
site: {
|
|
529
|
+
content: {
|
|
530
|
+
id: 'randomId'
|
|
531
|
+
},
|
|
532
|
+
random: {
|
|
533
|
+
random_sub: 'randomSub'
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
app: {
|
|
537
|
+
content: {
|
|
538
|
+
id: 'appId'
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
};
|
|
543
|
+
addOrtbSiteContent(bid);
|
|
544
|
+
expect(bid).to.have.nested.property('ortb2.site.content.id', 'randomId');
|
|
545
|
+
expect(bid).to.have.nested.property('ortb2.site.random.random_sub', 'randomSub');
|
|
546
|
+
expect(bid).to.have.nested.property('ortb2.app.content.id', 'appId');
|
|
547
|
+
});
|
|
548
|
+
|
|
549
|
+
it('should create a structure compliant with the oRTB 2 spec', function() {
|
|
550
|
+
const bid = {};
|
|
551
|
+
const expectedId = 'expectedId';
|
|
552
|
+
const expectedData = { datum: 'datum' };
|
|
553
|
+
addOrtbSiteContent(bid, expectedId, expectedData);
|
|
554
|
+
expect(bid).to.have.nested.property('ortb2.site.content.id', expectedId);
|
|
555
|
+
expect(bid).to.have.nested.property('ortb2.site.content.data');
|
|
556
|
+
expect(bid.ortb2.site.content.data[0]).to.be.deep.equal(expectedData);
|
|
557
|
+
});
|
|
558
|
+
|
|
559
|
+
it('should respect existing structure when adding adding fields', function () {
|
|
560
|
+
const bid = {
|
|
561
|
+
ortb2: {
|
|
562
|
+
site: {
|
|
563
|
+
content: {
|
|
564
|
+
id: 'oldId'
|
|
565
|
+
},
|
|
566
|
+
random: {
|
|
567
|
+
random_sub: 'randomSub'
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
app: {
|
|
571
|
+
content: {
|
|
572
|
+
id: 'appId'
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
const expectedId = 'expectedId';
|
|
579
|
+
const expectedData = { datum: 'datum' };
|
|
580
|
+
addOrtbSiteContent(bid, expectedId, expectedData);
|
|
581
|
+
expect(bid).to.have.nested.property('ortb2.site.random.random_sub', 'randomSub');
|
|
582
|
+
expect(bid).to.have.nested.property('ortb2.app.content.id', 'appId');
|
|
583
|
+
expect(bid).to.have.nested.property('ortb2.site.content.id', expectedId);
|
|
584
|
+
expect(bid).to.have.nested.property('ortb2.site.content.data');
|
|
585
|
+
expect(bid.ortb2.site.content.data[0]).to.be.deep.equal(expectedData);
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
it('should set content id', function () {
|
|
589
|
+
const bid = {};
|
|
590
|
+
const expectedId = 'expectedId';
|
|
591
|
+
addOrtbSiteContent(bid, expectedId);
|
|
592
|
+
expect(bid).to.have.nested.property('ortb2.site.content.id', expectedId);
|
|
593
|
+
});
|
|
594
|
+
|
|
595
|
+
it('should override content id', function () {
|
|
596
|
+
const bid = {
|
|
597
|
+
ortb2: {
|
|
598
|
+
site: {
|
|
599
|
+
content: {
|
|
600
|
+
id: 'oldId'
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
const expectedId = 'expectedId';
|
|
607
|
+
addOrtbSiteContent(bid, expectedId);
|
|
608
|
+
expect(bid).to.have.nested.property('ortb2.site.content.id', expectedId);
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
it('should keep previous content id when not set', function () {
|
|
612
|
+
const previousId = 'oldId';
|
|
613
|
+
const bid = {
|
|
614
|
+
ortb2: {
|
|
615
|
+
site: {
|
|
616
|
+
content: {
|
|
617
|
+
id: previousId,
|
|
618
|
+
data: [{ datum: 'first_datum' }]
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
addOrtbSiteContent(bid, null, { datum: 'new_datum' });
|
|
625
|
+
expect(bid).to.have.nested.property('ortb2.site.content.id', previousId);
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
it('should set content data', function () {
|
|
629
|
+
const bid = {};
|
|
630
|
+
const expectedData = { datum: 'datum' };
|
|
631
|
+
addOrtbSiteContent(bid, null, expectedData);
|
|
632
|
+
expect(bid).to.have.nested.property('ortb2.site.content.data');
|
|
633
|
+
expect(bid.ortb2.site.content.data).to.have.length(1);
|
|
634
|
+
expect(bid.ortb2.site.content.data[0]).to.be.deep.equal(expectedData);
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
it('should append content data', function () {
|
|
638
|
+
const bid = {
|
|
639
|
+
ortb2: {
|
|
640
|
+
site: {
|
|
641
|
+
content: {
|
|
642
|
+
data: [{ datum: 'first_datum' }]
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
const expectedData = { datum: 'datum' };
|
|
649
|
+
addOrtbSiteContent(bid, null, expectedData);
|
|
650
|
+
expect(bid).to.have.nested.property('ortb2.site.content.data');
|
|
651
|
+
expect(bid.ortb2.site.content.data).to.have.length(2);
|
|
652
|
+
expect(bid.ortb2.site.content.data.pop()).to.be.deep.equal(expectedData);
|
|
653
|
+
});
|
|
654
|
+
|
|
655
|
+
it('should keep previous data when not set', function () {
|
|
656
|
+
const expectedId = 'expectedId';
|
|
657
|
+
const expectedData = { datum: 'first_datum' };
|
|
658
|
+
const bid = {
|
|
659
|
+
ortb2: {
|
|
660
|
+
site: {
|
|
661
|
+
content: {
|
|
662
|
+
data: [expectedData]
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
addOrtbSiteContent(bid, expectedId);
|
|
669
|
+
expect(bid).to.have.nested.property('ortb2.site.content.data');
|
|
670
|
+
expect(bid.ortb2.site.content.data).to.have.length(1);
|
|
671
|
+
expect(bid.ortb2.site.content.data[0]).to.be.deep.equal(expectedData);
|
|
672
|
+
expect(bid).to.have.nested.property('ortb2.site.content.id', expectedId);
|
|
673
|
+
});
|
|
674
|
+
});
|
|
675
|
+
|
|
483
676
|
describe('Add Targeting to Bid', function () {
|
|
484
677
|
const targeting = {foo: 'bar'};
|
|
485
678
|
|
|
@@ -19,7 +19,17 @@ describe('limelightDigitalAdapter', function () {
|
|
|
19
19
|
sizes: [[300, 250]]
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
transactionId: '3bb2f6da-87a6-4029-aeb0-bfe951372e62'
|
|
22
|
+
transactionId: '3bb2f6da-87a6-4029-aeb0-bfe951372e62',
|
|
23
|
+
userIdAsEids: [
|
|
24
|
+
{
|
|
25
|
+
source: 'test1.org',
|
|
26
|
+
uids: [
|
|
27
|
+
{
|
|
28
|
+
id: '123',
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
23
33
|
}
|
|
24
34
|
const bid2 = {
|
|
25
35
|
bidId: '58ee9870c3164a',
|
|
@@ -33,7 +43,17 @@ describe('limelightDigitalAdapter', function () {
|
|
|
33
43
|
placementCode: 'placement_1',
|
|
34
44
|
auctionId: '482f88de-29ab-45c8-981a-d25e39454a34',
|
|
35
45
|
sizes: [[350, 200]],
|
|
36
|
-
transactionId: '068867d1-46ec-40bb-9fa0-e24611786fb4'
|
|
46
|
+
transactionId: '068867d1-46ec-40bb-9fa0-e24611786fb4',
|
|
47
|
+
userIdAsEids: [
|
|
48
|
+
{
|
|
49
|
+
source: 'test2.org',
|
|
50
|
+
uids: [
|
|
51
|
+
{
|
|
52
|
+
id: '234',
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
]
|
|
37
57
|
}
|
|
38
58
|
const bid3 = {
|
|
39
59
|
bidId: '019645c7d69460',
|
|
@@ -48,7 +68,20 @@ describe('limelightDigitalAdapter', function () {
|
|
|
48
68
|
placementCode: 'placement_2',
|
|
49
69
|
auctionId: 'e4771143-6aa7-41ec-8824-ced4342c96c8',
|
|
50
70
|
sizes: [[800, 600]],
|
|
51
|
-
transactionId: '738d5915-6651-43b9-9b6b-d50517350917'
|
|
71
|
+
transactionId: '738d5915-6651-43b9-9b6b-d50517350917',
|
|
72
|
+
userIdAsEids: [
|
|
73
|
+
{
|
|
74
|
+
source: 'test3.org',
|
|
75
|
+
uids: [
|
|
76
|
+
{
|
|
77
|
+
id: '345',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: '456',
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
]
|
|
52
85
|
}
|
|
53
86
|
const bid4 = {
|
|
54
87
|
bidId: '019645c7d69460',
|
|
@@ -64,7 +97,17 @@ describe('limelightDigitalAdapter', function () {
|
|
|
64
97
|
video: {
|
|
65
98
|
playerSize: [800, 600]
|
|
66
99
|
},
|
|
67
|
-
transactionId: '738d5915-6651-43b9-9b6b-d50517350917'
|
|
100
|
+
transactionId: '738d5915-6651-43b9-9b6b-d50517350917',
|
|
101
|
+
userIdAsEids: [
|
|
102
|
+
{
|
|
103
|
+
source: 'test.org',
|
|
104
|
+
uids: [
|
|
105
|
+
{
|
|
106
|
+
id: '111',
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
]
|
|
68
111
|
}
|
|
69
112
|
|
|
70
113
|
describe('buildRequests', function () {
|
|
@@ -84,19 +127,33 @@ describe('limelightDigitalAdapter', function () {
|
|
|
84
127
|
expect(serverRequest.method).to.equal('POST')
|
|
85
128
|
})
|
|
86
129
|
it('Returns valid data if array of bids is valid', function () {
|
|
87
|
-
let data = serverRequest.data
|
|
88
|
-
expect(data).to.be.an('object')
|
|
89
|
-
expect(data).to.have.all.keys(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
130
|
+
let data = serverRequest.data;
|
|
131
|
+
expect(data).to.be.an('object');
|
|
132
|
+
expect(data).to.have.all.keys(
|
|
133
|
+
'deviceWidth',
|
|
134
|
+
'deviceHeight',
|
|
135
|
+
'secure',
|
|
136
|
+
'adUnits'
|
|
137
|
+
);
|
|
138
|
+
expect(data.deviceWidth).to.be.a('number');
|
|
139
|
+
expect(data.deviceHeight).to.be.a('number');
|
|
140
|
+
expect(data.secure).to.be.a('boolean');
|
|
93
141
|
data.adUnits.forEach(adUnit => {
|
|
94
|
-
expect(adUnit).to.have.all.keys(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
142
|
+
expect(adUnit).to.have.all.keys(
|
|
143
|
+
'id',
|
|
144
|
+
'bidId',
|
|
145
|
+
'type',
|
|
146
|
+
'sizes',
|
|
147
|
+
'transactionId',
|
|
148
|
+
'publisherId',
|
|
149
|
+
'userIdAsEids'
|
|
150
|
+
);
|
|
151
|
+
expect(adUnit.id).to.be.a('number');
|
|
152
|
+
expect(adUnit.bidId).to.be.a('string');
|
|
153
|
+
expect(adUnit.type).to.be.a('string');
|
|
154
|
+
expect(adUnit.transactionId).to.be.a('string');
|
|
155
|
+
expect(adUnit.sizes).to.be.an('array');
|
|
156
|
+
expect(adUnit.userIdAsEids).to.be.an('array');
|
|
100
157
|
})
|
|
101
158
|
})
|
|
102
159
|
})
|
|
@@ -194,7 +251,7 @@ describe('limelightDigitalAdapter', function () {
|
|
|
194
251
|
expect(dataItem.meta.advertiserDomains).to.be.an('array');
|
|
195
252
|
expect(dataItem.meta.mediaType).to.be.a('string');
|
|
196
253
|
}
|
|
197
|
-
it('
|
|
254
|
+
it('should return an empty array if invalid response is passed', function () {
|
|
198
255
|
serverResponses = spec.interpretResponse('invalid_response');
|
|
199
256
|
expect(serverResponses).to.be.an('array').that.is.empty;
|
|
200
257
|
});
|
|
@@ -481,4 +538,5 @@ function validateAdUnit(adUnit, bid) {
|
|
|
481
538
|
}
|
|
482
539
|
}));
|
|
483
540
|
expect(adUnit.publisherId).to.equal(bid.params.publisherId);
|
|
541
|
+
expect(adUnit.userIdAsEids).to.deep.equal(bid.userIdAsEids);
|
|
484
542
|
}
|
|
@@ -552,6 +552,28 @@ describe('Livewrapped analytics adapter', function () {
|
|
|
552
552
|
expect(message.wins[0].floor).to.equal(1.1);
|
|
553
553
|
expect(message.wins[1].floor).to.equal(2.2);
|
|
554
554
|
});
|
|
555
|
+
|
|
556
|
+
it('should forward runner-up data as given by Livewrapped wrapper', function () {
|
|
557
|
+
events.emit(AUCTION_INIT, MOCK.AUCTION_INIT);
|
|
558
|
+
events.emit(BID_REQUESTED, MOCK.BID_REQUESTED);
|
|
559
|
+
|
|
560
|
+
events.emit(BID_RESPONSE, MOCK.BID_RESPONSE[0]);
|
|
561
|
+
events.emit(BID_WON, Object.assign({},
|
|
562
|
+
MOCK.BID_WON[0],
|
|
563
|
+
{
|
|
564
|
+
'rUp': 'rUpObject'
|
|
565
|
+
}));
|
|
566
|
+
events.emit(AUCTION_END, MOCK.AUCTION_END);
|
|
567
|
+
|
|
568
|
+
clock.tick(BID_WON_TIMEOUT + 1000);
|
|
569
|
+
|
|
570
|
+
expect(server.requests.length).to.equal(1);
|
|
571
|
+
let request = server.requests[0];
|
|
572
|
+
let message = JSON.parse(request.requestBody);
|
|
573
|
+
|
|
574
|
+
expect(message.wins.length).to.equal(1);
|
|
575
|
+
expect(message.wins[0].rUp).to.equal('rUpObject');
|
|
576
|
+
});
|
|
555
577
|
});
|
|
556
578
|
|
|
557
579
|
describe('when given other endpoint', function () {
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { spec } from '../../../modules/loglyliftBidAdapter';
|
|
3
|
+
import * as utils from 'src/utils.js';
|
|
4
|
+
|
|
5
|
+
describe('loglyliftBidAdapter', function () {
|
|
6
|
+
const nativeBidRequests = [{
|
|
7
|
+
bidder: 'loglylift',
|
|
8
|
+
bidId: '254304ac29e265',
|
|
9
|
+
params: {
|
|
10
|
+
adspotId: 16
|
|
11
|
+
},
|
|
12
|
+
adUnitCode: '/19968336/prebid_native_example_1',
|
|
13
|
+
transactionId: '10aee457-617c-4572-ab5b-99df1d73ccb4',
|
|
14
|
+
sizes: [
|
|
15
|
+
[]
|
|
16
|
+
],
|
|
17
|
+
bidderRequestId: '15da3afd9632d7',
|
|
18
|
+
auctionId: 'f890b7d9-e787-4237-ac21-6d8554abac9f',
|
|
19
|
+
mediaTypes: {
|
|
20
|
+
native: {
|
|
21
|
+
body: {
|
|
22
|
+
required: true
|
|
23
|
+
},
|
|
24
|
+
icon: {
|
|
25
|
+
required: false
|
|
26
|
+
},
|
|
27
|
+
title: {
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
image: {
|
|
31
|
+
required: true
|
|
32
|
+
},
|
|
33
|
+
sponsoredBy: {
|
|
34
|
+
required: true
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}];
|
|
39
|
+
|
|
40
|
+
const bidderRequest = {
|
|
41
|
+
refererInfo: {
|
|
42
|
+
referer: 'fakeReferer',
|
|
43
|
+
reachedTop: true,
|
|
44
|
+
numIframes: 1,
|
|
45
|
+
stack: []
|
|
46
|
+
},
|
|
47
|
+
auctionStart: 1632194172781,
|
|
48
|
+
bidderCode: 'loglylift',
|
|
49
|
+
bidderRequestId: '15da3afd9632d7',
|
|
50
|
+
auctionId: 'f890b7d9-e787-4237-ac21-6d8554abac9f',
|
|
51
|
+
timeout: 3000
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const nativeServerResponse = {
|
|
55
|
+
body: {
|
|
56
|
+
bids: [{
|
|
57
|
+
requestId: '254304ac29e265',
|
|
58
|
+
cpm: 10.123,
|
|
59
|
+
width: 360,
|
|
60
|
+
height: 360,
|
|
61
|
+
creativeId: '123456789',
|
|
62
|
+
currency: 'JPY',
|
|
63
|
+
netRevenue: true,
|
|
64
|
+
ttl: 30,
|
|
65
|
+
meta: {
|
|
66
|
+
advertiserDomains: ['advertiserexample.com']
|
|
67
|
+
},
|
|
68
|
+
native: {
|
|
69
|
+
clickUrl: 'https://dsp.logly.co.jp/click?ad=EXAMPECLICKURL',
|
|
70
|
+
image: {
|
|
71
|
+
url: 'https://cdn.logly.co.jp/images/000/194/300/normal.jpg',
|
|
72
|
+
width: '360',
|
|
73
|
+
height: '360'
|
|
74
|
+
},
|
|
75
|
+
impressionTrackers: [
|
|
76
|
+
'https://b.logly.co.jp/sorry.html'
|
|
77
|
+
],
|
|
78
|
+
sponsoredBy: 'logly',
|
|
79
|
+
title: 'Native Title',
|
|
80
|
+
}
|
|
81
|
+
}],
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
describe('isBidRequestValid', function () {
|
|
86
|
+
it('should return true if the adspotId parameter is present', function () {
|
|
87
|
+
expect(spec.isBidRequestValid(nativeBidRequests[0])).to.be.true;
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('should return false if the adspotId parameter is not present', function () {
|
|
91
|
+
let bidRequest = utils.deepClone(nativeBidRequests[0]);
|
|
92
|
+
delete bidRequest.params.adspotId;
|
|
93
|
+
expect(spec.isBidRequestValid(bidRequest)).to.be.false;
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
describe('buildRequests', function () {
|
|
98
|
+
it('should generate a valid single POST request for multiple bid requests', function () {
|
|
99
|
+
const request = spec.buildRequests(nativeBidRequests, bidderRequest)[0];
|
|
100
|
+
expect(request.method).to.equal('POST');
|
|
101
|
+
expect(request.url).to.equal('https://bid.logly.co.jp/prebid/client/v1?adspot_id=16');
|
|
102
|
+
expect(request.data).to.exist;
|
|
103
|
+
|
|
104
|
+
const data = JSON.parse(request.data);
|
|
105
|
+
expect(data.auctionId).to.equal(nativeBidRequests[0].auctionId);
|
|
106
|
+
expect(data.bidderRequestId).to.equal(nativeBidRequests[0].bidderRequestId);
|
|
107
|
+
expect(data.transactionId).to.equal(nativeBidRequests[0].transactionId);
|
|
108
|
+
expect(data.adUnitCode).to.equal(nativeBidRequests[0].adUnitCode);
|
|
109
|
+
expect(data.bidId).to.equal(nativeBidRequests[0].bidId);
|
|
110
|
+
expect(data.mediaTypes).to.deep.equal(nativeBidRequests[0].mediaTypes);
|
|
111
|
+
expect(data.params).to.deep.equal(nativeBidRequests[0].params);
|
|
112
|
+
expect(data.prebidJsVersion).to.equal('$prebid.version$');
|
|
113
|
+
expect(data.url).to.exist;
|
|
114
|
+
expect(data.domain).to.exist;
|
|
115
|
+
expect(data.referer).to.equal(bidderRequest.refererInfo.referer);
|
|
116
|
+
expect(data.auctionStartTime).to.equal(bidderRequest.auctionStart);
|
|
117
|
+
expect(data.currency).to.exist;
|
|
118
|
+
expect(data.timeout).to.equal(bidderRequest.timeout);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
describe('interpretResponse', function () {
|
|
123
|
+
it('should return an empty array if an invalid response is passed', function () {
|
|
124
|
+
const interpretedResponse = spec.interpretResponse({}, {});
|
|
125
|
+
expect(interpretedResponse).to.be.an('array').that.is.empty;
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('should return valid response when passed valid server response', function () {
|
|
129
|
+
const request = spec.buildRequests(nativeBidRequests, bidderRequest)[0];
|
|
130
|
+
const interpretedResponse = spec.interpretResponse(nativeServerResponse, request);
|
|
131
|
+
|
|
132
|
+
expect(interpretedResponse).to.have.lengthOf(1);
|
|
133
|
+
expect(interpretedResponse[0].cpm).to.equal(nativeServerResponse.body.bids[0].cpm);
|
|
134
|
+
expect(interpretedResponse[0].width).to.equal(nativeServerResponse.body.bids[0].width);
|
|
135
|
+
expect(interpretedResponse[0].height).to.equal(nativeServerResponse.body.bids[0].height);
|
|
136
|
+
expect(interpretedResponse[0].creativeId).to.equal(nativeServerResponse.body.bids[0].creativeId);
|
|
137
|
+
expect(interpretedResponse[0].currency).to.equal(nativeServerResponse.body.bids[0].currency);
|
|
138
|
+
expect(interpretedResponse[0].netRevenue).to.equal(nativeServerResponse.body.bids[0].netRevenue);
|
|
139
|
+
expect(interpretedResponse[0].ttl).to.equal(nativeServerResponse.body.bids[0].ttl);
|
|
140
|
+
expect(interpretedResponse[0].native).to.deep.equal(nativeServerResponse.body.bids[0].native);
|
|
141
|
+
expect(interpretedResponse[0].meta.advertiserDomains[0]).to.equal(nativeServerResponse.body.bids[0].meta.advertiserDomains[0]);
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
describe('getUserSync tests', function () {
|
|
146
|
+
it('UserSync test : check type = iframe, check usermatch URL', function () {
|
|
147
|
+
const syncOptions = {
|
|
148
|
+
'iframeEnabled': true
|
|
149
|
+
}
|
|
150
|
+
let userSync = spec.getUserSyncs(syncOptions, [nativeServerResponse]);
|
|
151
|
+
expect(userSync[0].type).to.equal('iframe');
|
|
152
|
+
const USER_SYNC_URL = 'https://sync.logly.co.jp/sync/sync.html';
|
|
153
|
+
expect(userSync[0].url).to.equal(USER_SYNC_URL);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('When iframeEnabled is false, no userSync should be returned', function () {
|
|
157
|
+
const syncOptions = {
|
|
158
|
+
'iframeEnabled': false
|
|
159
|
+
}
|
|
160
|
+
let userSync = spec.getUserSyncs(syncOptions, [nativeServerResponse]);
|
|
161
|
+
expect(userSync).to.be.an('array').that.is.empty;
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
it('When nativeServerResponses empty, no userSync should be returned', function () {
|
|
165
|
+
const syncOptions = {
|
|
166
|
+
'iframeEnabled': false
|
|
167
|
+
}
|
|
168
|
+
let userSync = spec.getUserSyncs(syncOptions, []);
|
|
169
|
+
expect(userSync).to.be.an('array').that.is.empty;
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
});
|
|
@@ -40,7 +40,7 @@ describe('nextMillenniumBidAdapterTests', function() {
|
|
|
40
40
|
|
|
41
41
|
it('Check if refresh_count param is incremented', function() {
|
|
42
42
|
const request = spec.buildRequests(bidRequestData);
|
|
43
|
-
expect(JSON.parse(request[0].data).refresh_count).to.equal(3);
|
|
43
|
+
expect(JSON.parse(request[0].data).ext.nextMillennium.refresh_count).to.equal(3);
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
it('Test getUserSyncs function', function () {
|
|
@@ -268,6 +268,10 @@ describe('OguryBidAdapter', function () {
|
|
|
268
268
|
ext: {
|
|
269
269
|
consent: bidderRequest.gdprConsent.consentString
|
|
270
270
|
},
|
|
271
|
+
},
|
|
272
|
+
ext: {
|
|
273
|
+
prebidversion: '$prebid.version$',
|
|
274
|
+
adapterversion: '1.2.7'
|
|
271
275
|
}
|
|
272
276
|
};
|
|
273
277
|
|
|
@@ -425,7 +429,9 @@ describe('OguryBidAdapter', function () {
|
|
|
425
429
|
meta: {
|
|
426
430
|
advertiserDomains: openRtbBidResponse.body.seatbid[0].bid[0].adomain
|
|
427
431
|
},
|
|
428
|
-
nurl: openRtbBidResponse.body.seatbid[0].bid[0].nurl
|
|
432
|
+
nurl: openRtbBidResponse.body.seatbid[0].bid[0].nurl,
|
|
433
|
+
adapterVersion: '1.2.7',
|
|
434
|
+
prebidVersion: '$prebid.version$'
|
|
429
435
|
}, {
|
|
430
436
|
requestId: openRtbBidResponse.body.seatbid[0].bid[1].impid,
|
|
431
437
|
cpm: openRtbBidResponse.body.seatbid[0].bid[1].price,
|
|
@@ -440,7 +446,9 @@ describe('OguryBidAdapter', function () {
|
|
|
440
446
|
meta: {
|
|
441
447
|
advertiserDomains: openRtbBidResponse.body.seatbid[0].bid[1].adomain
|
|
442
448
|
},
|
|
443
|
-
nurl: openRtbBidResponse.body.seatbid[0].bid[1].nurl
|
|
449
|
+
nurl: openRtbBidResponse.body.seatbid[0].bid[1].nurl,
|
|
450
|
+
adapterVersion: '1.2.7',
|
|
451
|
+
prebidVersion: '$prebid.version$'
|
|
444
452
|
}]
|
|
445
453
|
|
|
446
454
|
let request = spec.buildRequests(bidRequests, bidderRequest);
|
|
@@ -35,17 +35,30 @@ describe('Optimera RTD score file properly sets targeting values', () => {
|
|
|
35
35
|
'de': {
|
|
36
36
|
'div-0': ['A5', 'A6'],
|
|
37
37
|
'div-1': ['A7', 'A8'],
|
|
38
|
+
'insights': {
|
|
39
|
+
'ilv': ['div-0'],
|
|
40
|
+
'miv': ['div-4'],
|
|
41
|
+
}
|
|
38
42
|
},
|
|
39
43
|
'mo': {
|
|
40
44
|
'div-0': ['A9', 'B0'],
|
|
41
45
|
'div-1': ['B1', 'B2'],
|
|
46
|
+
'insights': {
|
|
47
|
+
'ilv': ['div-1'],
|
|
48
|
+
'miv': ['div-2'],
|
|
49
|
+
}
|
|
42
50
|
}
|
|
51
|
+
},
|
|
52
|
+
'insights': {
|
|
53
|
+
'ilv': ['div-5'],
|
|
54
|
+
'miv': ['div-6'],
|
|
43
55
|
}
|
|
44
56
|
};
|
|
45
|
-
it('Properly set the score file url', () => {
|
|
57
|
+
it('Properly set the score file url and scores', () => {
|
|
46
58
|
optimeraRTD.setScores(JSON.stringify(scores));
|
|
47
59
|
expect(optimeraRTD.optimeraTargeting['div-0']).to.include.ordered.members(['A5', 'A6']);
|
|
48
60
|
expect(optimeraRTD.optimeraTargeting['div-1']).to.include.ordered.members(['A7', 'A8']);
|
|
61
|
+
expect(window.optimeraInsights.data['ilv']).to.include.ordered.members(['div-0']);
|
|
49
62
|
});
|
|
50
63
|
});
|
|
51
64
|
|