prebid.js 7.4.0 → 7.5.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.
Files changed (142) hide show
  1. package/.circleci/config.yml +11 -6
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/adotBidAdapter.js +1 -1
  7. package/dist/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adxcgBidAdapter.js +1 -1
  9. package/dist/ajaBidAdapter.js +1 -1
  10. package/dist/amxBidAdapter.js +1 -1
  11. package/dist/amxIdSystem.js +1 -1
  12. package/dist/appierAnalyticsAdapter.js +1 -1
  13. package/dist/appnexusBidAdapter.js +1 -1
  14. package/dist/asoBidAdapter.js +1 -1
  15. package/dist/axonixBidAdapter.js +1 -1
  16. package/dist/bidglassBidAdapter.js +1 -1
  17. package/dist/big-richmediaBidAdapter.js +1 -1
  18. package/dist/bridgewellBidAdapter.js +1 -1
  19. package/dist/brightMountainMediaBidAdapter.js +1 -1
  20. package/dist/concertBidAdapter.js +1 -1
  21. package/dist/connectadBidAdapter.js +1 -1
  22. package/dist/consumableBidAdapter.js +1 -1
  23. package/dist/conversantBidAdapter.js +1 -1
  24. package/dist/craftBidAdapter.js +1 -1
  25. package/dist/criteoBidAdapter.js +1 -1
  26. package/dist/dspxBidAdapter.js +1 -1
  27. package/dist/eplanningBidAdapter.js +1 -1
  28. package/dist/finativeBidAdapter.js +1 -1
  29. package/dist/gdprEnforcement.js +1 -1
  30. package/dist/glimpseBidAdapter.js +1 -1
  31. package/dist/gmosspBidAdapter.js +1 -1
  32. package/dist/goldbachBidAdapter.js +1 -1
  33. package/dist/gridBidAdapter.js +1 -1
  34. package/dist/gridNMBidAdapter.js +1 -1
  35. package/dist/gumgumBidAdapter.js +1 -1
  36. package/dist/h12mediaBidAdapter.js +1 -1
  37. package/dist/hadronIdSystem.js +1 -1
  38. package/dist/hadronRtdProvider.js +1 -1
  39. package/dist/id5IdSystem.js +1 -1
  40. package/dist/improvedigitalBidAdapter.js +1 -1
  41. package/dist/inmarBidAdapter.js +1 -1
  42. package/dist/insticatorBidAdapter.js +1 -1
  43. package/dist/ixBidAdapter.js +1 -1
  44. package/dist/justpremiumBidAdapter.js +1 -1
  45. package/dist/kargoAnalyticsAdapter.js +1 -1
  46. package/dist/konduitAnalyticsAdapter.js +1 -1
  47. package/dist/kueezBidAdapter.js +1 -1
  48. package/dist/lassoBidAdapter.js +1 -1
  49. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  50. package/dist/logicadBidAdapter.js +1 -1
  51. package/dist/loglyliftBidAdapter.js +1 -1
  52. package/dist/malltvAnalyticsAdapter.js +1 -1
  53. package/dist/marsmediaBidAdapter.js +1 -1
  54. package/dist/mediafuseBidAdapter.js +1 -1
  55. package/dist/mediasquareBidAdapter.js +1 -1
  56. package/dist/mgidBidAdapter.js +1 -1
  57. package/dist/minutemediaBidAdapter.js +1 -1
  58. package/dist/not-for-prod/prebid.js +111 -111
  59. package/dist/oguryBidAdapter.js +1 -1
  60. package/dist/onetagBidAdapter.js +1 -1
  61. package/dist/ooloAnalyticsAdapter.js +1 -1
  62. package/dist/outbrainBidAdapter.js +1 -1
  63. package/dist/parrableIdSystem.js +1 -1
  64. package/dist/pixfutureBidAdapter.js +1 -1
  65. package/dist/prebid-core.js +1 -1
  66. package/dist/pubCommonId.js +1 -1
  67. package/dist/publinkIdSystem.js +1 -1
  68. package/dist/pubmaticBidAdapter.js +1 -1
  69. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  70. package/dist/pxyzBidAdapter.js +1 -1
  71. package/dist/quantcastBidAdapter.js +1 -1
  72. package/dist/readpeakBidAdapter.js +1 -1
  73. package/dist/relaidoBidAdapter.js +1 -1
  74. package/dist/rhythmoneBidAdapter.js +1 -1
  75. package/dist/riseBidAdapter.js +1 -1
  76. package/dist/rubiconAnalyticsAdapter.js +1 -1
  77. package/dist/rubiconBidAdapter.js +1 -1
  78. package/dist/seedingAllianceBidAdapter.js +1 -1
  79. package/dist/seedtagBidAdapter.js +1 -1
  80. package/dist/sharedIdSystem.js +1 -1
  81. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  82. package/dist/sharethroughBidAdapter.js +1 -1
  83. package/dist/shinezBidAdapter.js +1 -1
  84. package/dist/smaatoBidAdapter.js +1 -1
  85. package/dist/smartadserverBidAdapter.js +1 -1
  86. package/dist/smartxBidAdapter.js +1 -1
  87. package/dist/smilewantedBidAdapter.js +1 -1
  88. package/dist/sonobiBidAdapter.js +1 -1
  89. package/dist/sovrnAnalyticsAdapter.js +1 -1
  90. package/dist/sovrnBidAdapter.js +1 -1
  91. package/dist/sspBCBidAdapter.js +1 -1
  92. package/dist/sublimeBidAdapter.js +1 -1
  93. package/dist/synacormediaBidAdapter.js +1 -1
  94. package/dist/taboolaBidAdapter.js +1 -1
  95. package/dist/targetVideoBidAdapter.js +1 -1
  96. package/dist/teadsBidAdapter.js +1 -1
  97. package/dist/trionBidAdapter.js +1 -1
  98. package/dist/tripleliftBidAdapter.js +1 -1
  99. package/dist/ttdBidAdapter.js +1 -1
  100. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  101. package/dist/underdogmediaBidAdapter.js +1 -1
  102. package/dist/undertoneBidAdapter.js +1 -1
  103. package/dist/vidazooBidAdapter.js +1 -1
  104. package/dist/videobyteBidAdapter.js +1 -1
  105. package/dist/visxBidAdapter.js +1 -1
  106. package/dist/vuukleBidAdapter.js +1 -1
  107. package/dist/widespaceBidAdapter.js +1 -1
  108. package/dist/winrBidAdapter.js +1 -1
  109. package/dist/yahoosspBidAdapter.js +1 -1
  110. package/dist/yieldmoBidAdapter.js +1 -1
  111. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  112. package/karma.conf.maker.js +3 -1
  113. package/modules/adotBidAdapter.js +3 -3
  114. package/modules/appnexusBidAdapter.js +3 -3
  115. package/modules/criteoBidAdapter.js +7 -1
  116. package/modules/cwireBidAdapter.md +1 -1
  117. package/modules/gdprEnforcement.js +8 -14
  118. package/modules/hadronAnalyticsAdapter.md +5 -5
  119. package/modules/hadronIdSystem.js +18 -5
  120. package/modules/hadronIdSystem.md +15 -11
  121. package/modules/hadronRtdProvider.js +14 -1
  122. package/modules/hadronRtdProvider.md +17 -13
  123. package/modules/ixBidAdapter.js +69 -10
  124. package/modules/kargoAnalyticsAdapter.js +88 -6
  125. package/modules/kargoAnalyticsAdapter.md +33 -0
  126. package/modules/pubCommonId.js +1 -2
  127. package/modules/seedtagBidAdapter.js +33 -1
  128. package/modules/sharedIdSystem.js +11 -5
  129. package/modules/sharethroughBidAdapter.js +9 -24
  130. package/modules/taboolaBidAdapter.js +1 -1
  131. package/modules/taboolaBidAdapter.md +3 -3
  132. package/package.json +1 -1
  133. package/src/storageManager.js +4 -5
  134. package/test/spec/modules/appnexusBidAdapter_spec.js +165 -156
  135. package/test/spec/modules/criteoBidAdapter_spec.js +15 -5
  136. package/test/spec/modules/gdprEnforcement_spec.js +53 -100
  137. package/test/spec/modules/hadronIdSystem_spec.js +2 -2
  138. package/test/spec/modules/ixBidAdapter_spec.js +96 -5
  139. package/test/spec/modules/kargoAnalyticsAdapter_spec.js +42 -0
  140. package/test/spec/modules/seedtagBidAdapter_spec.js +4 -0
  141. package/test/spec/modules/sharethroughBidAdapter_spec.js +4 -4
  142. package/test/spec/modules/taboolaBidAdapter_spec.js +1 -1
