prebid.js 7.51.0 → 7.52.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/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adriverIdSystem.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/allowActivities.js +1 -0
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.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/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectIdSystem.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dependencies.json +6 -0
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/gdprEnforcement.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/growthCodeRtdProvider.js +1 -0
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5IdSystem.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/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/kulturemediaBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +136 -132
- package/dist/objectGuard.js +1 -0
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/oxxionAnalyticsAdapter.js +1 -0
- package/dist/pairIdSystem.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.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/retailspotBidAdapter.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/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/sspBCBidAdapter.js +1 -1
- package/dist/stvBidAdapter.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/uid2IdSystem.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/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspBidAdapter.js +1 -1
- package/integrationExamples/gpt/growthcode.html +20 -9
- package/libraries/objectGuard/objectGuard.js +108 -0
- package/libraries/objectGuard/ortbGuard.js +88 -0
- package/modules/adgenerationBidAdapter.js +14 -5
- package/modules/adriverIdSystem.js +1 -1
- package/modules/allowActivities.js +74 -0
- package/modules/connectIdSystem.js +89 -13
- package/modules/connectIdSystem.md +4 -7
- package/modules/criteoBidAdapter.js +9 -0
- package/modules/gdprEnforcement.js +98 -169
- package/modules/growthCodeRtdProvider.js +131 -0
- package/modules/growthCodeRtdProvider.md +55 -0
- package/modules/ixBidAdapter.js +5 -2
- package/modules/oxxionAnalyticsAdapter.js +212 -0
- package/modules/oxxionAnalyticsAdapter.md +33 -0
- package/modules/pairIdSystem.js +6 -6
- package/modules/rtdModule/index.js +12 -1
- package/modules/sharethroughBidAdapter.js +2 -2
- package/modules/smartadserverBidAdapter.js +5 -0
- package/modules/stvBidAdapter.js +34 -1
- package/modules/undertoneBidAdapter.js +9 -1
- package/modules/userId/index.js +69 -41
- package/modules/yahoosspBidAdapter.js +45 -3
- package/modules/yahoosspBidAdapter.md +1 -1
- package/modules/zeta_global_sspBidAdapter.js +1 -0
- package/package.json +1 -1
- package/src/activities/activities.js +47 -0
- package/src/activities/activityParams.js +8 -0
- package/src/activities/modules.js +1 -1
- package/src/activities/params.js +59 -0
- package/src/activities/redactor.js +157 -0
- package/src/activities/rules.js +95 -0
- package/src/adapterManager.js +45 -8
- package/src/fpd/rootDomain.js +1 -1
- package/src/prebid.js +1 -1
- package/src/storageManager.js +57 -44
- package/src/userSync.js +35 -18
- package/test/spec/activities/allowActivites_spec.js +138 -0
- package/test/spec/activities/objectGuard_spec.js +144 -0
- package/test/spec/activities/ortbGuard_spec.js +140 -0
- package/test/spec/activities/params_spec.js +25 -0
- package/test/spec/activities/redactor_spec.js +296 -0
- package/test/spec/activities/rules_spec.js +135 -0
- package/test/spec/modules/adgenerationBidAdapter_spec.js +52 -12
- package/test/spec/modules/connectIdSystem_spec.js +291 -23
- package/test/spec/modules/criteoBidAdapter_spec.js +84 -0
- package/test/spec/modules/gdprEnforcement_spec.js +127 -414
- package/test/spec/modules/growthCodeRtdProvider_spec.js +127 -0
- package/test/spec/modules/ixBidAdapter_spec.js +2 -1
- package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +324 -0
- package/test/spec/modules/pairIdSystem_spec.js +16 -3
- package/test/spec/modules/realTimeDataModule_spec.js +1 -1
- package/test/spec/modules/sharethroughBidAdapter_spec.js +1 -1
- package/test/spec/modules/smartadserverBidAdapter_spec.js +42 -0
- package/test/spec/modules/stvBidAdapter_spec.js +13 -1
- package/test/spec/modules/undertoneBidAdapter_spec.js +57 -1
- package/test/spec/modules/userId_spec.js +80 -21
- package/test/spec/modules/yahoosspBidAdapter_spec.js +103 -51
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +4 -0
- package/test/spec/unit/core/adapterManager_spec.js +181 -1
- package/test/spec/unit/core/storageManager_spec.js +76 -68
- package/test/spec/unit/pbjs_api_spec.js +15 -25
- package/test/spec/userSync_spec.js +45 -16
|
@@ -41,7 +41,9 @@ const videoBidReq = [{
|
|
|
41
41
|
},
|
|
42
42
|
mediaTypes: {video: {
|
|
43
43
|
context: 'outstream',
|
|
44
|
-
playerSize: [640, 480]
|
|
44
|
+
playerSize: [640, 480],
|
|
45
|
+
placement: 1,
|
|
46
|
+
plcmt: 1
|
|
45
47
|
}},
|
|
46
48
|
sizes: [[300, 250], [300, 600]],
|
|
47
49
|
bidId: '263be71e91dd9d',
|
|
@@ -184,6 +186,31 @@ const bidderReqCcpaAndGdpr = {
|
|
|
184
186
|
uspConsent: 'NY12'
|
|
185
187
|
};
|
|
186
188
|
|
|
189
|
+
const bidderReqGpp = {
|
|
190
|
+
refererInfo: {
|
|
191
|
+
topmostLocation: 'http://prebid.org/dev-docs/bidder-adaptor.html'
|
|
192
|
+
},
|
|
193
|
+
gppConsent: {
|
|
194
|
+
gppString: 'DBACNYA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA~1YNN',
|
|
195
|
+
applicableSections: [7]
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const bidderReqFullGppCcpaGdpr = {
|
|
200
|
+
refererInfo: {
|
|
201
|
+
topmostLocation: 'http://prebid.org/dev-docs/bidder-adaptor.html'
|
|
202
|
+
},
|
|
203
|
+
gppConsent: {
|
|
204
|
+
gppString: 'DBACNYA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA~1YNN',
|
|
205
|
+
applicableSections: [7]
|
|
206
|
+
},
|
|
207
|
+
gdprConsent: {
|
|
208
|
+
gdprApplies: true,
|
|
209
|
+
consentString: 'gdprConsent'
|
|
210
|
+
},
|
|
211
|
+
uspConsent: '1YNN'
|
|
212
|
+
};
|
|
213
|
+
|
|
187
214
|
const validBidRes = {
|
|
188
215
|
ad: '<div>Hello</div>',
|
|
189
216
|
publisherId: 12345,
|
|
@@ -381,6 +408,31 @@ describe('Undertone Adapter', () => {
|
|
|
381
408
|
expect(request.url).to.equal(REQ_URL);
|
|
382
409
|
expect(request.method).to.equal('POST');
|
|
383
410
|
});
|
|
411
|
+
it(`should have gppConsent fields`, function () {
|
|
412
|
+
const request = spec.buildRequests(bidReq, bidderReqGpp);
|
|
413
|
+
const domainStart = bidderReq.refererInfo.topmostLocation.indexOf('//');
|
|
414
|
+
const domainEnd = bidderReq.refererInfo.topmostLocation.indexOf('/', domainStart + 2);
|
|
415
|
+
const domain = bidderReq.refererInfo.topmostLocation.substring(domainStart + 2, domainEnd);
|
|
416
|
+
const gppStr = bidderReqGpp.gppConsent.gppString;
|
|
417
|
+
const gppSid = bidderReqGpp.gppConsent.applicableSections;
|
|
418
|
+
const REQ_URL = `${URL}?pid=${bidReq[0].params.publisherId}&domain=${domain}&gpp=${gppStr}&gpp_sid=${gppSid}`;
|
|
419
|
+
expect(request.url).to.equal(REQ_URL);
|
|
420
|
+
expect(request.method).to.equal('POST');
|
|
421
|
+
});
|
|
422
|
+
it(`should have gpp, ccpa and gdpr fields`, function () {
|
|
423
|
+
const request = spec.buildRequests(bidReq, bidderReqFullGppCcpaGdpr);
|
|
424
|
+
const domainStart = bidderReq.refererInfo.topmostLocation.indexOf('//');
|
|
425
|
+
const domainEnd = bidderReq.refererInfo.topmostLocation.indexOf('/', domainStart + 2);
|
|
426
|
+
const domain = bidderReq.refererInfo.topmostLocation.substring(domainStart + 2, domainEnd);
|
|
427
|
+
const gppStr = bidderReqFullGppCcpaGdpr.gppConsent.gppString;
|
|
428
|
+
const gppSid = bidderReqFullGppCcpaGdpr.gppConsent.applicableSections;
|
|
429
|
+
const ccpa = bidderReqFullGppCcpaGdpr.uspConsent;
|
|
430
|
+
const gdpr = bidderReqFullGppCcpaGdpr.gdprConsent.gdprApplies ? 1 : 0;
|
|
431
|
+
const gdprStr = bidderReqFullGppCcpaGdpr.gdprConsent.consentString;
|
|
432
|
+
const REQ_URL = `${URL}?pid=${bidReq[0].params.publisherId}&domain=${domain}&gdpr=${gdpr}&gdprstr=${gdprStr}&ccpa=${ccpa}&gpp=${gppStr}&gpp_sid=${gppSid}`;
|
|
433
|
+
expect(request.url).to.equal(REQ_URL);
|
|
434
|
+
expect(request.method).to.equal('POST');
|
|
435
|
+
});
|
|
384
436
|
it('should have all relevant fields', function () {
|
|
385
437
|
const request = spec.buildRequests(bidReq, bidderReq);
|
|
386
438
|
const bid1 = JSON.parse(request.data)['x-ut-hb-params'][0];
|
|
@@ -409,10 +461,14 @@ describe('Undertone Adapter', () => {
|
|
|
409
461
|
expect(bidVideo.video.playbackMethod).to.equal(2);
|
|
410
462
|
expect(bidVideo.video.maxDuration).to.equal(30);
|
|
411
463
|
expect(bidVideo.video.skippable).to.equal(true);
|
|
464
|
+
expect(bidVideo.video.placement).to.equal(1);
|
|
465
|
+
expect(bidVideo.video.plcmt).to.equal(1);
|
|
412
466
|
|
|
413
467
|
expect(bidVideo2.video.skippable).to.equal(null);
|
|
414
468
|
expect(bidVideo2.video.maxDuration).to.equal(null);
|
|
415
469
|
expect(bidVideo2.video.playbackMethod).to.equal(null);
|
|
470
|
+
expect(bidVideo2.video.placement).to.equal(null);
|
|
471
|
+
expect(bidVideo2.video.plcmt).to.equal(null);
|
|
416
472
|
});
|
|
417
473
|
it('should send all userIds data to server', function () {
|
|
418
474
|
const request = spec.buildRequests(bidReqUserIds, bidderReq);
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attachIdSystem,
|
|
3
3
|
auctionDelay,
|
|
4
|
-
coreStorage,
|
|
4
|
+
coreStorage, dep,
|
|
5
|
+
findRootDomain,
|
|
5
6
|
init,
|
|
7
|
+
PBJS_USER_ID_OPTOUT_NAME,
|
|
6
8
|
requestBidsHook,
|
|
9
|
+
requestDataDeletion,
|
|
7
10
|
setStoredConsentData,
|
|
8
11
|
setStoredValue,
|
|
9
12
|
setSubmoduleRegistry,
|
|
10
13
|
syncDelay,
|
|
11
|
-
PBJS_USER_ID_OPTOUT_NAME,
|
|
12
|
-
findRootDomain, requestDataDeletion,
|
|
13
14
|
} from 'modules/userId/index.js';
|
|
14
15
|
import {createEidsArray} from 'modules/userId/eids.js';
|
|
15
16
|
import {config} from 'src/config.js';
|
|
16
17
|
import * as utils from 'src/utils.js';
|
|
18
|
+
import {getPrebidInternal} from 'src/utils.js';
|
|
17
19
|
import * as events from 'src/events.js';
|
|
18
20
|
import CONSTANTS from 'src/constants.json';
|
|
19
21
|
import {getGlobal} from 'src/prebidGlobal.js';
|
|
20
|
-
import {
|
|
21
|
-
resetConsentData,
|
|
22
|
-
} from 'modules/consentManagement.js';
|
|
22
|
+
import {resetConsentData, } from 'modules/consentManagement.js';
|
|
23
23
|
import {server} from 'test/mocks/xhr.js';
|
|
24
24
|
import {find} from 'src/polyfill.js';
|
|
25
25
|
import {unifiedIdSubmodule} from 'modules/unifiedIdSystem.js';
|
|
@@ -27,7 +27,10 @@ import {britepoolIdSubmodule} from 'modules/britepoolIdSystem.js';
|
|
|
27
27
|
import {id5IdSubmodule} from 'modules/id5IdSystem.js';
|
|
28
28
|
import {identityLinkSubmodule} from 'modules/identityLinkIdSystem.js';
|
|
29
29
|
import {dmdIdSubmodule} from 'modules/dmdIdSystem.js';
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
liveIntentIdSubmodule,
|
|
32
|
+
setEventFiredFlag as liveIntentIdSubmoduleDoNotFireEvent
|
|
33
|
+
} from 'modules/liveIntentIdSystem.js';
|
|
31
34
|
import {merkleIdSubmodule} from 'modules/merkleIdSystem.js';
|
|
32
35
|
import {netIdSubmodule} from 'modules/netIdSystem.js';
|
|
33
36
|
import {intentIqIdSubmodule} from 'modules/intentIqIdSystem.js';
|
|
@@ -39,7 +42,6 @@ import {criteoIdSubmodule} from 'modules/criteoIdSystem.js';
|
|
|
39
42
|
import {mwOpenLinkIdSubModule} from 'modules/mwOpenLinkIdSystem.js';
|
|
40
43
|
import {tapadIdSubmodule} from 'modules/tapadIdSystem.js';
|
|
41
44
|
import {tncidSubModule} from 'modules/tncIdSystem.js';
|
|
42
|
-
import {getPrebidInternal} from 'src/utils.js';
|
|
43
45
|
import {uid2IdSubmodule} from 'modules/uid2IdSystem.js';
|
|
44
46
|
import {admixerIdSubmodule} from 'modules/admixerIdSystem.js';
|
|
45
47
|
import {deepintentDpesSubmodule} from 'modules/deepintentDpesIdSystem.js';
|
|
@@ -55,6 +57,8 @@ import {getPPID} from '../../../src/adserver.js';
|
|
|
55
57
|
import {uninstall as uninstallGdprEnforcement} from 'modules/gdprEnforcement.js';
|
|
56
58
|
import {GDPR_GVLIDS} from '../../../src/consentHandler.js';
|
|
57
59
|
import {MODULE_TYPE_UID} from '../../../src/activities/modules.js';
|
|
60
|
+
import {ACTIVITY_ENRICH_EIDS} from '../../../src/activities/activities.js';
|
|
61
|
+
import {ACTIVITY_PARAM_COMPONENT_NAME, ACTIVITY_PARAM_COMPONENT_TYPE} from '../../../src/activities/params.js';
|
|
58
62
|
|
|
59
63
|
let assert = require('chai').assert;
|
|
60
64
|
let expect = require('chai').expect;
|
|
@@ -188,8 +192,7 @@ describe('User ID', function () {
|
|
|
188
192
|
mockGpt.disable();
|
|
189
193
|
mockGpt.enable();
|
|
190
194
|
coreStorage.setCookie('pubcid', '', EXPIRED_COOKIE_DATE);
|
|
191
|
-
coreStorage.setCookie('pubcid_alt', 'altpubcid200000', (new Date(Date.now() +
|
|
192
|
-
let origSK = coreStorage.setCookie.bind(coreStorage);
|
|
195
|
+
coreStorage.setCookie('pubcid_alt', 'altpubcid200000', (new Date(Date.now() + 20000).toUTCString()));
|
|
193
196
|
sinon.spy(coreStorage, 'setCookie');
|
|
194
197
|
sinon.stub(utils, 'logWarn');
|
|
195
198
|
});
|
|
@@ -320,10 +323,6 @@ describe('User ID', function () {
|
|
|
320
323
|
});
|
|
321
324
|
});
|
|
322
325
|
});
|
|
323
|
-
// Because the consent cookie doesn't exist yet, we'll have 2 setCookie calls:
|
|
324
|
-
// 1) for the consent cookie
|
|
325
|
-
// 2) from the getId() call that results in a new call to store the results
|
|
326
|
-
expect(coreStorage.setCookie.callCount).to.equal(2);
|
|
327
326
|
});
|
|
328
327
|
});
|
|
329
328
|
|
|
@@ -350,7 +349,6 @@ describe('User ID', function () {
|
|
|
350
349
|
});
|
|
351
350
|
});
|
|
352
351
|
});
|
|
353
|
-
expect(coreStorage.setCookie.callCount).to.equal(2);
|
|
354
352
|
});
|
|
355
353
|
});
|
|
356
354
|
|
|
@@ -2506,6 +2504,53 @@ describe('User ID', function () {
|
|
|
2506
2504
|
done();
|
|
2507
2505
|
}, {adUnits});
|
|
2508
2506
|
});
|
|
2507
|
+
|
|
2508
|
+
describe('activity controls', () => {
|
|
2509
|
+
let isAllowed;
|
|
2510
|
+
const MOCK_IDS = ['mockId1', 'mockId2']
|
|
2511
|
+
beforeEach(() => {
|
|
2512
|
+
isAllowed = sinon.stub(dep, 'isAllowed');
|
|
2513
|
+
init(config);
|
|
2514
|
+
setSubmoduleRegistry([]);
|
|
2515
|
+
const mods = MOCK_IDS.map((name) => ({
|
|
2516
|
+
name,
|
|
2517
|
+
decode: function (value) {
|
|
2518
|
+
return {
|
|
2519
|
+
[name]: value
|
|
2520
|
+
};
|
|
2521
|
+
},
|
|
2522
|
+
getId: function () {
|
|
2523
|
+
return {id: `${name}Value`};
|
|
2524
|
+
}
|
|
2525
|
+
}));
|
|
2526
|
+
mods.forEach(attachIdSystem);
|
|
2527
|
+
});
|
|
2528
|
+
afterEach(() => {
|
|
2529
|
+
isAllowed.restore();
|
|
2530
|
+
});
|
|
2531
|
+
|
|
2532
|
+
it('should check for enrichEids activity permissions', (done) => {
|
|
2533
|
+
isAllowed.callsFake((activity, params) => {
|
|
2534
|
+
return !(activity === ACTIVITY_ENRICH_EIDS &&
|
|
2535
|
+
params[ACTIVITY_PARAM_COMPONENT_TYPE] === MODULE_TYPE_UID &&
|
|
2536
|
+
params[ACTIVITY_PARAM_COMPONENT_NAME] === MOCK_IDS[0])
|
|
2537
|
+
})
|
|
2538
|
+
|
|
2539
|
+
config.setConfig({
|
|
2540
|
+
userSync: {
|
|
2541
|
+
syncDelay: 0,
|
|
2542
|
+
userIds: MOCK_IDS.map(name => ({
|
|
2543
|
+
name, storage: {name, type: 'cookie'}
|
|
2544
|
+
}))
|
|
2545
|
+
}
|
|
2546
|
+
});
|
|
2547
|
+
requestBidsHook((req) => {
|
|
2548
|
+
const activeIds = req.adUnits.flatMap(au => au.bids).flatMap(bid => Object.keys(bid.userId));
|
|
2549
|
+
expect(Array.from(new Set(activeIds))).to.have.members([MOCK_IDS[1]]);
|
|
2550
|
+
done();
|
|
2551
|
+
}, {adUnits})
|
|
2552
|
+
});
|
|
2553
|
+
})
|
|
2509
2554
|
});
|
|
2510
2555
|
|
|
2511
2556
|
describe('callbacks at the end of auction', function () {
|
|
@@ -2591,15 +2636,21 @@ describe('User ID', function () {
|
|
|
2591
2636
|
});
|
|
2592
2637
|
|
|
2593
2638
|
describe('Set cookie behavior', function () {
|
|
2594
|
-
let
|
|
2639
|
+
let cookie, cookieStub;
|
|
2640
|
+
|
|
2595
2641
|
beforeEach(function () {
|
|
2596
|
-
coreStorageSpy = sinon.spy(coreStorage, 'setCookie');
|
|
2597
2642
|
setSubmoduleRegistry([sharedIdSystemSubmodule]);
|
|
2598
2643
|
init(config);
|
|
2644
|
+
cookie = document.cookie;
|
|
2645
|
+
cookieStub = sinon.stub(document, 'cookie');
|
|
2646
|
+
cookieStub.get(() => cookie);
|
|
2647
|
+
cookieStub.set((val) => cookie = val);
|
|
2599
2648
|
});
|
|
2649
|
+
|
|
2600
2650
|
afterEach(function () {
|
|
2601
|
-
|
|
2651
|
+
cookieStub.restore();
|
|
2602
2652
|
});
|
|
2653
|
+
|
|
2603
2654
|
it('should allow submodules to override the domain', function () {
|
|
2604
2655
|
const submodule = {
|
|
2605
2656
|
submodule: {
|
|
@@ -2608,26 +2659,34 @@ describe('User ID', function () {
|
|
|
2608
2659
|
}
|
|
2609
2660
|
},
|
|
2610
2661
|
config: {
|
|
2662
|
+
name: 'mockId',
|
|
2611
2663
|
storage: {
|
|
2612
2664
|
type: 'cookie'
|
|
2613
2665
|
}
|
|
2666
|
+
},
|
|
2667
|
+
storageMgr: {
|
|
2668
|
+
setCookie: sinon.stub()
|
|
2614
2669
|
}
|
|
2615
2670
|
}
|
|
2616
2671
|
setStoredValue(submodule, 'bar');
|
|
2617
|
-
expect(
|
|
2672
|
+
expect(submodule.storageMgr.setCookie.getCall(0).args[4]).to.equal('foo.com');
|
|
2618
2673
|
});
|
|
2619
2674
|
|
|
2620
|
-
it('should pass
|
|
2675
|
+
it('should pass no domain if submodule does not override the domain', function () {
|
|
2621
2676
|
const submodule = {
|
|
2622
2677
|
submodule: {},
|
|
2623
2678
|
config: {
|
|
2679
|
+
name: 'mockId',
|
|
2624
2680
|
storage: {
|
|
2625
2681
|
type: 'cookie'
|
|
2626
2682
|
}
|
|
2683
|
+
},
|
|
2684
|
+
storageMgr: {
|
|
2685
|
+
setCookie: sinon.stub()
|
|
2627
2686
|
}
|
|
2628
2687
|
}
|
|
2629
2688
|
setStoredValue(submodule, 'bar');
|
|
2630
|
-
expect(
|
|
2689
|
+
expect(submodule.storageMgr.setCookie.getCall(0).args[4]).to.equal(null);
|
|
2631
2690
|
});
|
|
2632
2691
|
});
|
|
2633
2692
|
|
|
@@ -89,11 +89,16 @@ let generateBidderRequest = (bidRequestArray, adUnitCode, ortb2 = {}) => {
|
|
|
89
89
|
numIframes: 0,
|
|
90
90
|
stack: ['https://publisher-test.com'],
|
|
91
91
|
},
|
|
92
|
+
uspConsent: '1-Y-',
|
|
92
93
|
gdprConsent: {
|
|
93
94
|
consentString: 'BOtmiBKOtmiBKABABAENAFAAAAACeAAA',
|
|
94
95
|
vendorData: {},
|
|
95
96
|
gdprApplies: true
|
|
96
97
|
},
|
|
98
|
+
gppConsent: {
|
|
99
|
+
gppString: 'DBACNYA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA~1YNN',
|
|
100
|
+
applicableSections: [1, 2, 3]
|
|
101
|
+
},
|
|
97
102
|
start: new Date().getTime(),
|
|
98
103
|
timeout: 1000,
|
|
99
104
|
ortb2
|
|
@@ -177,11 +182,6 @@ const generateResponseMock = (admPayloadType, vastVersion, videoContext) => {
|
|
|
177
182
|
|
|
178
183
|
// Unit tests
|
|
179
184
|
describe('YahooSSP Bid Adapter:', () => {
|
|
180
|
-
it('PLACEHOLDER TO PASS GULP', () => {
|
|
181
|
-
const obj = {};
|
|
182
|
-
expect(obj).to.be.an('object');
|
|
183
|
-
});
|
|
184
|
-
|
|
185
185
|
describe('Validate basic properties', () => {
|
|
186
186
|
it('should define the correct bidder code', () => {
|
|
187
187
|
expect(spec.code).to.equal('yahoossp')
|
|
@@ -193,40 +193,38 @@ describe('YahooSSP Bid Adapter:', () => {
|
|
|
193
193
|
});
|
|
194
194
|
|
|
195
195
|
describe('getUserSyncs()', () => {
|
|
196
|
-
const IMAGE_PIXEL_URL = 'http://image-pixel.com/foo/bar?1234&baz=true';
|
|
197
|
-
const IFRAME_ONE_URL = 'http://image-iframe.com/foo/bar?1234&baz=true';
|
|
196
|
+
const IMAGE_PIXEL_URL = 'http://image-pixel.com/foo/bar?1234&baz=true&gdpr=foo&gdpr_consent=bar';
|
|
197
|
+
const IFRAME_ONE_URL = 'http://image-iframe.com/foo/bar?1234&baz=true&us_privacy=hello&gpp=goodbye';
|
|
198
198
|
const IFRAME_TWO_URL = 'http://image-iframe-two.com/foo/bar?1234&baz=true';
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
pixels: `<script>document.write('<iframe src="${IFRAME_ONE_URL}"></iframe>` +
|
|
206
|
-
`<img src="${IMAGE_PIXEL_URL}"></iframe>` +
|
|
207
|
-
`<iframe src="${IFRAME_TWO_URL}"></iframe>');</script>`
|
|
208
|
-
}
|
|
199
|
+
const SERVER_RESPONSES = [{
|
|
200
|
+
body: {
|
|
201
|
+
ext: {
|
|
202
|
+
pixels: `<script>document.write('<iframe src="${IFRAME_ONE_URL}"></iframe>` +
|
|
203
|
+
`<img src="${IMAGE_PIXEL_URL}"></iframe>` +
|
|
204
|
+
`<iframe src="${IFRAME_TWO_URL}"></iframe>');</script>`
|
|
209
205
|
}
|
|
210
206
|
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
after(() => {
|
|
214
|
-
serverResponses = undefined;
|
|
215
|
-
});
|
|
207
|
+
}];
|
|
208
|
+
const bidderRequest = generateBuildRequestMock({}).bidderRequest;
|
|
216
209
|
|
|
217
210
|
it('for only iframe enabled syncs', () => {
|
|
218
211
|
let syncOptions = {
|
|
219
212
|
iframeEnabled: true,
|
|
220
213
|
pixelEnabled: false
|
|
221
214
|
};
|
|
222
|
-
let
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
)
|
|
215
|
+
let pixelObjects = spec.getUserSyncs(
|
|
216
|
+
syncOptions,
|
|
217
|
+
SERVER_RESPONSES,
|
|
218
|
+
bidderRequest.gdprConsent,
|
|
219
|
+
bidderRequest.uspConsent,
|
|
220
|
+
bidderRequest.gppConsent
|
|
221
|
+
);
|
|
222
|
+
expect(pixelObjects.length).to.equal(2);
|
|
223
|
+
|
|
224
|
+
pixelObjects.forEach(pixelObject => {
|
|
225
|
+
expect(pixelObject).to.have.all.keys('type', 'url');
|
|
226
|
+
expect(pixelObject.type).to.equal('iframe');
|
|
227
|
+
});
|
|
230
228
|
});
|
|
231
229
|
|
|
232
230
|
it('for only pixel enabled syncs', () => {
|
|
@@ -234,13 +232,16 @@ describe('YahooSSP Bid Adapter:', () => {
|
|
|
234
232
|
iframeEnabled: false,
|
|
235
233
|
pixelEnabled: true
|
|
236
234
|
};
|
|
237
|
-
let
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
)
|
|
235
|
+
let pixelObjects = spec.getUserSyncs(
|
|
236
|
+
syncOptions,
|
|
237
|
+
SERVER_RESPONSES,
|
|
238
|
+
bidderRequest.gdprConsent,
|
|
239
|
+
bidderRequest.uspConsent,
|
|
240
|
+
bidderRequest.gppConsent
|
|
241
|
+
);
|
|
242
|
+
expect(pixelObjects.length).to.equal(1);
|
|
243
|
+
expect(pixelObjects[0]).to.have.all.keys('type', 'url');
|
|
244
|
+
expect(pixelObjects[0].type).to.equal('image');
|
|
244
245
|
});
|
|
245
246
|
|
|
246
247
|
it('for both pixel and iframe enabled syncs', () => {
|
|
@@ -248,15 +249,56 @@ describe('YahooSSP Bid Adapter:', () => {
|
|
|
248
249
|
iframeEnabled: true,
|
|
249
250
|
pixelEnabled: true
|
|
250
251
|
};
|
|
251
|
-
let
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
252
|
+
let pixelObjects = spec.getUserSyncs(
|
|
253
|
+
syncOptions,
|
|
254
|
+
SERVER_RESPONSES,
|
|
255
|
+
bidderRequest.gdprConsent,
|
|
256
|
+
bidderRequest.uspConsent,
|
|
257
|
+
bidderRequest.gppConsent
|
|
258
|
+
);
|
|
259
|
+
expect(pixelObjects.length).to.equal(3);
|
|
260
|
+
let iframeCount = 0;
|
|
261
|
+
let imageCount = 0;
|
|
262
|
+
pixelObjects.forEach(pixelObject => {
|
|
263
|
+
if (pixelObject.type == 'iframe') {
|
|
264
|
+
iframeCount++;
|
|
265
|
+
} else if (pixelObject.type == 'image') {
|
|
266
|
+
imageCount++;
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
expect(iframeCount).to.equal(2);
|
|
270
|
+
expect(imageCount).to.equal(1);
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
describe('user consent parameters are updated', () => {
|
|
274
|
+
let syncOptions = {
|
|
275
|
+
iframeEnabled: true,
|
|
276
|
+
pixelEnabled: true
|
|
277
|
+
};
|
|
278
|
+
let pixelObjects = spec.getUserSyncs(
|
|
279
|
+
syncOptions,
|
|
280
|
+
SERVER_RESPONSES,
|
|
281
|
+
bidderRequest.gdprConsent,
|
|
282
|
+
bidderRequest.uspConsent,
|
|
283
|
+
bidderRequest.gppConsent
|
|
284
|
+
);
|
|
285
|
+
pixelObjects.forEach(pixelObject => {
|
|
286
|
+
let url = pixelObject.url;
|
|
287
|
+
let urlParams = new URL(url).searchParams;
|
|
288
|
+
const expectedParams = {
|
|
289
|
+
'baz': 'true',
|
|
290
|
+
'gdpr_consent': bidderRequest.gdprConsent.consentString,
|
|
291
|
+
'gdpr': bidderRequest.gdprConsent.gdprApplies ? '1' : '0',
|
|
292
|
+
'us_privacy': bidderRequest.uspConsent,
|
|
293
|
+
'gpp': bidderRequest.gppConsent.gppString,
|
|
294
|
+
'gpp_sid': Array.isArray(bidderRequest.gppConsent.applicableSections) ? bidderRequest.gppConsent.applicableSections.join(',') : ''
|
|
295
|
+
}
|
|
296
|
+
for (const [key, value] of Object.entries(expectedParams)) {
|
|
297
|
+
it(`Updates the ${key} consent param in user sync URL ${url}`, () => {
|
|
298
|
+
expect(urlParams.get(key)).to.equal(value);
|
|
299
|
+
});
|
|
300
|
+
};
|
|
301
|
+
});
|
|
260
302
|
});
|
|
261
303
|
});
|
|
262
304
|
|
|
@@ -749,7 +791,15 @@ describe('YahooSSP Bid Adapter:', () => {
|
|
|
749
791
|
expect(options.withCredentials).to.be.false;
|
|
750
792
|
});
|
|
751
793
|
|
|
752
|
-
it('
|
|
794
|
+
it('set the GPP consent data from the data within the bid request', function () {
|
|
795
|
+
const { validBidRequests, bidderRequest } = generateBuildRequestMock({});
|
|
796
|
+
let clonedBidderRequest = {...bidderRequest};
|
|
797
|
+
const data = spec.buildRequests(validBidRequests, clonedBidderRequest)[0].data;
|
|
798
|
+
expect(data.regs.ext.gpp).to.equal(bidderRequest.gppConsent.gppString);
|
|
799
|
+
expect(data.regs.ext.gpp_sid).to.eql(bidderRequest.gppConsent.applicableSections);
|
|
800
|
+
});
|
|
801
|
+
|
|
802
|
+
it('overrides the GPP consent data using data from the ortb2 config object', function () {
|
|
753
803
|
const { validBidRequests, bidderRequest } = generateBuildRequestMock({});
|
|
754
804
|
const ortb2 = {
|
|
755
805
|
regs: {
|
|
@@ -759,8 +809,8 @@ describe('YahooSSP Bid Adapter:', () => {
|
|
|
759
809
|
};
|
|
760
810
|
let clonedBidderRequest = {...bidderRequest, ortb2};
|
|
761
811
|
const data = spec.buildRequests(validBidRequests, clonedBidderRequest)[0].data;
|
|
762
|
-
expect(data.regs.ext.gpp).to.equal(
|
|
763
|
-
expect(data.regs.ext.gpp_sid).to.eql(
|
|
812
|
+
expect(data.regs.ext.gpp).to.equal(ortb2.regs.gpp);
|
|
813
|
+
expect(data.regs.ext.gpp_sid).to.eql(ortb2.regs.gpp_sid);
|
|
764
814
|
});
|
|
765
815
|
});
|
|
766
816
|
|
|
@@ -930,8 +980,10 @@ describe('YahooSSP Bid Adapter:', () => {
|
|
|
930
980
|
|
|
931
981
|
expect(data.regs).to.deep.equal({
|
|
932
982
|
ext: {
|
|
933
|
-
'us_privacy':
|
|
934
|
-
gdpr: 1
|
|
983
|
+
'us_privacy': bidderRequest.uspConsent,
|
|
984
|
+
gdpr: 1,
|
|
985
|
+
gpp: bidderRequest.gppConsent.gppString,
|
|
986
|
+
gpp_sid: bidderRequest.gppConsent.applicableSections
|
|
935
987
|
}
|
|
936
988
|
});
|
|
937
989
|
|
|
@@ -137,6 +137,8 @@ describe('Zeta Ssp Bid Adapter', function () {
|
|
|
137
137
|
mimes: ['video/mp4'],
|
|
138
138
|
minduration: 5,
|
|
139
139
|
maxduration: 30,
|
|
140
|
+
placement: 2,
|
|
141
|
+
plcmt: 1,
|
|
140
142
|
protocols: [2, 3]
|
|
141
143
|
}
|
|
142
144
|
},
|
|
@@ -326,6 +328,8 @@ describe('Zeta Ssp Bid Adapter', function () {
|
|
|
326
328
|
expect(payload.imp[0].video.mimes).to.eql(videoRequest[0].mediaTypes.video.mimes);
|
|
327
329
|
expect(payload.imp[0].video.w).to.eql(720);
|
|
328
330
|
expect(payload.imp[0].video.h).to.eql(340);
|
|
331
|
+
expect(payload.imp[0].video.placement).to.eql(videoRequest[0].mediaTypes.video.placement);
|
|
332
|
+
expect(payload.imp[0].video.plcmt).to.eql(videoRequest[0].mediaTypes.video.plcmt);
|
|
329
333
|
|
|
330
334
|
expect(payload.imp[0].banner).to.be.undefined;
|
|
331
335
|
});
|