prebid.js 7.14.0 → 7.16.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 +3 -0
- package/dist/1plusXRtdProvider.js +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adfBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adkernelAdnBidAdapter.js +1 -1
- package/dist/adkernelBidAdapter.js +1 -1
- package/dist/adlooxAdServerVideo.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adtrueBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/airgridRtdProvider.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/aolBidAdapter.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/beachfrontBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bizzclickBidAdapter.js +1 -1
- package/dist/bliinkBidAdapter.js +1 -1
- package/dist/bluebillywigBidAdapter.js +1 -1
- package/dist/brandmetricsRtdProvider.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/brightcomBidAdapter.js +1 -1
- package/dist/browsiRtdProvider.js +1 -1
- package/dist/categoryTranslation.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consentManagement.js +1 -1
- package/dist/consentManagementUsp.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/cpmstarBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/currency.js +1 -1
- package/dist/dataControllerModule.js +1 -1
- package/dist/dchain.js +1 -1
- package/dist/deepintentBidAdapter.js +1 -1
- package/dist/dependencies.json +3 -0
- package/dist/dgkeywordRtdProvider.js +1 -1
- package/dist/dianomiBidAdapter.js +1 -1
- package/dist/distroscaleBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/etargetBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/fpdModule.js +1 -1
- package/dist/gamoshiBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gothamadsBidAdapter.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/iasRtdProvider.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/imRtdProvider.js +1 -1
- package/dist/impactifyBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentAnalyticsAdapter.js +1 -0
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/luponmediaBidAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mass.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediakeysBidAdapter.js +1 -1
- package/dist/mediasniperBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/multibid.js +1 -1
- package/dist/naveggIdSystem.js +1 -1
- package/dist/newspassidBidAdapter.js +1 -1
- package/dist/nextMillenniumBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +172 -171
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/oneKeyRtdProvider.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxBidAdapter.js +1 -1
- package/dist/openxOrtbBidAdapter.js +1 -1
- package/dist/operaadsBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/ozoneBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/permutiveRtdProvider.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +2 -2
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/priceFloors.js +1 -1
- package/dist/pubCommonId.js +1 -1
- package/dist/pubgeniusBidAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubwiseBidAdapter.js +1 -1
- package/dist/pubxBidAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rtdModule.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/sirdataRtdProvider.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/spotxBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stroeerCoreBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/ucfunnelBidAdapter.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/viewability.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/weboramaRtdProvider.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldliftBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspBidAdapter.js +1 -1
- package/modules/amxBidAdapter.js +98 -78
- package/modules/appnexusBidAdapter.js +73 -12
- package/modules/categoryTranslation.js +9 -8
- package/modules/consentManagement.js +4 -2
- package/modules/consentManagementUsp.js +17 -14
- package/modules/cpmstarBidAdapter.js +2 -1
- package/modules/currency.js +4 -3
- package/modules/dataControllerModule/index.js +4 -3
- package/modules/dchain.js +3 -2
- package/modules/dianomiBidAdapter.js +17 -14
- package/modules/dianomiBidAdapter.md +1 -1
- package/modules/feedadBidAdapter.js +40 -8
- package/modules/fpdModule/index.js +3 -2
- package/modules/iasRtdProvider.js +17 -3
- package/modules/ixBidAdapter.js +2 -5
- package/modules/liveIntentAnalyticsAdapter.js +148 -0
- package/modules/liveIntentAnalyticsAdapter.md +22 -0
- package/modules/mass.js +5 -3
- package/modules/multibid/index.js +4 -2
- package/modules/naveggIdSystem.js +53 -22
- package/modules/nextMillenniumBidAdapter.js +168 -55
- package/modules/openxOrtbBidAdapter.js +1 -1
- package/modules/prebidServerBidAdapter/index.js +18 -4
- package/modules/priceFloors.js +5 -4
- package/modules/pubCommonId.js +3 -2
- package/modules/rtdModule/index.js +3 -2
- package/modules/sharethroughBidAdapter.js +8 -6
- package/modules/spotxBidAdapter.js +1 -0
- package/modules/stroeerCoreBidAdapter.js +129 -92
- package/modules/stroeerCoreBidAdapter.md +52 -14
- package/modules/teadsBidAdapter.js +32 -10
- package/modules/ucfunnelBidAdapter.js +9 -10
- package/modules/userId/index.js +73 -48
- package/modules/viewability.js +2 -170
- package/package.json +3 -3
- package/src/adapterManager.js +21 -13
- package/src/adapters/bidderFactory.js +28 -6
- package/src/auction.js +17 -4
- package/src/auctionManager.js +5 -0
- package/src/constants.json +2 -0
- package/src/native.js +5 -2
- package/src/prebid.js +52 -23
- package/src/secureCreatives.js +1 -1
- package/src/utils/perfMetrics.js +386 -0
- package/src/utils.js +1 -1
- package/test/helpers/testing-utils.js +4 -3
- package/test/spec/modules/adriverIdSystem_spec.js +7 -3
- package/test/spec/modules/amxBidAdapter_spec.js +250 -192
- package/test/spec/modules/appnexusBidAdapter_spec.js +61 -6
- package/test/spec/modules/consentManagementUsp_spec.js +6 -2
- package/test/spec/modules/dianomiBidAdapter_spec.js +326 -6
- package/test/spec/modules/feedadBidAdapter_spec.js +147 -11
- package/test/spec/modules/iasRtdProvider_spec.js +3 -1
- package/test/spec/modules/ixBidAdapter_spec.js +0 -64
- package/test/spec/modules/liveIntentAnalyticsAdapter_spec.js +297 -0
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +103 -1
- package/test/spec/modules/openxOrtbBidAdapter_spec.js +31 -0
- package/test/spec/modules/sharethroughBidAdapter_spec.js +23 -2
- package/test/spec/modules/spotxBidAdapter_spec.js +6 -0
- package/test/spec/modules/stroeerCoreBidAdapter_spec.js +315 -33
- package/test/spec/modules/teadsBidAdapter_spec.js +65 -11
- package/test/spec/modules/ucfunnelBidAdapter_spec.js +24 -10
- package/test/spec/native_spec.js +11 -0
- package/test/spec/unit/utils/perfMetrics_spec.js +394 -0
- package/wdio.conf.js +1 -0
- package/modules/viewability.md +0 -87
- package/test/spec/modules/viewability_spec.js +0 -280
|
@@ -610,7 +610,7 @@ describe('AppNexusAdapter', function () {
|
|
|
610
610
|
config.getConfig.restore();
|
|
611
611
|
});
|
|
612
612
|
|
|
613
|
-
it('adds auction level keywords to request when set', function () {
|
|
613
|
+
it('adds auction level keywords and ortb2 keywords to request when set', function () {
|
|
614
614
|
let bidRequest = Object.assign({}, bidRequests[0]);
|
|
615
615
|
sinon
|
|
616
616
|
.stub(config, 'getConfig')
|
|
@@ -618,10 +618,31 @@ describe('AppNexusAdapter', function () {
|
|
|
618
618
|
.returns({
|
|
619
619
|
gender: 'm',
|
|
620
620
|
music: ['rock', 'pop'],
|
|
621
|
-
test: ''
|
|
621
|
+
test: '',
|
|
622
|
+
tools: 'power'
|
|
622
623
|
});
|
|
623
624
|
|
|
624
|
-
const
|
|
625
|
+
const bidderRequest = {
|
|
626
|
+
ortb2: {
|
|
627
|
+
site: {
|
|
628
|
+
keywords: 'power tools, drills, tools=industrial',
|
|
629
|
+
content: {
|
|
630
|
+
keywords: 'video, source=streaming'
|
|
631
|
+
}
|
|
632
|
+
},
|
|
633
|
+
user: {
|
|
634
|
+
keywords: 'tools=home,renting'
|
|
635
|
+
},
|
|
636
|
+
app: {
|
|
637
|
+
keywords: 'app=iphone 11',
|
|
638
|
+
content: {
|
|
639
|
+
keywords: 'appcontent=home repair, dyi'
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
const request = spec.buildRequests([bidRequest], bidderRequest);
|
|
625
646
|
const payload = JSON.parse(request.data);
|
|
626
647
|
|
|
627
648
|
expect(payload.keywords).to.deep.equal([{
|
|
@@ -632,6 +653,28 @@ describe('AppNexusAdapter', function () {
|
|
|
632
653
|
'value': ['rock', 'pop']
|
|
633
654
|
}, {
|
|
634
655
|
'key': 'test'
|
|
656
|
+
}, {
|
|
657
|
+
'key': 'tools',
|
|
658
|
+
'value': ['power', 'industrial', 'home']
|
|
659
|
+
}, {
|
|
660
|
+
'key': 'power tools'
|
|
661
|
+
}, {
|
|
662
|
+
'key': 'drills'
|
|
663
|
+
}, {
|
|
664
|
+
'key': 'video'
|
|
665
|
+
}, {
|
|
666
|
+
'key': 'source',
|
|
667
|
+
'value': ['streaming']
|
|
668
|
+
}, {
|
|
669
|
+
'key': 'renting'
|
|
670
|
+
}, {
|
|
671
|
+
'key': 'app',
|
|
672
|
+
'value': ['iphone 11']
|
|
673
|
+
}, {
|
|
674
|
+
'key': 'appcontent',
|
|
675
|
+
'value': ['home repair']
|
|
676
|
+
}, {
|
|
677
|
+
'key': 'dyi'
|
|
635
678
|
}]);
|
|
636
679
|
|
|
637
680
|
config.getConfig.restore();
|
|
@@ -714,7 +757,7 @@ describe('AppNexusAdapter', function () {
|
|
|
714
757
|
});
|
|
715
758
|
}
|
|
716
759
|
|
|
717
|
-
it('should convert keyword params to proper form and attaches to request', function () {
|
|
760
|
+
it('should convert keyword params and adUnit ortb2 keywords to proper form and attaches to request', function () {
|
|
718
761
|
let bidRequest = Object.assign({},
|
|
719
762
|
bidRequests[0],
|
|
720
763
|
{
|
|
@@ -730,6 +773,13 @@ describe('AppNexusAdapter', function () {
|
|
|
730
773
|
emptyArr: [''],
|
|
731
774
|
badValue: { 'foo': 'bar' } // should be dropped
|
|
732
775
|
}
|
|
776
|
+
},
|
|
777
|
+
ortb2Imp: {
|
|
778
|
+
ext: {
|
|
779
|
+
data: {
|
|
780
|
+
keywords: 'ortb2=yes,ortb2test, multiValMixed=4, singleValNum=456'
|
|
781
|
+
}
|
|
782
|
+
}
|
|
733
783
|
}
|
|
734
784
|
}
|
|
735
785
|
);
|
|
@@ -748,14 +798,19 @@ describe('AppNexusAdapter', function () {
|
|
|
748
798
|
'value': ['5']
|
|
749
799
|
}, {
|
|
750
800
|
'key': 'multiValMixed',
|
|
751
|
-
'value': ['value1', '2', 'value3']
|
|
801
|
+
'value': ['value1', '2', 'value3', '4']
|
|
752
802
|
}, {
|
|
753
803
|
'key': 'singleValNum',
|
|
754
|
-
'value': ['123']
|
|
804
|
+
'value': ['123', '456']
|
|
755
805
|
}, {
|
|
756
806
|
'key': 'emptyStr'
|
|
757
807
|
}, {
|
|
758
808
|
'key': 'emptyArr'
|
|
809
|
+
}, {
|
|
810
|
+
'key': 'ortb2',
|
|
811
|
+
'value': ['yes']
|
|
812
|
+
}, {
|
|
813
|
+
'key': 'ortb2test'
|
|
759
814
|
}]);
|
|
760
815
|
});
|
|
761
816
|
|
|
@@ -23,8 +23,12 @@ function createIFrameMarker() {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
describe('consentManagement', function () {
|
|
26
|
-
it('should
|
|
27
|
-
|
|
26
|
+
it('should enable itself on requestBids using default values', (done) => {
|
|
27
|
+
requestBidsHook(() => {
|
|
28
|
+
expect(uspDataHandler.enabled).to.be.true;
|
|
29
|
+
expect(consentAPI).to.eql('iab');
|
|
30
|
+
done();
|
|
31
|
+
}, {});
|
|
28
32
|
});
|
|
29
33
|
it('should respect configuration set after activation', () => {
|
|
30
34
|
setConsentConfig({
|
|
@@ -198,7 +198,7 @@ describe('Dianomi adapter', () => {
|
|
|
198
198
|
{
|
|
199
199
|
bidId: 'bidId',
|
|
200
200
|
params: { smartadId: 1234 },
|
|
201
|
-
ortb2
|
|
201
|
+
ortb2,
|
|
202
202
|
},
|
|
203
203
|
];
|
|
204
204
|
let request = JSON.parse(
|
|
@@ -225,12 +225,12 @@ describe('Dianomi adapter', () => {
|
|
|
225
225
|
name: "publisher's name",
|
|
226
226
|
},
|
|
227
227
|
},
|
|
228
|
-
}
|
|
228
|
+
};
|
|
229
229
|
let validBidRequests = [
|
|
230
230
|
{
|
|
231
231
|
bidId: 'bidId',
|
|
232
232
|
params: { smartadId: 1234 },
|
|
233
|
-
ortb2
|
|
233
|
+
ortb2,
|
|
234
234
|
},
|
|
235
235
|
];
|
|
236
236
|
let refererInfo = { page: 'page' };
|
|
@@ -342,7 +342,7 @@ describe('Dianomi adapter', () => {
|
|
|
342
342
|
},
|
|
343
343
|
{
|
|
344
344
|
bidId: 'bidId2',
|
|
345
|
-
params: { smartadId: 1234 }
|
|
345
|
+
params: { smartadId: 1234 },
|
|
346
346
|
},
|
|
347
347
|
];
|
|
348
348
|
let request = JSON.parse(
|
|
@@ -1022,7 +1022,7 @@ describe('Dianomi adapter', () => {
|
|
|
1022
1022
|
{
|
|
1023
1023
|
data: null,
|
|
1024
1024
|
id: 2,
|
|
1025
|
-
img: { type: null, url: 'test.url.com/Files/58345/308185.
|
|
1025
|
+
img: { type: null, url: 'test.url.com/Files/58345/308185.jpgbv=1', w: 30, h: 10 },
|
|
1026
1026
|
required: 0,
|
|
1027
1027
|
title: null,
|
|
1028
1028
|
video: null,
|
|
@@ -1032,7 +1032,7 @@ describe('Dianomi adapter', () => {
|
|
|
1032
1032
|
id: 3,
|
|
1033
1033
|
img: {
|
|
1034
1034
|
type: null,
|
|
1035
|
-
url: 'test.url.com/Files/58345/308200.
|
|
1035
|
+
url: 'test.url.com/Files/58345/308200.jpgbv=1',
|
|
1036
1036
|
w: 100,
|
|
1037
1037
|
h: 100,
|
|
1038
1038
|
},
|
|
@@ -1220,4 +1220,324 @@ describe('Dianomi adapter', () => {
|
|
|
1220
1220
|
});
|
|
1221
1221
|
});
|
|
1222
1222
|
});
|
|
1223
|
+
|
|
1224
|
+
describe('UserSyncs', () => {
|
|
1225
|
+
let usersyncIframeUrl = 'https://www-prebid.dianomi.com/prebid/usersync/index.html?';
|
|
1226
|
+
let usersyncRedirectUrl = 'https://data.dianomi.com/frontend/usync?';
|
|
1227
|
+
it('should register the usersync iframe', function () {
|
|
1228
|
+
let syncs = spec.getUserSyncs({
|
|
1229
|
+
iframeEnabled: true,
|
|
1230
|
+
});
|
|
1231
|
+
|
|
1232
|
+
expect(syncs).to.deep.equal({ type: 'iframe', url: usersyncIframeUrl });
|
|
1233
|
+
});
|
|
1234
|
+
|
|
1235
|
+
it('should register the usersync redirect', function () {
|
|
1236
|
+
let syncs = spec.getUserSyncs({
|
|
1237
|
+
pixelEnabled: true,
|
|
1238
|
+
});
|
|
1239
|
+
|
|
1240
|
+
expect(syncs).to.deep.equal({ type: 'image', url: usersyncRedirectUrl });
|
|
1241
|
+
});
|
|
1242
|
+
|
|
1243
|
+
it('should pass gdpr params if consent is true', function () {
|
|
1244
|
+
expect(
|
|
1245
|
+
spec.getUserSyncs(
|
|
1246
|
+
{ iframeEnabled: true },
|
|
1247
|
+
{},
|
|
1248
|
+
{
|
|
1249
|
+
gdprApplies: true,
|
|
1250
|
+
consentString: 'foo',
|
|
1251
|
+
}
|
|
1252
|
+
)
|
|
1253
|
+
).to.deep.equal({
|
|
1254
|
+
type: 'iframe',
|
|
1255
|
+
url: `${usersyncIframeUrl}gdpr=1&gdpr_consent=foo`,
|
|
1256
|
+
});
|
|
1257
|
+
|
|
1258
|
+
expect(
|
|
1259
|
+
spec.getUserSyncs(
|
|
1260
|
+
{ pixelEnabled: true },
|
|
1261
|
+
{},
|
|
1262
|
+
{
|
|
1263
|
+
gdprApplies: true,
|
|
1264
|
+
consentString: 'foo',
|
|
1265
|
+
}
|
|
1266
|
+
)
|
|
1267
|
+
).to.deep.equal({
|
|
1268
|
+
type: 'image',
|
|
1269
|
+
url: `${usersyncRedirectUrl}gdpr=1&gdpr_consent=foo`,
|
|
1270
|
+
});
|
|
1271
|
+
});
|
|
1272
|
+
|
|
1273
|
+
it('should pass gdpr params if consent is false', function () {
|
|
1274
|
+
expect(
|
|
1275
|
+
spec.getUserSyncs(
|
|
1276
|
+
{ iframeEnabled: true },
|
|
1277
|
+
{},
|
|
1278
|
+
{
|
|
1279
|
+
gdprApplies: false,
|
|
1280
|
+
consentString: 'foo',
|
|
1281
|
+
}
|
|
1282
|
+
)
|
|
1283
|
+
).to.deep.equal({
|
|
1284
|
+
type: 'iframe',
|
|
1285
|
+
url: `${usersyncIframeUrl}gdpr=0&gdpr_consent=foo`,
|
|
1286
|
+
});
|
|
1287
|
+
|
|
1288
|
+
expect(
|
|
1289
|
+
spec.getUserSyncs(
|
|
1290
|
+
{ pixelEnabled: true },
|
|
1291
|
+
{},
|
|
1292
|
+
{
|
|
1293
|
+
gdprApplies: false,
|
|
1294
|
+
consentString: 'foo',
|
|
1295
|
+
}
|
|
1296
|
+
)
|
|
1297
|
+
).to.deep.equal({
|
|
1298
|
+
type: 'image',
|
|
1299
|
+
url: `${usersyncRedirectUrl}gdpr=0&gdpr_consent=foo`,
|
|
1300
|
+
});
|
|
1301
|
+
});
|
|
1302
|
+
|
|
1303
|
+
it('should pass gdpr param gdpr_consent only when gdprApplies is undefined', function () {
|
|
1304
|
+
expect(
|
|
1305
|
+
spec.getUserSyncs(
|
|
1306
|
+
{ iframeEnabled: true },
|
|
1307
|
+
{},
|
|
1308
|
+
{
|
|
1309
|
+
consentString: 'foo',
|
|
1310
|
+
}
|
|
1311
|
+
)
|
|
1312
|
+
).to.deep.equal({
|
|
1313
|
+
type: 'iframe',
|
|
1314
|
+
url: `${usersyncIframeUrl}gdpr_consent=foo`,
|
|
1315
|
+
});
|
|
1316
|
+
|
|
1317
|
+
expect(
|
|
1318
|
+
spec.getUserSyncs(
|
|
1319
|
+
{ pixelEnabled: true },
|
|
1320
|
+
{},
|
|
1321
|
+
{
|
|
1322
|
+
consentString: 'foo',
|
|
1323
|
+
}
|
|
1324
|
+
)
|
|
1325
|
+
).to.deep.equal({
|
|
1326
|
+
type: 'image',
|
|
1327
|
+
url: `${usersyncRedirectUrl}gdpr_consent=foo`,
|
|
1328
|
+
});
|
|
1329
|
+
});
|
|
1330
|
+
|
|
1331
|
+
it('should pass no params if gdpr consentString is not defined', function () {
|
|
1332
|
+
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {})).to.deep.equal({
|
|
1333
|
+
type: 'iframe',
|
|
1334
|
+
url: `${usersyncIframeUrl}`,
|
|
1335
|
+
});
|
|
1336
|
+
|
|
1337
|
+
expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {})).to.deep.equal({
|
|
1338
|
+
type: 'image',
|
|
1339
|
+
url: `${usersyncRedirectUrl}`,
|
|
1340
|
+
});
|
|
1341
|
+
});
|
|
1342
|
+
|
|
1343
|
+
it('should pass no params if gdpr consentString is a number', function () {
|
|
1344
|
+
expect(
|
|
1345
|
+
spec.getUserSyncs(
|
|
1346
|
+
{ iframeEnabled: true },
|
|
1347
|
+
{},
|
|
1348
|
+
{
|
|
1349
|
+
consentString: 0,
|
|
1350
|
+
}
|
|
1351
|
+
)
|
|
1352
|
+
).to.deep.equal({
|
|
1353
|
+
type: 'iframe',
|
|
1354
|
+
url: `${usersyncIframeUrl}`,
|
|
1355
|
+
});
|
|
1356
|
+
|
|
1357
|
+
expect(
|
|
1358
|
+
spec.getUserSyncs(
|
|
1359
|
+
{ pixelEnabled: true },
|
|
1360
|
+
{},
|
|
1361
|
+
{
|
|
1362
|
+
consentString: 0,
|
|
1363
|
+
}
|
|
1364
|
+
)
|
|
1365
|
+
).to.deep.equal({
|
|
1366
|
+
type: 'image',
|
|
1367
|
+
url: `${usersyncRedirectUrl}`,
|
|
1368
|
+
});
|
|
1369
|
+
});
|
|
1370
|
+
|
|
1371
|
+
it('should pass no params if gdpr consentString is null', function () {
|
|
1372
|
+
expect(
|
|
1373
|
+
spec.getUserSyncs(
|
|
1374
|
+
{ iframeEnabled: true },
|
|
1375
|
+
{},
|
|
1376
|
+
{
|
|
1377
|
+
consentString: null,
|
|
1378
|
+
}
|
|
1379
|
+
)
|
|
1380
|
+
).to.deep.equal({
|
|
1381
|
+
type: 'iframe',
|
|
1382
|
+
url: `${usersyncIframeUrl}`,
|
|
1383
|
+
});
|
|
1384
|
+
|
|
1385
|
+
expect(
|
|
1386
|
+
spec.getUserSyncs(
|
|
1387
|
+
{ pixelEnabled: true },
|
|
1388
|
+
{},
|
|
1389
|
+
{
|
|
1390
|
+
consentString: null,
|
|
1391
|
+
}
|
|
1392
|
+
)
|
|
1393
|
+
).to.deep.equal({
|
|
1394
|
+
type: 'image',
|
|
1395
|
+
url: `${usersyncRedirectUrl}`,
|
|
1396
|
+
});
|
|
1397
|
+
});
|
|
1398
|
+
|
|
1399
|
+
it('should pass no params if gdpr consentString is a object', function () {
|
|
1400
|
+
expect(
|
|
1401
|
+
spec.getUserSyncs(
|
|
1402
|
+
{ iframeEnabled: true },
|
|
1403
|
+
{},
|
|
1404
|
+
{
|
|
1405
|
+
consentString: {},
|
|
1406
|
+
}
|
|
1407
|
+
)
|
|
1408
|
+
).to.deep.equal({
|
|
1409
|
+
type: 'iframe',
|
|
1410
|
+
url: `${usersyncIframeUrl}`,
|
|
1411
|
+
});
|
|
1412
|
+
|
|
1413
|
+
expect(
|
|
1414
|
+
spec.getUserSyncs(
|
|
1415
|
+
{ pixelEnabled: true },
|
|
1416
|
+
{},
|
|
1417
|
+
{
|
|
1418
|
+
consentString: {},
|
|
1419
|
+
}
|
|
1420
|
+
)
|
|
1421
|
+
).to.deep.equal({
|
|
1422
|
+
type: 'image',
|
|
1423
|
+
url: `${usersyncRedirectUrl}`,
|
|
1424
|
+
});
|
|
1425
|
+
});
|
|
1426
|
+
|
|
1427
|
+
it('should pass no params if gdpr is not defined', function () {
|
|
1428
|
+
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, undefined)).to.deep.equal({
|
|
1429
|
+
type: 'iframe',
|
|
1430
|
+
url: `${usersyncIframeUrl}`,
|
|
1431
|
+
});
|
|
1432
|
+
|
|
1433
|
+
expect(spec.getUserSyncs({ pixelEnabled: true }, {}, undefined)).to.deep.equal({
|
|
1434
|
+
type: 'image',
|
|
1435
|
+
url: `${usersyncRedirectUrl}`,
|
|
1436
|
+
});
|
|
1437
|
+
});
|
|
1438
|
+
|
|
1439
|
+
it('should pass us_privacy if uspConsent is defined', function () {
|
|
1440
|
+
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, undefined, '1NYN')).to.deep.equal({
|
|
1441
|
+
type: 'iframe',
|
|
1442
|
+
url: `${usersyncIframeUrl}us_privacy=1NYN`,
|
|
1443
|
+
});
|
|
1444
|
+
|
|
1445
|
+
expect(spec.getUserSyncs({ pixelEnabled: true }, {}, undefined, '1NYN')).to.deep.equal({
|
|
1446
|
+
type: 'image',
|
|
1447
|
+
url: `${usersyncRedirectUrl}us_privacy=1NYN`,
|
|
1448
|
+
});
|
|
1449
|
+
});
|
|
1450
|
+
|
|
1451
|
+
it('should pass us_privacy after gdpr if both are present', function () {
|
|
1452
|
+
expect(
|
|
1453
|
+
spec.getUserSyncs(
|
|
1454
|
+
{ iframeEnabled: true },
|
|
1455
|
+
{},
|
|
1456
|
+
{
|
|
1457
|
+
consentString: 'foo',
|
|
1458
|
+
},
|
|
1459
|
+
'1NYN'
|
|
1460
|
+
)
|
|
1461
|
+
).to.deep.equal({
|
|
1462
|
+
type: 'iframe',
|
|
1463
|
+
url: `${usersyncIframeUrl}gdpr_consent=foo&us_privacy=1NYN`,
|
|
1464
|
+
});
|
|
1465
|
+
|
|
1466
|
+
expect(
|
|
1467
|
+
spec.getUserSyncs(
|
|
1468
|
+
{ pixelEnabled: true },
|
|
1469
|
+
{},
|
|
1470
|
+
{
|
|
1471
|
+
consentString: 'foo',
|
|
1472
|
+
},
|
|
1473
|
+
'1NYN'
|
|
1474
|
+
)
|
|
1475
|
+
).to.deep.equal({
|
|
1476
|
+
type: 'image',
|
|
1477
|
+
url: `${usersyncRedirectUrl}gdpr_consent=foo&us_privacy=1NYN`,
|
|
1478
|
+
});
|
|
1479
|
+
});
|
|
1480
|
+
|
|
1481
|
+
it('should pass gdprApplies', function () {
|
|
1482
|
+
expect(
|
|
1483
|
+
spec.getUserSyncs(
|
|
1484
|
+
{ iframeEnabled: true },
|
|
1485
|
+
{},
|
|
1486
|
+
{
|
|
1487
|
+
gdprApplies: true,
|
|
1488
|
+
},
|
|
1489
|
+
'1NYN'
|
|
1490
|
+
)
|
|
1491
|
+
).to.deep.equal({
|
|
1492
|
+
type: 'iframe',
|
|
1493
|
+
url: `${usersyncIframeUrl}gdpr=1&us_privacy=1NYN`,
|
|
1494
|
+
});
|
|
1495
|
+
|
|
1496
|
+
expect(
|
|
1497
|
+
spec.getUserSyncs(
|
|
1498
|
+
{ pixelEnabled: true },
|
|
1499
|
+
{},
|
|
1500
|
+
{
|
|
1501
|
+
gdprApplies: true,
|
|
1502
|
+
},
|
|
1503
|
+
'1NYN'
|
|
1504
|
+
)
|
|
1505
|
+
).to.deep.equal({
|
|
1506
|
+
type: 'image',
|
|
1507
|
+
url: `${usersyncRedirectUrl}gdpr=1&us_privacy=1NYN`,
|
|
1508
|
+
});
|
|
1509
|
+
});
|
|
1510
|
+
|
|
1511
|
+
it('should pass all correctly', function () {
|
|
1512
|
+
expect(
|
|
1513
|
+
spec.getUserSyncs(
|
|
1514
|
+
{ iframeEnabled: true },
|
|
1515
|
+
{},
|
|
1516
|
+
{
|
|
1517
|
+
gdprApplies: true,
|
|
1518
|
+
consentString: 'foo',
|
|
1519
|
+
},
|
|
1520
|
+
'1NYN'
|
|
1521
|
+
)
|
|
1522
|
+
).to.deep.equal({
|
|
1523
|
+
type: 'iframe',
|
|
1524
|
+
url: `${usersyncIframeUrl}gdpr=1&gdpr_consent=foo&us_privacy=1NYN`,
|
|
1525
|
+
});
|
|
1526
|
+
|
|
1527
|
+
expect(
|
|
1528
|
+
spec.getUserSyncs(
|
|
1529
|
+
{ pixelEnabled: true },
|
|
1530
|
+
{},
|
|
1531
|
+
{
|
|
1532
|
+
gdprApplies: true,
|
|
1533
|
+
consentString: 'foo',
|
|
1534
|
+
},
|
|
1535
|
+
'1NYN'
|
|
1536
|
+
)
|
|
1537
|
+
).to.deep.equal({
|
|
1538
|
+
type: 'image',
|
|
1539
|
+
url: `${usersyncRedirectUrl}gdpr=1&gdpr_consent=foo&us_privacy=1NYN`,
|
|
1540
|
+
});
|
|
1541
|
+
});
|
|
1542
|
+
});
|
|
1223
1543
|
});
|
|
@@ -303,24 +303,160 @@ describe('FeedAdAdapter', function () {
|
|
|
303
303
|
});
|
|
304
304
|
|
|
305
305
|
describe('interpretResponse', function () {
|
|
306
|
-
const body = [{
|
|
307
|
-
foo: 'bar',
|
|
308
|
-
sub: {
|
|
309
|
-
obj: 5
|
|
310
|
-
}
|
|
311
|
-
}, {
|
|
312
|
-
bar: 'foo'
|
|
313
|
-
}];
|
|
314
|
-
|
|
315
306
|
it('should convert string bodies to JSON', function () {
|
|
307
|
+
const body = [{
|
|
308
|
+
ad: 'bar',
|
|
309
|
+
}];
|
|
316
310
|
let result = spec.interpretResponse({body: JSON.stringify(body)});
|
|
317
311
|
expect(result).to.deep.equal(body);
|
|
318
312
|
});
|
|
319
313
|
|
|
320
|
-
it('should pass through
|
|
314
|
+
it('should pass through object bodies', function () {
|
|
315
|
+
const body = [{
|
|
316
|
+
ad: 'bar',
|
|
317
|
+
}];
|
|
321
318
|
let result = spec.interpretResponse({body});
|
|
322
319
|
expect(result).to.deep.equal(body);
|
|
323
320
|
});
|
|
321
|
+
|
|
322
|
+
it('should pass through only bodies with ad fields', function () {
|
|
323
|
+
const bid1 = {
|
|
324
|
+
ad: 'bar',
|
|
325
|
+
other: 'field',
|
|
326
|
+
some: 'thing'
|
|
327
|
+
};
|
|
328
|
+
const bid2 = {
|
|
329
|
+
foo: 'bar'
|
|
330
|
+
};
|
|
331
|
+
const bid3 = {
|
|
332
|
+
ad: 'ad html',
|
|
333
|
+
};
|
|
334
|
+
const body = [bid1, bid2, bid3];
|
|
335
|
+
let result = spec.interpretResponse({body: JSON.stringify(body)});
|
|
336
|
+
expect(result).to.deep.equal([bid1, bid3]);
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
it('should remove extension fields from bid responses', function () {
|
|
340
|
+
const bid = {
|
|
341
|
+
ext: {},
|
|
342
|
+
ad: 'ad html',
|
|
343
|
+
cpm: 100
|
|
344
|
+
};
|
|
345
|
+
const result = spec.interpretResponse({body: JSON.stringify([bid])});
|
|
346
|
+
expect(result[0]).not.to.haveOwnProperty('ext');
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
it('should return an empty array if the response is not an array', function () {
|
|
350
|
+
const bid = {};
|
|
351
|
+
const result = spec.interpretResponse({body: JSON.stringify(bid)});
|
|
352
|
+
expect(result).to.deep.equal([]);
|
|
353
|
+
});
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
describe('getUserSyncs', function () {
|
|
357
|
+
const pixelSync1 = {type: 'image', url: 'the pixel url 1'};
|
|
358
|
+
const pixelSync2 = {type: 'image', url: 'the pixel url 2'};
|
|
359
|
+
const iFrameSync1 = {type: 'iframe', url: 'the iFrame url 1'};
|
|
360
|
+
const iFrameSync2 = {type: 'iframe', url: 'the iFrame url 2'};
|
|
361
|
+
|
|
362
|
+
it('should pass through the syncs out of the extension fields of the server response', function () {
|
|
363
|
+
const serverResponse = [{
|
|
364
|
+
ext: {
|
|
365
|
+
pixels: [pixelSync1, pixelSync2],
|
|
366
|
+
iframes: [iFrameSync1, iFrameSync2],
|
|
367
|
+
}
|
|
368
|
+
}];
|
|
369
|
+
const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, serverResponse)
|
|
370
|
+
expect(result).to.deep.equal([
|
|
371
|
+
pixelSync1,
|
|
372
|
+
pixelSync2,
|
|
373
|
+
iFrameSync1,
|
|
374
|
+
iFrameSync2,
|
|
375
|
+
]);
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
it('should concat the syncs of all responses', function () {
|
|
379
|
+
const serverResponse = [{
|
|
380
|
+
ext: {
|
|
381
|
+
pixels: [pixelSync1],
|
|
382
|
+
iframes: [iFrameSync2],
|
|
383
|
+
},
|
|
384
|
+
ad: 'ad html',
|
|
385
|
+
cpm: 100
|
|
386
|
+
}, {
|
|
387
|
+
ext: {
|
|
388
|
+
iframes: [iFrameSync1],
|
|
389
|
+
}
|
|
390
|
+
}, {
|
|
391
|
+
ext: {
|
|
392
|
+
pixels: [pixelSync2],
|
|
393
|
+
}
|
|
394
|
+
}];
|
|
395
|
+
const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, serverResponse);
|
|
396
|
+
expect(result).to.deep.equal([
|
|
397
|
+
pixelSync1,
|
|
398
|
+
iFrameSync2,
|
|
399
|
+
iFrameSync1,
|
|
400
|
+
pixelSync2,
|
|
401
|
+
]);
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
it('should filter out duplicates', function () {
|
|
405
|
+
const serverResponse = [{
|
|
406
|
+
ext: {
|
|
407
|
+
pixels: [pixelSync1, pixelSync1],
|
|
408
|
+
iframes: [iFrameSync2, iFrameSync2],
|
|
409
|
+
}
|
|
410
|
+
}, {
|
|
411
|
+
ext: {
|
|
412
|
+
iframes: [iFrameSync2, iFrameSync2],
|
|
413
|
+
}
|
|
414
|
+
}];
|
|
415
|
+
const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, serverResponse);
|
|
416
|
+
expect(result).to.deep.equal([
|
|
417
|
+
pixelSync1,
|
|
418
|
+
iFrameSync2,
|
|
419
|
+
]);
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
it('should not include iFrame syncs if the option is disabled', function () {
|
|
423
|
+
const serverResponse = [{
|
|
424
|
+
ext: {
|
|
425
|
+
pixels: [pixelSync1, pixelSync2],
|
|
426
|
+
iframes: [iFrameSync1, iFrameSync2],
|
|
427
|
+
}
|
|
428
|
+
}];
|
|
429
|
+
const result = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: true}, serverResponse);
|
|
430
|
+
expect(result).to.deep.equal([
|
|
431
|
+
pixelSync1,
|
|
432
|
+
pixelSync2,
|
|
433
|
+
]);
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
it('should not include pixel syncs if the option is disabled', function () {
|
|
437
|
+
const serverResponse = [{
|
|
438
|
+
ext: {
|
|
439
|
+
pixels: [pixelSync1, pixelSync2],
|
|
440
|
+
iframes: [iFrameSync1, iFrameSync2],
|
|
441
|
+
}
|
|
442
|
+
}];
|
|
443
|
+
const result = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: false}, serverResponse);
|
|
444
|
+
expect(result).to.deep.equal([
|
|
445
|
+
iFrameSync1,
|
|
446
|
+
iFrameSync2,
|
|
447
|
+
]);
|
|
448
|
+
});
|
|
449
|
+
|
|
450
|
+
it('should not include any syncs if the sync options are disabled or missing', function () {
|
|
451
|
+
const serverResponse = [{
|
|
452
|
+
ext: {
|
|
453
|
+
pixels: [pixelSync1, pixelSync2],
|
|
454
|
+
iframes: [iFrameSync1, iFrameSync2],
|
|
455
|
+
}
|
|
456
|
+
}];
|
|
457
|
+
const result = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: false}, serverResponse);
|
|
458
|
+
expect(result).to.deep.equal([]);
|
|
459
|
+
});
|
|
324
460
|
});
|
|
325
461
|
|
|
326
462
|
describe('event tracking calls', function () {
|
|
@@ -456,7 +592,7 @@ describe('FeedAdAdapter', function () {
|
|
|
456
592
|
prebid_bid_id: bidId,
|
|
457
593
|
prebid_transaction_id: transactionId,
|
|
458
594
|
referer,
|
|
459
|
-
sdk_version: '1.0.
|
|
595
|
+
sdk_version: '1.0.3'
|
|
460
596
|
};
|
|
461
597
|
subject(data);
|
|
462
598
|
expect(server.requests.length).to.equal(1);
|
|
@@ -73,6 +73,7 @@ describe('iasRtdProvider is a RTD provider that', function () {
|
|
|
73
73
|
request = server.requests[0];
|
|
74
74
|
request.respond(200, responseHeader, JSON.stringify(data));
|
|
75
75
|
expect(request.url).to.be.include(`https://pixel.adsafeprotected.com/services/pub?anId=1234`);
|
|
76
|
+
expect(request.url).to.be.include('url=https%253A%252F%252Fintegralads.com%252Ftest')
|
|
76
77
|
expect(adUnits).to.length(2);
|
|
77
78
|
expect(adUnits[0]).to.be.eq(adUnitsOriginal[0]);
|
|
78
79
|
const targetingKeys = Object.keys(iasTargeting);
|
|
@@ -136,7 +137,8 @@ const config = {
|
|
|
136
137
|
pubId: 1234,
|
|
137
138
|
keyMappings: {
|
|
138
139
|
'id': 'ias_id'
|
|
139
|
-
}
|
|
140
|
+
},
|
|
141
|
+
pageUrl: 'https://integralads.com/test'
|
|
140
142
|
}
|
|
141
143
|
};
|
|
142
144
|
|