@@ -2,6 +2,7 @@ import { expect } from 'chai';
2
2
  import {
3
3
  tryGetCriteoFastBid,
4
4
  spec,
5
+ storage,
5
6
  PROFILE_ID_PUBLISHERTAG,
6
7
  ADAPTER_VERSION,
7
8
  canFastBid, getFastBidUrl, FAST_BID_VERSION_CURRENT
@@ -11,6 +12,7 @@ import CONSTANTS from 'src/constants.json';
11
12
  import * as utils from 'src/utils.js';
12
13
  import { config } from '../../../src/config.js';
13
14
  import { NATIVE, VIDEO } from '../../../src/mediaTypes.js';
15
+ import * as storageManager from 'src/storageManager.js';
14
16
 
15
17
  describe('The Criteo bidding adapter', function () {
16
18
  let utilsMock, sandbox;
@@ -28,7 +30,7 @@ describe('The Criteo bidding adapter', function () {
28
30
  sandbox = sinon.sandbox.create();
29
31
  });
30
32
 
31
- afterEach(function() {
33
+ afterEach(function () {
32
34
  $$PREBID_GLOBAL$$.bidderSettings = {};
33
35
  global.Criteo = undefined;
34
36
  utilsMock.restore();
@@ -426,7 +428,15 @@ describe('The Criteo bidding adapter', function () {
426
428
  },
427
429
  };
428
430
 
431
+ let localStorageIsEnabledStub;
432
+
433
+ this.beforeEach(function () {
434
+ localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled');
435
+ localStorageIsEnabledStub.returns(true);
436
+ });
437
+
429
438
  afterEach(function () {
439
+ localStorageIsEnabledStub.restore();
430
440
  config.resetConfig();
431
441
  });
432
442
 
@@ -470,7 +480,7 @@ describe('The Criteo bidding adapter', function () {
470
480
  },
471
481
  ];
472
482
  const request = spec.buildRequests(bidRequests, bidderRequest);
473
- expect(request.url).to.match(/^https:\/\/bidder\.criteo\.com\/cdb\?profileId=207&av=\d+&wv=[^&]+&cb=\d+&im=1&debug=1&nolog=1/);
483
+ expect(request.url).to.match(/^https:\/\/bidder\.criteo\.com\/cdb\?profileId=207&av=\d+&wv=[^&]+&cb=\d+&lsavail=1&im=1&debug=1&nolog=1/);
474
484
  expect(request.method).to.equal('POST');
475
485
  const ortbRequest = request.data;
476
486
  expect(ortbRequest.publisher.url).to.equal(refererUrl);
@@ -934,7 +944,7 @@ describe('The Criteo bidding adapter', function () {
934
944
  },
935
945
  ];
936
946
 
937
- const request = spec.buildRequests(bidRequests, {...bidderRequest, ortb2: {}});
947
+ const request = spec.buildRequests(bidRequests, { ...bidderRequest, ortb2: {} });
938
948
  expect(request.data.publisher.ext).to.equal(undefined);
939
949
  expect(request.data.user.ext).to.equal(undefined);
940
950
  expect(request.data.slots[0].ext).to.equal(undefined);
@@ -961,7 +971,7 @@ describe('The Criteo bidding adapter', function () {
961
971
  },
962
972
  ];
963
973
 
964
- const request = spec.buildRequests(bidRequests, {...bidderRequest, ortb2: {}});
974
+ const request = spec.buildRequests(bidRequests, { ...bidderRequest, ortb2: {} });
965
975
  expect(request.data.slots[0].ext).to.deep.equal({
966
976
  bidfloor: 0.75,
967
977
  });
@@ -1015,7 +1025,7 @@ describe('The Criteo bidding adapter', function () {
1015
1025
  user: userData
1016
1026
  };
1017
1027
 
1018
- const request = spec.buildRequests(bidRequests, {...bidderRequest, ortb2});
1028
+ const request = spec.buildRequests(bidRequests, { ...bidderRequest, ortb2 });
1019
1029
  expect(request.data.publisher.ext).to.deep.equal({ data: { pageType: 'article' } });
1020
1030
  expect(request.data.user.ext).to.deep.equal({ data: { registered: true } });
1021
1031
  expect(request.data.slots[0].ext).to.deep.equal({
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  deviceAccessHook,
3
- enableAnalyticsHook,
4
- enforcementRules,
5
- getGvlid,
6
- internal,
3
+ setEnforcementConfig,
4
+ userSyncHook,
5
+ userIdHook,
7
6
  makeBidRequestsHook,
7
+ validateRules,
8
+ enforcementRules,
8
9
  purpose1Rule,
9
10
  purpose2Rule,
10
- setEnforcementConfig,
11
- userIdHook,
12
- userSyncHook,
13
- validateRules
11
+ enableAnalyticsHook,
12
+ getGvlid,
13
+ internal
14
14
  } from 'modules/gdprEnforcement.js';
15
- import {config} from 'src/config.js';
16
- import adapterManager, {gdprDataHandler} from 'src/adapterManager.js';
15
+ import { config } from 'src/config.js';
16
+ import adapterManager, { gdprDataHandler } from 'src/adapterManager.js';
17
17
  import * as utils from 'src/utils.js';
18
- import {validateStorageEnforcement} from 'src/storageManager.js';
18
+ import { validateStorageEnforcement } from 'src/storageManager.js';
19
19
  import * as events from 'src/events.js';
20
20
 
21
21
  describe('gdpr enforcement', function () {
@@ -98,9 +98,9 @@ describe('gdpr enforcement', function () {
98
98
  };
99
99
 
100
100
  after(function () {
101
- validateStorageEnforcement.getHooks({hook: deviceAccessHook}).remove();
101
+ validateStorageEnforcement.getHooks({ hook: deviceAccessHook }).remove();
102
102
  $$PREBID_GLOBAL$$.requestBids.getHooks().remove();
103
- adapterManager.makeBidRequests.getHooks({hook: makeBidRequestsHook}).remove();
103
+ adapterManager.makeBidRequests.getHooks({ hook: makeBidRequestsHook }).remove();
104
104
  })
105
105
 
106
106
  describe('deviceAccessHook', function () {
@@ -149,7 +149,7 @@ describe('gdpr enforcement', function () {
149
149
  hasEnforcementHook: true,
150
150
  valid: false
151
151
  }
152
- sinon.assert.calledWith(nextFnSpy, undefined, undefined, undefined, result);
152
+ sinon.assert.calledWith(nextFnSpy, undefined, undefined, result);
153
153
  });
154
154
 
155
155
  it('should only check for consent for vendor exceptions when enforcePurpose and enforceVendor are false', function () {
@@ -199,53 +199,6 @@ describe('gdpr enforcement', function () {
199
199
  expect(logWarnSpy.callCount).to.equal(1);
200
200
  });
201
201
 
202
- it('should allow device access when enforce vendor but module is vendorless ', function () {
203
- adapterManagerStub.withArgs('pubCommonId').returns(getBidderSpec(1));
204
- setEnforcementConfig({
205
- gdpr: {
206
- rules: [{
207
- purpose: 'storage',
208
- enforcePurpose: true,
209
- enforceVendor: true,
210
- }]
211
- }
212
- });
213
- let consentData = {}
214
- consentData.vendorData = staticConfig.consentData.getTCData;
215
- consentData.gdprApplies = true;
216
- consentData.apiVersion = 2;
217
- gdprDataHandlerStub.returns(consentData);
218
-
219
- deviceAccessHook(nextFnSpy, 1, 'pubCommonId', 'fpid-module');
220
- expect(logWarnSpy.callCount).to.equal(0);
221
- });
222
-
223
- it('should not allow device access if enforce vendor, module is vendorless, but there is no consent for purpose 1', function () {
224
- adapterManagerStub.withArgs('pubCommonId').returns(getBidderSpec(1));
225
- setEnforcementConfig({
226
- gdpr: {
227
- rules: [{
228
- purpose: 'storage',
229
- enforcePurpose: true,
230
- enforceVendor: true,
231
- }]
232
- }
233
- });
234
-
235
- let consentData = {}
236
- // set consent for purpose 1 to false
237
- const newConsentData = utils.deepClone(staticConfig);
238
- newConsentData.consentData.getTCData.purpose.consents['1'] = false;
239
- consentData.vendorData = newConsentData.consentData.getTCData;
240
- consentData.apiVersion = 2;
241
- consentData.gdprApplies = true;
242
-
243
- gdprDataHandlerStub.returns(consentData);
244
-
245
- deviceAccessHook(nextFnSpy, 1, 'pubCommonId', 'fpid-module');
246
- expect(logWarnSpy.callCount).to.equal(1);
247
- });
248
-
249
202
  it('should allow device access when gdprApplies is false and hasDeviceAccess flag is true', function () {
250
203
  adapterManagerStub.withArgs('appnexus').returns(getBidderSpec(1));
251
204
  setEnforcementConfig({
@@ -270,10 +223,10 @@ describe('gdpr enforcement', function () {
270
223
  hasEnforcementHook: true,
271
224
  valid: true
272
225
  }
273
- sinon.assert.calledWith(nextFnSpy, 1, 'appnexus', undefined, result);
226
+ sinon.assert.calledWith(nextFnSpy, 1, 'appnexus', result);
274
227
  });
275
228
 
276
- it('should use gvlMapping set by publisher', function () {
229
+ it('should use gvlMapping set by publisher', function() {
277
230
  config.setConfig({
278
231
  'gvlMapping': {
279
232
  'appnexus': 4
@@ -301,11 +254,11 @@ describe('gdpr enforcement', function () {
301
254
  hasEnforcementHook: true,
302
255
  valid: true
303
256
  }
304
- sinon.assert.calledWith(nextFnSpy, 4, 'appnexus', undefined, result);
257
+ sinon.assert.calledWith(nextFnSpy, 4, 'appnexus', result);
305
258
  config.resetConfig();
306
259
  });
307
260
 
308
- it('should use gvl id of alias and not of parent', function () {
261
+ it('should use gvl id of alias and not of parent', function() {
309
262
  let curBidderStub = sinon.stub(config, 'getCurrentBidder');
310
263
  curBidderStub.returns('appnexus-alias');
311
264
  adapterManager.aliasBidAdapter('appnexus', 'appnexus-alias');
@@ -336,7 +289,7 @@ describe('gdpr enforcement', function () {
336
289
  hasEnforcementHook: true,
337
290
  valid: true
338
291
  }
339
- sinon.assert.calledWith(nextFnSpy, 4, 'appnexus', undefined, result);
292
+ sinon.assert.calledWith(nextFnSpy, 4, 'appnexus', result);
340
293
  config.resetConfig();
341
294
  curBidderStub.restore();
342
295
  });
@@ -517,7 +470,7 @@ describe('gdpr enforcement', function () {
517
470
  const args = nextFnSpy.getCalls()[0].args;
518
471
  expect(args[1].hasValidated).to.be.true;
519
472
  expect(nextFnSpy.calledOnce).to.equal(true);
520
- sinon.assert.calledWith(nextFnSpy, submodules, {...consentData, hasValidated: true});
473
+ sinon.assert.calledWith(nextFnSpy, submodules, { ...consentData, hasValidated: true });
521
474
  });
522
475
 
523
476
  it('should allow userId module if gdpr not in scope', function () {
@@ -571,7 +524,7 @@ describe('gdpr enforcement', function () {
571
524
  name: 'sampleUserId'
572
525
  }
573
526
  }]
574
- sinon.assert.calledWith(nextFnSpy, expectedSubmodules, {...consentData, hasValidated: true});
527
+ sinon.assert.calledWith(nextFnSpy, expectedSubmodules, { ...consentData, hasValidated: true });
575
528
  });
576
529
  });
577
530
 
@@ -630,17 +583,17 @@ describe('gdpr enforcement', function () {
630
583
  gdprDataHandlerStub.returns(consentData);
631
584
  adapterManagerStub.withArgs('bidder_1').returns({
632
585
  getSpec: function () {
633
- return {'gvlid': 4}
586
+ return { 'gvlid': 4 }
634
587
  }
635
588
  });
636
589
  adapterManagerStub.withArgs('bidder_2').returns({
637
590
  getSpec: function () {
638
- return {'gvlid': 5}
591
+ return { 'gvlid': 5 }
639
592
  }
640
593
  });
641
594
  adapterManagerStub.withArgs('bidder_3').returns({
642
595
  getSpec: function () {
643
- return {'gvlid': undefined}
596
+ return { 'gvlid': undefined }
644
597
  }
645
598
  });
646
599
  makeBidRequestsHook(nextFnSpy, MOCK_AD_UNITS, []);
@@ -651,20 +604,20 @@ describe('gdpr enforcement', function () {
651
604
  code: 'ad-unit-1',
652
605
  mediaTypes: {},
653
606
  bids: [
654
- sinon.match({bidder: 'bidder_1'}),
655
- sinon.match({bidder: 'bidder_2'})
607
+ sinon.match({ bidder: 'bidder_1' }),
608
+ sinon.match({ bidder: 'bidder_2' })
656
609
  ]
657
610
  }, {
658
611
  code: 'ad-unit-2',
659
612
  mediaTypes: {},
660
613
  bids: [
661
- sinon.match({bidder: 'bidder_2'}),
662
- sinon.match({bidder: 'bidder_3'}) // should be allowed even though it's doesn't have a gvlId because liTransparency is established.
614
+ sinon.match({ bidder: 'bidder_2' }),
615
+ sinon.match({ bidder: 'bidder_3' }) // should be allowed even though it's doesn't have a gvlId because liTransparency is established.
663
616
  ]
664
617
  }], []);
665
618
  });
666
619
 
667
- it('should block bidder which does not have consent and allow bidder which has consent (liTransparency is NOT established)', function () {
620
+ it('should block bidder which does not have consent and allow bidder which has consent (liTransparency is NOT established)', function() {
668
621
  setEnforcementConfig({
669
622
  gdpr: {
670
623
  rules: [{
@@ -688,17 +641,17 @@ describe('gdpr enforcement', function () {
688
641
  gdprDataHandlerStub.returns(consentData);
689
642
  adapterManagerStub.withArgs('bidder_1').returns({
690
643
  getSpec: function () {
691
- return {'gvlid': 4}
644
+ return { 'gvlid': 4 }
692
645
  }
693
646
  });
694
647
  adapterManagerStub.withArgs('bidder_2').returns({
695
648
  getSpec: function () {
696
- return {'gvlid': 5}
649
+ return { 'gvlid': 5 }
697
650
  }
698
651
  });
699
652
  adapterManagerStub.withArgs('bidder_3').returns({
700
653
  getSpec: function () {
701
- return {'gvlid': undefined}
654
+ return { 'gvlid': undefined }
702
655
  }
703
656
  });
704
657
 
@@ -710,13 +663,13 @@ describe('gdpr enforcement', function () {
710
663
  code: 'ad-unit-1',
711
664
  mediaTypes: {},
712
665
  bids: [
713
- sinon.match({bidder: 'bidder_1'}), // 'bidder_2' is not present because it doesn't have vendorConsent
666
+ sinon.match({ bidder: 'bidder_1' }), // 'bidder_2' is not present because it doesn't have vendorConsent
714
667
  ]
715
668
  }, {
716
669
  code: 'ad-unit-2',
717
670
  mediaTypes: {},
718
671
  bids: [
719
- sinon.match({bidder: 'bidder_3'}), // 'bidder_3' is allowed despite gvlId being undefined because it's part of vendorExceptions
672
+ sinon.match({ bidder: 'bidder_3' }), // 'bidder_3' is allowed despite gvlId being undefined because it's part of vendorExceptions
720
673
  ]
721
674
  }], []);
722
675
 
@@ -774,12 +727,12 @@ describe('gdpr enforcement', function () {
774
727
  nextFnSpy = sandbox.spy();
775
728
  });
776
729
 
777
- afterEach(function () {
730
+ afterEach(function() {
778
731
  config.resetConfig();
779
732
  sandbox.restore();
780
733
  });
781
734
 
782
- it('should block analytics adapter which does not have consent and allow the one(s) which have consent', function () {
735
+ it('should block analytics adapter which does not have consent and allow the one(s) which have consent', function() {
783
736
  setEnforcementConfig({
784
737
  gdpr: {
785
738
  rules: [{
@@ -797,9 +750,9 @@ describe('gdpr enforcement', function () {
797
750
  consentData.gdprApplies = true;
798
751
 
799
752
  gdprDataHandlerStub.returns(consentData);
800
- adapterManagerStub.withArgs('analyticsAdapter_A').returns({gvlid: 3});
801
- adapterManagerStub.withArgs('analyticsAdapter_B').returns({gvlid: 5});
802
- adapterManagerStub.withArgs('analyticsAdapter_C').returns({gvlid: 1});
753
+ adapterManagerStub.withArgs('analyticsAdapter_A').returns({ gvlid: 3 });
754
+ adapterManagerStub.withArgs('analyticsAdapter_B').returns({ gvlid: 5 });
755
+ adapterManagerStub.withArgs('analyticsAdapter_C').returns({ gvlid: 1 });
803
756
 
804
757
  enableAnalyticsHook(nextFnSpy, MOCK_ANALYTICS_ADAPTER_CONFIG);
805
758
 
@@ -1072,7 +1025,7 @@ describe('gdpr enforcement', function () {
1072
1025
  expect(purpose2Rule).to.deep.equal(purpose2RuleDefinedInConfig);
1073
1026
  });
1074
1027
 
1075
- it('should use the "rules" defined in config if a definition found', function () {
1028
+ it('should use the "rules" defined in config if a definition found', function() {
1076
1029
  const rules = [{
1077
1030
  purpose: 'storage',
1078
1031
  enforcePurpose: false,
@@ -1082,23 +1035,23 @@ describe('gdpr enforcement', function () {
1082
1035
  enforcePurpose: false,
1083
1036
  enforceVendor: false
1084
1037
  }]
1085
- setEnforcementConfig({gdpr: {rules}});
1038
+ setEnforcementConfig({gdpr: { rules }});
1086
1039
 
1087
1040
  expect(enforcementRules).to.deep.equal(rules);
1088
1041
  });
1089
1042
  });
1090
1043
 
1091
- describe('TCF2FinalResults', function () {
1044
+ describe('TCF2FinalResults', function() {
1092
1045
  let sandbox;
1093
- beforeEach(function () {
1046
+ beforeEach(function() {
1094
1047
  sandbox = sinon.createSandbox();
1095
1048
  sandbox.spy(events, 'emit');
1096
1049
  });
1097
- afterEach(function () {
1050
+ afterEach(function() {
1098
1051
  config.resetConfig();
1099
1052
  sandbox.restore();
1100
1053
  });
1101
- it('should emit TCF2 enforcement data on auction end', function () {
1054
+ it('should emit TCF2 enforcement data on auction end', function() {
1102
1055
  const rules = [{
1103
1056
  purpose: 'storage',
1104
1057
  enforcePurpose: false,
@@ -1108,7 +1061,7 @@ describe('gdpr enforcement', function () {
1108
1061
  enforcePurpose: false,
1109
1062
  enforceVendor: false
1110
1063
  }]
1111
- setEnforcementConfig({gdpr: {rules}});
1064
+ setEnforcementConfig({gdpr: { rules }});
1112
1065
 
1113
1066
  events.emit('auctionEnd', {})
1114
1067
 
@@ -1117,28 +1070,28 @@ describe('gdpr enforcement', function () {
1117
1070
  })
1118
1071
  });
1119
1072
 
1120
- describe('getGvlid', function () {
1073
+ describe('getGvlid', function() {
1121
1074
  let sandbox;
1122
1075
  let getGvlidForBidAdapterStub;
1123
1076
  let getGvlidForUserIdModuleStub;
1124
1077
  let getGvlidForAnalyticsAdapterStub;
1125
- beforeEach(function () {
1078
+ beforeEach(function() {
1126
1079
  sandbox = sinon.createSandbox();
1127
1080
  getGvlidForBidAdapterStub = sandbox.stub(internal, 'getGvlidForBidAdapter');
1128
1081
  getGvlidForUserIdModuleStub = sandbox.stub(internal, 'getGvlidForUserIdModule');
1129
1082
  getGvlidForAnalyticsAdapterStub = sandbox.stub(internal, 'getGvlidForAnalyticsAdapter');
1130
1083
  });
1131
- afterEach(function () {
1084
+ afterEach(function() {
1132
1085
  sandbox.restore();
1133
1086
  config.resetConfig();
1134
1087
  });
1135
1088
 
1136
- it('should return "null" if called without passing any argument', function () {
1089
+ it('should return "null" if called without passing any argument', function() {
1137
1090
  const gvlid = getGvlid();
1138
1091
  expect(gvlid).to.equal(null);
1139
1092
  });
1140
1093
 
1141
- it('should return "null" if GVL ID is not defined for any of these modules: Bid adapter, UserId submodule and Analytics adapter', function () {
1094
+ it('should return "null" if GVL ID is not defined for any of these modules: Bid adapter, UserId submodule and Analytics adapter', function() {
1142
1095
  getGvlidForBidAdapterStub.withArgs('moduleA').returns(null);
1143
1096
  getGvlidForUserIdModuleStub.withArgs('moduleA').returns(null);
1144
1097
  getGvlidForAnalyticsAdapterStub.withArgs('moduleA').returns(null);
@@ -1147,7 +1100,7 @@ describe('gdpr enforcement', function () {
1147
1100
  expect(gvlid).to.equal(null);
1148
1101
  });
1149
1102
 
1150
- it('should return the GVL ID from gvlMapping if it is defined in setConfig', function () {
1103
+ it('should return the GVL ID from gvlMapping if it is defined in setConfig', function() {
1151
1104
  config.setConfig({
1152
1105
  gvlMapping: {
1153
1106
  moduleA: 1
@@ -1161,7 +1114,7 @@ describe('gdpr enforcement', function () {
1161
1114
  expect(gvlid).to.equal(1);
1162
1115
  });
1163
1116
 
1164
- it('should return the GVL ID by calling getGvlidForBidAdapter -> getGvlidForUserIdModule -> getGvlidForAnalyticsAdapter in sequence', function () {
1117
+ it('should return the GVL ID by calling getGvlidForBidAdapter -> getGvlidForUserIdModule -> getGvlidForAnalyticsAdapter in sequence', function() {
1165
1118
  getGvlidForBidAdapterStub.withArgs('moduleA').returns(null);
1166
1119
  getGvlidForUserIdModuleStub.withArgs('moduleA').returns(null);
1167
1120
  getGvlidForAnalyticsAdapterStub.withArgs('moduleA').returns(7);
@@ -22,7 +22,7 @@ describe('HadronIdSystem', function () {
22
22
  const callback = hadronIdSubmodule.getId(config).callback;
23
23
  callback(callbackSpy);
24
24
  const request = server.requests[0];
25
- expect(request.url).to.eq(`https://id.hadron.ad.gt/api/v1/pbhid`);
25
+ expect(request.url).to.eq(`https://id.hadron.ad.gt/api/v1/pbhid?partner_id=0&_it=prebid`);
26
26
  request.respond(200, { 'Content-Type': 'application/json' }, JSON.stringify({ hadronId: 'testHadronId1' }));
27
27
  expect(callbackSpy.lastCall.lastArg).to.deep.equal({hadronId: 'testHadronId1'});
28
28
  });
@@ -49,7 +49,7 @@ describe('HadronIdSystem', function () {
49
49
  const callback = hadronIdSubmodule.getId(config).callback;
50
50
  callback(callbackSpy);
51
51
  const request = server.requests[0];
52
- expect(request.url).to.eq('https://hadronid.publync.com');
52
+ expect(request.url).to.eq('https://hadronid.publync.com?partner_id=0&_it=prebid');
53
53
  request.respond(200, { 'Content-Type': 'application/json' }, JSON.stringify({ hadronId: 'testHadronId1' }));
54
54
  expect(callbackSpy.lastCall.lastArg).to.deep.equal({hadronId: 'testHadronId1'});
55
55
  });
@@ -677,18 +677,109 @@ describe('IndexexchangeAdapter', function () {
677
677
  const syncOptions = {
678
678
  'iframeEnabled': true
679
679
  }
680
- let userSync = spec.getUserSyncs(syncOptions);
680
+ let userSync = spec.getUserSyncs(syncOptions, []);
681
681
  expect(userSync[0].type).to.equal('iframe');
682
682
  const USER_SYNC_URL = 'https://js-sec.indexww.com/um/ixmatch.html';
683
683
  expect(userSync[0].url).to.equal(USER_SYNC_URL);
684
684
  });
685
685
 
686
- it('When iframeEnabled is false, no userSync should be returned', function () {
686
+ it('When iframeEnabled = false, default to img', function () {
687
687
  const syncOptions = {
688
- 'iframeEnabled': false
688
+ 'iframeEnabled': false,
689
689
  }
690
- let userSync = spec.getUserSyncs(syncOptions);
691
- expect(userSync).to.be.an('array').that.is.empty;
690
+ let userSync = spec.getUserSyncs(syncOptions, []);
691
+ expect(userSync[0].type).to.equal('image');
692
+ const USER_SYNC_URL = 'https://dsum.casalemedia.com/pbusermatch?origin=prebid&site_id=123&p=1&i=0&gdpr=1&gdpr_consent=3huaa11=qu3198ae&us_privacy=';
693
+ expect(userSync[0].url).to.equal(USER_SYNC_URL);
694
+ });
695
+
696
+ it('UserSync test : check type = pixel, check usermatch URL, no exchange data, only drop 1', function () {
697
+ const syncOptions = {
698
+ 'pixelEnabled': true
699
+ }
700
+ config.setConfig({
701
+ userSync: {
702
+ pixelEnabled: true,
703
+ syncsPerBidder: 3
704
+ }
705
+ })
706
+ let userSync = spec.getUserSyncs(syncOptions, []);
707
+ expect(userSync[0].type).to.equal('image');
708
+ const USER_SYNC_URL = 'https://dsum.casalemedia.com/pbusermatch?origin=prebid&site_id=123&p=1&i=0&gdpr=1&gdpr_consent=3huaa11=qu3198ae&us_privacy=';
709
+ expect(userSync[0].url).to.equal(USER_SYNC_URL);
710
+ });
711
+
712
+ it('UserSync test : check type = pixel, check usermatch URL with override set to 0', function () {
713
+ const syncOptions = {
714
+ 'pixelEnabled': true
715
+ }
716
+ config.setConfig({
717
+ userSync: {
718
+ pixelEnabled: true,
719
+ syncsPerBidder: 3
720
+ }
721
+ });
722
+ let userSync = spec.getUserSyncs(syncOptions, [{'body': {'ext': {'publishersyncsperbidderoverride': 0}}}]);
723
+ expect(userSync.length).to.equal(0);
724
+ });
725
+
726
+ it('UserSync test : check type = pixel, check usermatch URL with override set', function () {
727
+ const syncOptions = {
728
+ 'pixelEnabled': true
729
+ }
730
+ config.setConfig({
731
+ userSync: {
732
+ pixelEnabled: true,
733
+ syncsPerBidder: 3
734
+ }
735
+ });
736
+ let userSync = spec.getUserSyncs(syncOptions, [{'body': {'ext': {'publishersyncsperbidderoverride': 2}}}]);
737
+ expect(userSync[0].type).to.equal('image');
738
+ const USER_SYNC_URL_0 = 'https://dsum.casalemedia.com/pbusermatch?origin=prebid&site_id=123&p=2&i=0&gdpr=1&gdpr_consent=3huaa11=qu3198ae&us_privacy=';
739
+ const USER_SYNC_URL_1 = 'https://dsum.casalemedia.com/pbusermatch?origin=prebid&site_id=123&p=2&i=1&gdpr=1&gdpr_consent=3huaa11=qu3198ae&us_privacy=';
740
+ expect(userSync[0].url).to.equal(USER_SYNC_URL_0);
741
+ expect(userSync[1].url).to.equal(USER_SYNC_URL_1);
742
+ expect(userSync.length).to.equal(2);
743
+ });
744
+
745
+ it('UserSync test : check type = pixel, check usermatch URL with override greater than publisher syncs per bidder , use syncsperbidder', function () {
746
+ const syncOptions = {
747
+ 'pixelEnabled': true
748
+ }
749
+ config.setConfig({
750
+ userSync: {
751
+ pixelEnabled: true,
752
+ syncsPerBidder: 3
753
+ }
754
+ });
755
+ let userSync = spec.getUserSyncs(syncOptions, [{'body': {'ext': {'publishersyncsperbidderoverride': 4}}}]);
756
+ expect(userSync[0].type).to.equal('image');
757
+ const USER_SYNC_URL_0 = 'https://dsum.casalemedia.com/pbusermatch?origin=prebid&site_id=123&p=3&i=0&gdpr=1&gdpr_consent=3huaa11=qu3198ae&us_privacy=';
758
+ const USER_SYNC_URL_1 = 'https://dsum.casalemedia.com/pbusermatch?origin=prebid&site_id=123&p=3&i=1&gdpr=1&gdpr_consent=3huaa11=qu3198ae&us_privacy=';
759
+ const USER_SYNC_URL_2 = 'https://dsum.casalemedia.com/pbusermatch?origin=prebid&site_id=123&p=3&i=2&gdpr=1&gdpr_consent=3huaa11=qu3198ae&us_privacy=';
760
+ expect(userSync[0].url).to.equal(USER_SYNC_URL_0);
761
+ expect(userSync[1].url).to.equal(USER_SYNC_URL_1);
762
+ expect(userSync[2].url).to.equal(USER_SYNC_URL_2);
763
+ expect(userSync.length).to.equal(3);
764
+ });
765
+
766
+ it('UserSync test : check type = pixel, syncsPerBidder = 0, still use override', function () {
767
+ const syncOptions = {
768
+ 'pixelEnabled': true
769
+ }
770
+ config.setConfig({
771
+ userSync: {
772
+ pixelEnabled: true,
773
+ syncsPerBidder: 0
774
+ }
775
+ });
776
+ let userSync = spec.getUserSyncs(syncOptions, [{'body': {'ext': {'publishersyncsperbidderoverride': 2}}}]);
777
+ expect(userSync[0].type).to.equal('image');
778
+ const USER_SYNC_URL_0 = 'https://dsum.casalemedia.com/pbusermatch?origin=prebid&site_id=123&p=2&i=0&gdpr=1&gdpr_consent=3huaa11=qu3198ae&us_privacy=';
779
+ const USER_SYNC_URL_1 = 'https://dsum.casalemedia.com/pbusermatch?origin=prebid&site_id=123&p=2&i=1&gdpr=1&gdpr_consent=3huaa11=qu3198ae&us_privacy=';
780
+ expect(userSync[0].url).to.equal(USER_SYNC_URL_0);
781
+ expect(userSync[1].url).to.equal(USER_SYNC_URL_1);
782
+ expect(userSync.length).to.equal(2);
692
783
  });
693
784
  });
694
785
 
@@ -0,0 +1,42 @@
1
+ import kargoAnalyticsAdapter from 'modules/kargoAnalyticsAdapter.js';
2
+ import { expect } from 'chai';
3
+ import { server } from 'test/mocks/xhr.js';
4
+ let events = require('src/events');
5
+ let constants = require('src/constants.json');
6
+
7
+ describe('Kargo Analytics Adapter', function () {
8
+ const adapterConfig = {
9
+ provider: 'kargoAnalytics',
10
+ };
11
+
12
+ after(function () {
13
+ kargoAnalyticsAdapter.disableAnalytics();
14
+ });
15
+
16
+ describe('main test flow', function () {
17
+ beforeEach(function () {
18
+ kargoAnalyticsAdapter.enableAnalytics(adapterConfig);
19
+ sinon.stub(events, 'getEvents').returns([]);
20
+ });
21
+
22
+ afterEach(function () {
23
+ events.getEvents.restore();
24
+ });
25
+
26
+ it('bid response data should send one request with auction ID, auction timeout, and response time', function() {
27
+ const bidResponse = {
28
+ bidder: 'kargo',
29
+ auctionId: '66529d4c-8998-47c2-ab3e-5b953490b98f',
30
+ timeToRespond: 192,
31
+ };
32
+
33
+ events.emit(constants.EVENTS.AUCTION_INIT, {
34
+ timeout: 1000
35
+ });
36
+ events.emit(constants.EVENTS.BID_RESPONSE, bidResponse);
37
+
38
+ expect(server.requests.length).to.equal(1);
39
+ expect(server.requests[0].url).to.equal('https://krk.kargo.com/api/v1/event/auction-data?aid=66529d4c-8998-47c2-ab3e-5b953490b98f&ato=1000&rt=192&it=0');
40
+ });
41
+ });
42
+ });
@@ -223,6 +223,7 @@ describe('Seedtag Adapter', function () {
223
223
  });
224
224
 
225
225
  it('Common data request should be correct', function () {
226
+ const now = Date.now();
226
227
  const request = spec.buildRequests(validBidRequests, bidderRequest);
227
228
  const data = JSON.parse(request.data);
228
229
  expect(data.url).to.equal('referer');
@@ -231,6 +232,9 @@ describe('Seedtag Adapter', function () {
231
232
  expect(
232
233
  ['fixed', 'mobile', 'unknown'].indexOf(data.connectionType)
233
234
  ).to.be.above(-1);
235
+ expect(data.auctionStart).to.be.greaterThanOrEqual(now);
236
+ expect(data.ttfb).to.be.greaterThanOrEqual(0);
237
+
234
238
  expect(data.bidRequests[0].adUnitCode).to.equal('adunit-code');
235
239
  });
236
240
 
@@ -601,11 +601,11 @@ describe('sharethrough adapter spec', function () {
601
601
  const serverResponses = [{ body: { cookieSyncUrls: cookieSyncs } }];
602
602
 
603
603
  it('returns an array of correctly formatted user syncs', function () {
604
- const syncArray = spec.getUserSyncs({ pixelEnabled: true }, serverResponses, null, 'fake-privacy-signal');
604
+ const syncArray = spec.getUserSyncs({ pixelEnabled: true }, serverResponses);
605
605
  expect(syncArray).to.deep.equal([
606
- { type: 'image', url: 'cookieUrl1&us_privacy=fake-privacy-signal' },
607
- { type: 'image', url: 'cookieUrl2&us_privacy=fake-privacy-signal' },
608
- { type: 'image', url: 'cookieUrl3&us_privacy=fake-privacy-signal' }],
606
+ { type: 'image', url: 'cookieUrl1' },
607
+ { type: 'image', url: 'cookieUrl2' },
608
+ { type: 'image', url: 'cookieUrl3' }],
609
609
  );
610
610
  });
611
611
 
@@ -370,7 +370,7 @@ describe('Taboola Adapter', function () {
370
370
  requestId: request.bids[0].bidId,
371
371
  cpm: bid.price,
372
372
  creativeId: bid.crid,
373
- ttl: 360,
373
+ ttl: 60,
374
374
  netRevenue: false,
375
375
  currency: serverResponse.body.cur,
376
376
  mediaType: 'banner',