prebid.js 8.6.0 → 8.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/a1MediaRtdProvider.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/admaticBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adqueryIdSystem.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adsinteractiveBidAdapter.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/alkimiBidAdapter.js +1 -1
- 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/automatadAnalyticsAdapter.js +1 -0
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidViewability.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/brandmetricsRtdProvider.js +1 -1
- package/dist/bridBidAdapter.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/connatixBidAdapter.js +1 -0
- 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 +7 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freepassBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/geoedgeRtdProvider.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/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.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/liveIntentIdSystem.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/medianetBidAdapter.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/nativoBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +145 -142
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/operaadsBidAdapter.js +1 -1
- package/dist/operaadsIdSystem.js +1 -0
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/oxxionAnalyticsAdapter.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/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/smartyadsBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/snigelBidAdapter.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/tappxBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/topicsFpdModule.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/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/integrationExamples/topics/topics-server.js +72 -0
- package/modules/.submodules.json +2 -1
- package/modules/a1MediaRtdProvider.js +1 -1
- package/modules/adagioBidAdapter.js +15 -1
- package/modules/adgenerationBidAdapter.js +4 -3
- package/modules/admaticBidAdapter.js +5 -0
- package/modules/adqueryBidAdapter.js +23 -21
- package/modules/adqueryIdSystem.js +45 -30
- package/modules/adrelevantisBidAdapter.js +2 -0
- package/modules/adsinteractiveBidAdapter.js +2 -0
- package/modules/alkimiBidAdapter.js +19 -7
- package/modules/automatadAnalyticsAdapter.js +325 -0
- package/modules/automatadAnalyticsAdapter.md +23 -0
- package/modules/bidViewability.js +7 -0
- package/modules/bidViewability.md +9 -8
- package/modules/brandmetricsRtdProvider.js +30 -27
- package/modules/connatixBidAdapter.js +185 -0
- package/modules/connatixBidAdapter.md +37 -0
- package/modules/criteoBidAdapter.js +73 -50
- package/modules/freepassBidAdapter.js +20 -1
- package/modules/freepassBidAdapter.md +4 -1
- package/modules/geoedgeRtdProvider.js +43 -13
- package/modules/geoedgeRtdProvider.md +2 -1
- package/modules/gridBidAdapter.js +1 -8
- package/modules/liveIntentIdSystem.js +16 -1
- package/modules/medianetBidAdapter.js +7 -4
- package/modules/mediasquareBidAdapter.js +3 -0
- package/modules/nativoBidAdapter.js +21 -3
- package/modules/onetagBidAdapter.js +3 -0
- package/modules/operaadsBidAdapter.js +5 -0
- package/modules/operaadsBidAdapter.md +5 -5
- package/modules/operaadsIdSystem.js +106 -0
- package/modules/operaadsIdSystem.md +52 -0
- package/modules/optidigitalBidAdapter.js +25 -16
- package/modules/oxxionAnalyticsAdapter.js +22 -5
- package/modules/rubiconBidAdapter.js +2 -2
- package/modules/smartyadsBidAdapter.js +18 -1
- package/modules/snigelBidAdapter.js +69 -16
- package/modules/snigelBidAdapter.md +9 -3
- package/modules/tappxBidAdapter.js +17 -14
- package/modules/topicsFpdModule.js +35 -9
- package/modules/undertoneBidAdapter.md +1 -1
- package/modules/userId/eids.md +7 -0
- package/modules/visxBidAdapter.js +51 -1
- package/package.json +2 -2
- package/src/adloader.js +1 -0
- package/src/native.js +2 -2
- package/test/spec/modules/adagioBidAdapter_spec.js +89 -0
- package/test/spec/modules/adgenerationBidAdapter_spec.js +6 -6
- package/test/spec/modules/admaticBidAdapter_spec.js +5 -0
- package/test/spec/modules/adqueryIdSystem_spec.js +13 -24
- package/test/spec/modules/alkimiBidAdapter_spec.js +3 -9
- package/test/spec/modules/automatadAnalyticsAdapter_spec.js +533 -0
- package/test/spec/modules/bidViewability_spec.js +32 -1
- package/test/spec/modules/brandmetricsRtdProvider_spec.js +6 -0
- package/test/spec/modules/connatixBidAdapter_spec.js +366 -0
- package/test/spec/modules/criteoBidAdapter_spec.js +249 -0
- package/test/spec/modules/eids_spec.js +48 -0
- package/test/spec/modules/freepassBidAdapter_spec.js +44 -0
- package/test/spec/modules/geoedgeRtdProvider_spec.js +44 -24
- package/test/spec/modules/gridBidAdapter_spec.js +68 -0
- package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +5 -0
- package/test/spec/modules/liveIntentIdSystem_spec.js +5 -0
- package/test/spec/modules/medianetBidAdapter_spec.js +18 -18
- package/test/spec/modules/mediasquareBidAdapter_spec.js +5 -0
- package/test/spec/modules/nativoBidAdapter_spec.js +6 -1
- package/test/spec/modules/onetagBidAdapter_spec.js +69 -0
- package/test/spec/modules/operaadsIdSystem_spec.js +53 -0
- package/test/spec/modules/optidigitalBidAdapter_spec.js +9 -2
- package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +6 -1
- package/test/spec/modules/rubiconBidAdapter_spec.js +24 -0
- package/test/spec/modules/smartyadsBidAdapter_spec.js +49 -0
- package/test/spec/modules/snigelBidAdapter_spec.js +57 -6
- package/test/spec/modules/tappxBidAdapter_spec.js +19 -0
- package/test/spec/modules/topicsFpdModule_spec.js +102 -1
- package/test/spec/modules/visxBidAdapter_spec.js +151 -1
- package/test/spec/native_spec.js +5 -3
|
@@ -167,7 +167,8 @@ describe('Oxxion Analytics', function () {
|
|
|
167
167
|
'meta': {
|
|
168
168
|
'advertiserDomains': [
|
|
169
169
|
'example.com'
|
|
170
|
-
]
|
|
170
|
+
],
|
|
171
|
+
'demandSource': 'something'
|
|
171
172
|
},
|
|
172
173
|
'renderer': 'something',
|
|
173
174
|
'originalCpm': 25.02521,
|
|
@@ -313,13 +314,16 @@ describe('Oxxion Analytics', function () {
|
|
|
313
314
|
expect(message.auctionEnd[0].bidsReceived[0]).not.to.have.property('ad');
|
|
314
315
|
expect(message.auctionEnd[0].bidsReceived[0]).to.have.property('meta');
|
|
315
316
|
expect(message.auctionEnd[0].bidsReceived[0].meta).to.have.property('advertiserDomains');
|
|
317
|
+
expect(message.auctionEnd[0].bidsReceived[0].meta).to.have.property('demandSource');
|
|
316
318
|
expect(message.auctionEnd[0].bidsReceived[0]).to.have.property('adId');
|
|
317
319
|
expect(message.auctionEnd[0]).to.have.property('bidderRequests').and.to.have.lengthOf(1);
|
|
318
320
|
expect(message.auctionEnd[0].bidderRequests[0]).to.have.property('gdprConsent');
|
|
319
321
|
expect(message.auctionEnd[0].bidderRequests[0].gdprConsent).not.to.have.property('vendorData');
|
|
322
|
+
expect(message.auctionEnd[0].bidderRequests[0]).to.have.property('oxxionMode');
|
|
320
323
|
});
|
|
321
324
|
|
|
322
325
|
it('test bidWon', function() {
|
|
326
|
+
window.OXXION_MODE = {'abtest': true};
|
|
323
327
|
adapterManager.registerAnalyticsAdapter({
|
|
324
328
|
code: 'oxxion',
|
|
325
329
|
adapter: oxxionAnalytics
|
|
@@ -337,6 +341,7 @@ describe('Oxxion Analytics', function () {
|
|
|
337
341
|
expect(message).not.to.have.property('ad');
|
|
338
342
|
expect(message).to.have.property('adId')
|
|
339
343
|
expect(message).to.have.property('cpmIncrement').and.to.equal(27.4276);
|
|
344
|
+
expect(message).to.have.property('oxxionMode').and.to.have.property('abtest').and.to.equal(true);
|
|
340
345
|
// sinon.assert.callCount(oxxionAnalytics.track, 1);
|
|
341
346
|
});
|
|
342
347
|
});
|
|
@@ -1229,6 +1229,30 @@ describe('the rubicon adapter', function () {
|
|
|
1229
1229
|
});
|
|
1230
1230
|
});
|
|
1231
1231
|
|
|
1232
|
+
it('should still use single request if other rubicon configs are set after', function () {
|
|
1233
|
+
// set single request to true
|
|
1234
|
+
config.setConfig({ rubicon: { singleRequest: true } });
|
|
1235
|
+
|
|
1236
|
+
// execute some other rubicon setConfig
|
|
1237
|
+
config.setConfig({ rubicon: { netRevenue: true } });
|
|
1238
|
+
|
|
1239
|
+
const bidCopy = utils.deepClone(bidderRequest.bids[0]);
|
|
1240
|
+
bidderRequest.bids.push(bidCopy);
|
|
1241
|
+
bidderRequest.bids.push(bidCopy);
|
|
1242
|
+
bidderRequest.bids.push(bidCopy);
|
|
1243
|
+
|
|
1244
|
+
let serverRequests = spec.buildRequests(bidderRequest.bids, bidderRequest);
|
|
1245
|
+
|
|
1246
|
+
// should have 1 request only
|
|
1247
|
+
expect(serverRequests).that.is.an('array').of.length(1);
|
|
1248
|
+
|
|
1249
|
+
// get the built query
|
|
1250
|
+
let data = parseQuery(serverRequests[0].data);
|
|
1251
|
+
|
|
1252
|
+
// num slots should be 4
|
|
1253
|
+
expect(data.slots).to.equal('4');
|
|
1254
|
+
});
|
|
1255
|
+
|
|
1232
1256
|
it('should not group bid requests if singleRequest does not equal true', function () {
|
|
1233
1257
|
config.setConfig({rubicon: {singleRequest: false}});
|
|
1234
1258
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {expect} from 'chai';
|
|
2
2
|
import {spec} from '../../../modules/smartyadsBidAdapter.js';
|
|
3
3
|
import { config } from '../../../src/config.js';
|
|
4
|
+
import {server} from '../../mocks/xhr';
|
|
4
5
|
|
|
5
6
|
describe('SmartyadsAdapter', function () {
|
|
6
7
|
let bid = {
|
|
@@ -14,6 +15,21 @@ describe('SmartyadsAdapter', function () {
|
|
|
14
15
|
}
|
|
15
16
|
};
|
|
16
17
|
|
|
18
|
+
let bidResponse = {
|
|
19
|
+
width: 300,
|
|
20
|
+
height: 250,
|
|
21
|
+
mediaType: 'banner',
|
|
22
|
+
ad: `<img src='https://dummyimage.com/300x250&text=Test+Mode' width=300 height=250 alt='test mode'>`,
|
|
23
|
+
requestId: '23fhj33i987f',
|
|
24
|
+
cpm: 0.1,
|
|
25
|
+
ttl: 120,
|
|
26
|
+
creativeId: '123',
|
|
27
|
+
netRevenue: true,
|
|
28
|
+
currency: 'USD',
|
|
29
|
+
dealId: 'HASH',
|
|
30
|
+
sid: 1234
|
|
31
|
+
};
|
|
32
|
+
|
|
17
33
|
describe('isBidRequestValid', function () {
|
|
18
34
|
it('Should return true if there are bidId, params and sourceid parameters present', function () {
|
|
19
35
|
expect(spec.isBidRequestValid(bid)).to.be.true;
|
|
@@ -257,4 +273,37 @@ describe('SmartyadsAdapter', function () {
|
|
|
257
273
|
]);
|
|
258
274
|
});
|
|
259
275
|
});
|
|
276
|
+
|
|
277
|
+
describe('onBidWon', function () {
|
|
278
|
+
it('should exists', function () {
|
|
279
|
+
expect(spec.onBidWon).to.exist.and.to.be.a('function');
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
it('should send a valid bid won notice', function () {
|
|
283
|
+
spec.onBidWon(bidResponse);
|
|
284
|
+
expect(server.requests.length).to.equal(1);
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
describe('onTimeout', function () {
|
|
289
|
+
it('should exists', function () {
|
|
290
|
+
expect(spec.onTimeout).to.exist.and.to.be.a('function');
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
it('should send a valid bid timeout notice', function () {
|
|
294
|
+
spec.onTimeout({});
|
|
295
|
+
expect(server.requests.length).to.equal(1);
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
describe('onBidderError', function () {
|
|
300
|
+
it('should exists', function () {
|
|
301
|
+
expect(spec.onBidderError).to.exist.and.to.be.a('function');
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
it('should send a valid bidder error notice', function () {
|
|
305
|
+
spec.onBidderError({});
|
|
306
|
+
expect(server.requests.length).to.equal(1);
|
|
307
|
+
});
|
|
308
|
+
});
|
|
260
309
|
});
|
|
@@ -20,6 +20,7 @@ const makeBidRequest = function (overrides) {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const BASE_BIDDER_REQUEST = {
|
|
23
|
+
auctionId: 'test',
|
|
23
24
|
bidderRequestId: 'test',
|
|
24
25
|
refererInfo: {
|
|
25
26
|
canonicalUrl: 'https://localhost',
|
|
@@ -53,8 +54,8 @@ describe('snigelBidAdapter', function () {
|
|
|
53
54
|
it('should build a single request for every impression and its placement', function () {
|
|
54
55
|
const bidderRequest = Object.assign({}, BASE_BIDDER_REQUEST);
|
|
55
56
|
const bidRequests = [
|
|
56
|
-
makeBidRequest({bidId: 'a', params: {placement: 'top_leaderboard'}}),
|
|
57
|
-
makeBidRequest({bidId: 'b', params: {placement: 'bottom_leaderboard'}}),
|
|
57
|
+
makeBidRequest({bidId: 'a', adUnitCode: 'au_a', params: {placement: 'top_leaderboard'}}),
|
|
58
|
+
makeBidRequest({bidId: 'b', adUnitCode: 'au_b', params: {placement: 'bottom_leaderboard'}}),
|
|
58
59
|
];
|
|
59
60
|
|
|
60
61
|
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
@@ -70,9 +71,9 @@ describe('snigelBidAdapter', function () {
|
|
|
70
71
|
expect(data).to.have.property('page').and.to.equal('https://localhost');
|
|
71
72
|
expect(data).to.have.property('placements');
|
|
72
73
|
expect(data.placements.length).to.equal(2);
|
|
73
|
-
expect(data.placements[0].
|
|
74
|
+
expect(data.placements[0].id).to.equal('au_a');
|
|
74
75
|
expect(data.placements[0].name).to.equal('top_leaderboard');
|
|
75
|
-
expect(data.placements[1].
|
|
76
|
+
expect(data.placements[1].id).to.equal('au_b');
|
|
76
77
|
expect(data.placements[1].name).to.equal('bottom_leaderboard');
|
|
77
78
|
});
|
|
78
79
|
|
|
@@ -127,6 +128,56 @@ describe('snigelBidAdapter', function () {
|
|
|
127
128
|
const data = JSON.parse(request.data);
|
|
128
129
|
expect(data).to.have.property('coppa').and.to.equal(true);
|
|
129
130
|
});
|
|
131
|
+
|
|
132
|
+
it('should forward refresh information', function () {
|
|
133
|
+
const bidderRequest = Object.assign({}, BASE_BIDDER_REQUEST);
|
|
134
|
+
const topLeaderboard = makeBidRequest({adUnitCode: 'top_leaderboard'});
|
|
135
|
+
const bottomLeaderboard = makeBidRequest({adUnitCode: 'bottom_leaderboard'});
|
|
136
|
+
const sidebar = makeBidRequest({adUnitCode: 'sidebar'});
|
|
137
|
+
|
|
138
|
+
// first auction, no refresh
|
|
139
|
+
let request = spec.buildRequests([topLeaderboard, bottomLeaderboard], bidderRequest);
|
|
140
|
+
expect(request).to.have.property('data');
|
|
141
|
+
let data = JSON.parse(request.data);
|
|
142
|
+
expect(data).to.have.property('placements');
|
|
143
|
+
expect(data.placements.length).to.equal(2);
|
|
144
|
+
expect(data.placements[0].id).to.equal('top_leaderboard');
|
|
145
|
+
expect(data.placements[0].refresh).to.be.undefined;
|
|
146
|
+
expect(data.placements[1].id).to.equal('bottom_leaderboard');
|
|
147
|
+
expect(data.placements[1].refresh).to.be.undefined;
|
|
148
|
+
|
|
149
|
+
// second auction for top leaderboard, was refreshed
|
|
150
|
+
request = spec.buildRequests([topLeaderboard, sidebar], bidderRequest);
|
|
151
|
+
expect(request).to.have.property('data');
|
|
152
|
+
data = JSON.parse(request.data);
|
|
153
|
+
expect(data).to.have.property('placements');
|
|
154
|
+
expect(data.placements.length).to.equal(2);
|
|
155
|
+
expect(data.placements[0].id).to.equal('top_leaderboard');
|
|
156
|
+
expect(data.placements[0].refresh).to.not.be.undefined;
|
|
157
|
+
expect(data.placements[0].refresh.count).to.equal(1);
|
|
158
|
+
expect(data.placements[0].refresh.time).to.be.greaterThanOrEqual(0);
|
|
159
|
+
expect(data.placements[1].id).to.equal('sidebar');
|
|
160
|
+
expect(data.placements[1].refresh).to.be.undefined;
|
|
161
|
+
|
|
162
|
+
// third auction, all units refreshed at some point
|
|
163
|
+
request = spec.buildRequests([topLeaderboard, bottomLeaderboard, sidebar], bidderRequest);
|
|
164
|
+
expect(request).to.have.property('data');
|
|
165
|
+
data = JSON.parse(request.data);
|
|
166
|
+
expect(data).to.have.property('placements');
|
|
167
|
+
expect(data.placements.length).to.equal(3);
|
|
168
|
+
expect(data.placements[0].id).to.equal('top_leaderboard');
|
|
169
|
+
expect(data.placements[0].refresh).to.not.be.undefined;
|
|
170
|
+
expect(data.placements[0].refresh.count).to.equal(2);
|
|
171
|
+
expect(data.placements[0].refresh.time).to.be.greaterThanOrEqual(0);
|
|
172
|
+
expect(data.placements[1].id).to.equal('bottom_leaderboard');
|
|
173
|
+
expect(data.placements[1].refresh).to.not.be.undefined;
|
|
174
|
+
expect(data.placements[1].refresh.count).to.equal(1);
|
|
175
|
+
expect(data.placements[1].refresh.time).to.be.greaterThanOrEqual(0);
|
|
176
|
+
expect(data.placements[2].id).to.equal('sidebar');
|
|
177
|
+
expect(data.placements[2].refresh).to.not.be.undefined;
|
|
178
|
+
expect(data.placements[2].refresh.count).to.equal(1);
|
|
179
|
+
expect(data.placements[2].refresh.time).to.be.greaterThanOrEqual(0);
|
|
180
|
+
});
|
|
130
181
|
});
|
|
131
182
|
|
|
132
183
|
describe('interpretResponse', function () {
|
|
@@ -146,7 +197,7 @@ describe('snigelBidAdapter', function () {
|
|
|
146
197
|
cur: 'USD',
|
|
147
198
|
bids: [
|
|
148
199
|
{
|
|
149
|
-
|
|
200
|
+
id: BASE_BID_REQUEST.adUnitCode,
|
|
150
201
|
price: 0.0575,
|
|
151
202
|
ad: '<html><body><h1>Test Ad</h1></body></html>',
|
|
152
203
|
width: 728,
|
|
@@ -160,7 +211,7 @@ describe('snigelBidAdapter', function () {
|
|
|
160
211
|
},
|
|
161
212
|
};
|
|
162
213
|
|
|
163
|
-
const bids = spec.interpretResponse(serverResponse, {});
|
|
214
|
+
const bids = spec.interpretResponse(serverResponse, {bidderRequest: {bids: [BASE_BID_REQUEST]}});
|
|
164
215
|
expect(bids.length).to.equal(1);
|
|
165
216
|
const bid = bids[0];
|
|
166
217
|
expect(isValid(BASE_BID_REQUEST.adUnitCode, bid)).to.be.true;
|
|
@@ -466,4 +466,23 @@ describe('Tappx bid adapter', function () {
|
|
|
466
466
|
assert.isString(_extractPageUrl(validBidRequests, bidderRequest));
|
|
467
467
|
});
|
|
468
468
|
})
|
|
469
|
+
|
|
470
|
+
describe('Empty params values from bid tests', function() {
|
|
471
|
+
let validBidRequest = JSON.parse(JSON.stringify(c_BIDREQUEST));
|
|
472
|
+
|
|
473
|
+
it('should return false when tappxkey is empty', function () {
|
|
474
|
+
validBidRequest.bids[0].params.tappxkey = '';
|
|
475
|
+
assert.isFalse(spec.isBidRequestValid(validBidRequest.bids[0]));
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
it('should return false when host is empty', function () {
|
|
479
|
+
validBidRequest.bids[0].params.host = '';
|
|
480
|
+
assert.isFalse(spec.isBidRequestValid(validBidRequest.bids[0]));
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
it('should return false when endpoint is empty', function () {
|
|
484
|
+
validBidRequest.bids[0].params.endpoint = '';
|
|
485
|
+
assert.isFalse(spec.isBidRequestValid(validBidRequest.bids[0]));
|
|
486
|
+
});
|
|
487
|
+
});
|
|
469
488
|
});
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
reset,
|
|
9
9
|
topicStorageName
|
|
10
10
|
} from '../../../modules/topicsFpdModule.js';
|
|
11
|
+
import {config} from 'src/config.js';
|
|
11
12
|
import {deepClone, safeJSONParse} from '../../../src/utils.js';
|
|
12
13
|
import {getCoreStorageManager} from 'src/storageManager.js';
|
|
13
|
-
import {config} from 'src/config.js';
|
|
14
14
|
import * as activities from '../../../src/activities/rules.js';
|
|
15
15
|
import {ACTIVITY_ENRICH_UFPD} from '../../../src/activities/activities.js';
|
|
16
16
|
|
|
@@ -414,3 +414,104 @@ describe('topics', () => {
|
|
|
414
414
|
});
|
|
415
415
|
});
|
|
416
416
|
});
|
|
417
|
+
|
|
418
|
+
describe('handles fetch request for topics api headers', () => {
|
|
419
|
+
let stubbedFetch;
|
|
420
|
+
const storage = getCoreStorageManager('topicsFpd');
|
|
421
|
+
|
|
422
|
+
beforeEach(() => {
|
|
423
|
+
stubbedFetch = sinon.stub(window, 'fetch');
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
afterEach(() => {
|
|
427
|
+
stubbedFetch.restore();
|
|
428
|
+
storage.removeDataFromLocalStorage(topicStorageName);
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
it('should make a fetch call when a fetchUrl is present for a selected bidder', () => {
|
|
432
|
+
config.setConfig({
|
|
433
|
+
userSync: {
|
|
434
|
+
topics: {
|
|
435
|
+
maxTopicCaller: 3,
|
|
436
|
+
bidders: [
|
|
437
|
+
{
|
|
438
|
+
bidder: 'pubmatic',
|
|
439
|
+
fetchUrl: 'http://localhost:3000/topics-server.js'
|
|
440
|
+
}
|
|
441
|
+
],
|
|
442
|
+
},
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
stubbedFetch.returns(Promise.resolve(true));
|
|
447
|
+
loadTopicsForBidders({
|
|
448
|
+
browsingTopics: true,
|
|
449
|
+
featurePolicy: {
|
|
450
|
+
allowsFeature() { return true }
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
sinon.assert.calledOnce(stubbedFetch);
|
|
454
|
+
stubbedFetch.calledWith('http://localhost:3000/topics-server.js');
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
it('should not make a fetch call when a fetchUrl is not present for a selected bidder', () => {
|
|
458
|
+
config.setConfig({
|
|
459
|
+
userSync: {
|
|
460
|
+
topics: {
|
|
461
|
+
maxTopicCaller: 3,
|
|
462
|
+
bidders: [
|
|
463
|
+
{
|
|
464
|
+
bidder: 'pubmatic'
|
|
465
|
+
}
|
|
466
|
+
],
|
|
467
|
+
},
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
loadTopicsForBidders({
|
|
472
|
+
browsingTopics: true,
|
|
473
|
+
featurePolicy: {
|
|
474
|
+
allowsFeature() { return true }
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
sinon.assert.notCalled(stubbedFetch);
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
it('a fetch request should not be made if the configured fetch rate duration has not yet passed', () => {
|
|
481
|
+
const storedSegments = JSON.stringify(
|
|
482
|
+
[['pubmatic', {
|
|
483
|
+
'2206021246': {
|
|
484
|
+
'ext': {'segtax': 600, 'segclass': '2206021246'},
|
|
485
|
+
'segment': [{'id': '243'}, {'id': '265'}],
|
|
486
|
+
'name': 'ads.pubmatic.com'
|
|
487
|
+
},
|
|
488
|
+
'lastUpdated': new Date().getTime()
|
|
489
|
+
}]]
|
|
490
|
+
);
|
|
491
|
+
|
|
492
|
+
storage.setDataInLocalStorage(topicStorageName, storedSegments);
|
|
493
|
+
|
|
494
|
+
config.setConfig({
|
|
495
|
+
userSync: {
|
|
496
|
+
topics: {
|
|
497
|
+
maxTopicCaller: 3,
|
|
498
|
+
bidders: [
|
|
499
|
+
{
|
|
500
|
+
bidder: 'pubmatic',
|
|
501
|
+
fetchUrl: 'http://localhost:3000/topics-server.js',
|
|
502
|
+
fetchRate: 1 // in days. 1 fetch per day
|
|
503
|
+
}
|
|
504
|
+
],
|
|
505
|
+
},
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
loadTopicsForBidders({
|
|
510
|
+
browsingTopics: true,
|
|
511
|
+
featurePolicy: {
|
|
512
|
+
allowsFeature() { return true }
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
sinon.assert.notCalled(stubbedFetch);
|
|
516
|
+
});
|
|
517
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
|
-
import { spec } from 'modules/visxBidAdapter.js';
|
|
2
|
+
import { spec, storage } from 'modules/visxBidAdapter.js';
|
|
3
3
|
import { config } from 'src/config.js';
|
|
4
4
|
import { newBidder } from 'src/adapters/bidderFactory.js';
|
|
5
5
|
import * as utils from 'src/utils.js';
|
|
@@ -82,6 +82,9 @@ describe('VisxAdapter', function () {
|
|
|
82
82
|
});
|
|
83
83
|
return res;
|
|
84
84
|
}
|
|
85
|
+
|
|
86
|
+
let cookiesAreEnabledStub, localStorageIsEnabledStub;
|
|
87
|
+
|
|
85
88
|
const bidderRequest = {
|
|
86
89
|
timeout: 3000,
|
|
87
90
|
refererInfo: {
|
|
@@ -180,6 +183,24 @@ describe('VisxAdapter', function () {
|
|
|
180
183
|
'ext': {'bidder': {'uid': 903537}}
|
|
181
184
|
}];
|
|
182
185
|
|
|
186
|
+
before(() => {
|
|
187
|
+
$$PREBID_GLOBAL$$.bidderSettings = {
|
|
188
|
+
visx: {
|
|
189
|
+
storageAllowed: false
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled');
|
|
193
|
+
cookiesAreEnabledStub = sinon.stub(storage, 'cookiesAreEnabled');
|
|
194
|
+
localStorageIsEnabledStub.returns(false);
|
|
195
|
+
cookiesAreEnabledStub.returns(false);
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
after(() => {
|
|
199
|
+
localStorageIsEnabledStub.restore();
|
|
200
|
+
cookiesAreEnabledStub.restore();
|
|
201
|
+
$$PREBID_GLOBAL$$.bidderSettings = {};
|
|
202
|
+
});
|
|
203
|
+
|
|
183
204
|
it('should attach valid params to the tag', function () {
|
|
184
205
|
const firstBid = bidRequests[0];
|
|
185
206
|
const bids = [firstBid];
|
|
@@ -422,6 +443,7 @@ describe('VisxAdapter', function () {
|
|
|
422
443
|
});
|
|
423
444
|
return res;
|
|
424
445
|
}
|
|
446
|
+
let cookiesAreEnabledStub, localStorageIsEnabledStub;
|
|
425
447
|
const bidderRequest = {
|
|
426
448
|
timeout: 3000,
|
|
427
449
|
refererInfo: {
|
|
@@ -449,6 +471,24 @@ describe('VisxAdapter', function () {
|
|
|
449
471
|
}
|
|
450
472
|
];
|
|
451
473
|
|
|
474
|
+
before(() => {
|
|
475
|
+
$$PREBID_GLOBAL$$.bidderSettings = {
|
|
476
|
+
visx: {
|
|
477
|
+
storageAllowed: false
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled');
|
|
481
|
+
cookiesAreEnabledStub = sinon.stub(storage, 'cookiesAreEnabled');
|
|
482
|
+
localStorageIsEnabledStub.returns(false);
|
|
483
|
+
cookiesAreEnabledStub.returns(false);
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
after(() => {
|
|
487
|
+
localStorageIsEnabledStub.restore();
|
|
488
|
+
cookiesAreEnabledStub.restore();
|
|
489
|
+
$$PREBID_GLOBAL$$.bidderSettings = {};
|
|
490
|
+
});
|
|
491
|
+
|
|
452
492
|
it('should send requst for banner bid', function () {
|
|
453
493
|
const request = spec.buildRequests([bidRequests[0]], bidderRequest);
|
|
454
494
|
const payload = parseRequest(request.url);
|
|
@@ -486,6 +526,7 @@ describe('VisxAdapter', function () {
|
|
|
486
526
|
});
|
|
487
527
|
return res;
|
|
488
528
|
}
|
|
529
|
+
let cookiesAreEnabledStub, localStorageIsEnabledStub;
|
|
489
530
|
const bidderRequest = {
|
|
490
531
|
timeout: 3000,
|
|
491
532
|
refererInfo: {
|
|
@@ -529,10 +570,23 @@ describe('VisxAdapter', function () {
|
|
|
529
570
|
documentStub.withArgs('visx-adunit-element-2').returns({
|
|
530
571
|
id: 'visx-adunit-element-2'
|
|
531
572
|
});
|
|
573
|
+
|
|
574
|
+
$$PREBID_GLOBAL$$.bidderSettings = {
|
|
575
|
+
visx: {
|
|
576
|
+
storageAllowed: false
|
|
577
|
+
}
|
|
578
|
+
};
|
|
579
|
+
localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled');
|
|
580
|
+
cookiesAreEnabledStub = sinon.stub(storage, 'cookiesAreEnabled');
|
|
581
|
+
localStorageIsEnabledStub.returns(false);
|
|
582
|
+
cookiesAreEnabledStub.returns(false);
|
|
532
583
|
});
|
|
533
584
|
|
|
534
585
|
after(function() {
|
|
535
586
|
sandbox.restore();
|
|
587
|
+
localStorageIsEnabledStub.restore();
|
|
588
|
+
cookiesAreEnabledStub.restore();
|
|
589
|
+
$$PREBID_GLOBAL$$.bidderSettings = {};
|
|
536
590
|
});
|
|
537
591
|
|
|
538
592
|
it('should find ad slot by ad unit code as element id', function () {
|
|
@@ -1323,4 +1377,100 @@ describe('VisxAdapter', function () {
|
|
|
1323
1377
|
expect(query).to.deep.equal({});
|
|
1324
1378
|
});
|
|
1325
1379
|
});
|
|
1380
|
+
|
|
1381
|
+
describe('first party user id', function () {
|
|
1382
|
+
const USER_ID_KEY = '__vads';
|
|
1383
|
+
const USER_ID_DUMMY_VALUE_COOKIE = 'dummy_id_cookie';
|
|
1384
|
+
const USER_ID_DUMMY_VALUE_LOCAL_STORAGE = 'dummy_id_local_storage';
|
|
1385
|
+
|
|
1386
|
+
let getDataFromLocalStorageStub, localStorageIsEnabledStub;
|
|
1387
|
+
let getCookieStub, cookiesAreEnabledStub;
|
|
1388
|
+
|
|
1389
|
+
const bidRequests = [
|
|
1390
|
+
{
|
|
1391
|
+
'bidder': 'visx',
|
|
1392
|
+
'params': {
|
|
1393
|
+
'uid': 903535
|
|
1394
|
+
},
|
|
1395
|
+
'adUnitCode': 'adunit-code-1',
|
|
1396
|
+
'sizes': [[300, 250], [300, 600]],
|
|
1397
|
+
'bidId': '30b31c1838de1e',
|
|
1398
|
+
'bidderRequestId': '22edbae2733bf6',
|
|
1399
|
+
'auctionId': '1d1a030790a475',
|
|
1400
|
+
}
|
|
1401
|
+
];
|
|
1402
|
+
const bidderRequest = {
|
|
1403
|
+
timeout: 3000,
|
|
1404
|
+
refererInfo: {
|
|
1405
|
+
page: 'https://example.com'
|
|
1406
|
+
}
|
|
1407
|
+
};
|
|
1408
|
+
|
|
1409
|
+
beforeEach(() => {
|
|
1410
|
+
$$PREBID_GLOBAL$$.bidderSettings = {
|
|
1411
|
+
visx: {
|
|
1412
|
+
storageAllowed: true
|
|
1413
|
+
}
|
|
1414
|
+
};
|
|
1415
|
+
cookiesAreEnabledStub = sinon.stub(storage, 'cookiesAreEnabled');
|
|
1416
|
+
localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled');
|
|
1417
|
+
});
|
|
1418
|
+
|
|
1419
|
+
afterEach(() => {
|
|
1420
|
+
cookiesAreEnabledStub.restore();
|
|
1421
|
+
localStorageIsEnabledStub.restore();
|
|
1422
|
+
getCookieStub && getCookieStub.restore();
|
|
1423
|
+
getDataFromLocalStorageStub && getDataFromLocalStorageStub.restore();
|
|
1424
|
+
$$PREBID_GLOBAL$$.bidderSettings = {};
|
|
1425
|
+
});
|
|
1426
|
+
|
|
1427
|
+
it('should not pass user id if both cookies and local storage are not available', function () {
|
|
1428
|
+
cookiesAreEnabledStub.returns(false);
|
|
1429
|
+
localStorageIsEnabledStub.returns(false);
|
|
1430
|
+
|
|
1431
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
1432
|
+
|
|
1433
|
+
expect(request.data.user).to.be.undefined;
|
|
1434
|
+
});
|
|
1435
|
+
|
|
1436
|
+
it('should get user id from cookie if available', function () {
|
|
1437
|
+
cookiesAreEnabledStub.returns(true);
|
|
1438
|
+
localStorageIsEnabledStub.returns(false);
|
|
1439
|
+
getCookieStub = sinon.stub(storage, 'getCookie');
|
|
1440
|
+
getCookieStub.withArgs(USER_ID_KEY).returns(USER_ID_DUMMY_VALUE_COOKIE);
|
|
1441
|
+
|
|
1442
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
1443
|
+
|
|
1444
|
+
expect(request.data.user.ext.vads).to.equal(USER_ID_DUMMY_VALUE_COOKIE);
|
|
1445
|
+
});
|
|
1446
|
+
|
|
1447
|
+
it('should get user id from local storage if available', function () {
|
|
1448
|
+
cookiesAreEnabledStub.returns(false);
|
|
1449
|
+
localStorageIsEnabledStub.returns(true);
|
|
1450
|
+
getDataFromLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage');
|
|
1451
|
+
getDataFromLocalStorageStub.withArgs(USER_ID_KEY).returns(USER_ID_DUMMY_VALUE_LOCAL_STORAGE);
|
|
1452
|
+
|
|
1453
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
1454
|
+
|
|
1455
|
+
expect(request.data.user.ext.vads).to.equal(USER_ID_DUMMY_VALUE_LOCAL_STORAGE);
|
|
1456
|
+
});
|
|
1457
|
+
|
|
1458
|
+
it('should create user id and store it in cookies (if user id does not exist)', function () {
|
|
1459
|
+
cookiesAreEnabledStub.returns(true);
|
|
1460
|
+
localStorageIsEnabledStub.returns(false);
|
|
1461
|
+
|
|
1462
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
1463
|
+
expect(storage.getCookie(USER_ID_KEY)).to.be.a('string');
|
|
1464
|
+
expect(request.data.user.ext.vads).to.be.a('string');
|
|
1465
|
+
});
|
|
1466
|
+
|
|
1467
|
+
it('should create user id and store it in local storage (if user id does not exist)', function () {
|
|
1468
|
+
cookiesAreEnabledStub.returns(false);
|
|
1469
|
+
localStorageIsEnabledStub.returns(true);
|
|
1470
|
+
|
|
1471
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
1472
|
+
expect(storage.getDataFromLocalStorage(USER_ID_KEY)).to.be.a('string');
|
|
1473
|
+
expect(request.data.user.ext.vads).to.be.a('string');
|
|
1474
|
+
});
|
|
1475
|
+
});
|
|
1326
1476
|
});
|
package/test/spec/native_spec.js
CHANGED
|
@@ -631,7 +631,8 @@ describe('native.js', function () {
|
|
|
631
631
|
eventtrackers: [
|
|
632
632
|
{ event: 1, method: 1, url: 'https://sampleurl.com' },
|
|
633
633
|
{ event: 1, method: 2, url: 'https://sampleurljs.com' }
|
|
634
|
-
]
|
|
634
|
+
],
|
|
635
|
+
imptrackers: [ 'https://sample-imp.com' ]
|
|
635
636
|
}
|
|
636
637
|
describe('toLegacyResponse', () => {
|
|
637
638
|
it('returns assets in legacy format for ortb responses', () => {
|
|
@@ -640,8 +641,9 @@ describe('native.js', function () {
|
|
|
640
641
|
expect(actual.title).to.equal('vtitle');
|
|
641
642
|
expect(actual.clickUrl).to.equal('url');
|
|
642
643
|
expect(actual.javascriptTrackers).to.equal('<script async src="https://sampleurljs.com"></script>');
|
|
643
|
-
expect(actual.impressionTrackers.length).to.equal(
|
|
644
|
-
expect(actual.impressionTrackers
|
|
644
|
+
expect(actual.impressionTrackers.length).to.equal(2);
|
|
645
|
+
expect(actual.impressionTrackers).to.contain('https://sampleurl.com');
|
|
646
|
+
expect(actual.impressionTrackers).to.contain('https://sample-imp.com');
|
|
645
647
|
});
|
|
646
648
|
});
|
|
647
649
|
});
|