prebid.js 6.1.0 → 6.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.
- package/.circleci/config.yml +1 -1
- package/README.md +1 -1
- package/browsers.json +13 -29
- package/gulpfile.js +87 -82
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +23 -14
- package/karma.conf.maker.js +2 -2
- package/modules/33acrossBidAdapter.js +189 -102
- package/modules/adagioBidAdapter.js +1 -1
- package/modules/addefendBidAdapter.js +1 -0
- package/modules/adkernelBidAdapter.js +146 -61
- package/modules/adlooxAdServerVideo.js +2 -2
- package/modules/adlooxAnalyticsAdapter.js +4 -4
- package/modules/admanBidAdapter.js +1 -0
- package/modules/admixerBidAdapter.js +3 -2
- package/modules/adnuntiusBidAdapter.js +5 -2
- package/modules/adomikAnalyticsAdapter.js +6 -0
- package/modules/adplusBidAdapter.js +203 -0
- package/modules/adplusBidAdapter.md +39 -0
- package/modules/adxcgBidAdapter.js +311 -359
- package/modules/adxcgBidAdapter.md +22 -21
- package/modules/adyoulikeBidAdapter.js +20 -11
- package/modules/aniviewBidAdapter.js +1 -1
- package/modules/appnexusBidAdapter.js +19 -3
- package/modules/beachfrontBidAdapter.js +14 -17
- package/modules/beopBidAdapter.js +6 -4
- package/modules/bidViewability.js +3 -3
- package/modules/bidViewabilityIO.js +3 -3
- package/modules/bliinkBidAdapter.js +1 -1
- package/modules/colossussspBidAdapter.js +7 -0
- package/modules/compassBidAdapter.js +201 -0
- package/modules/compassBidAdapter.md +79 -0
- package/modules/consentManagement.js +7 -1
- package/modules/craftBidAdapter.js +5 -3
- package/modules/criteoBidAdapter.js +1 -1
- package/modules/currency.js +2 -2
- package/modules/cwireBidAdapter.js +3 -0
- package/modules/dailyhuntBidAdapter.js +435 -0
- package/modules/dailyhuntBidAdapter.md +4 -0
- package/modules/dchain.js +149 -0
- package/modules/dchain.md +45 -0
- package/modules/docereeBidAdapter.js +10 -1
- package/modules/docereeBidAdapter.md +2 -0
- package/modules/dspxBidAdapter.js +1 -1
- package/modules/emx_digitalBidAdapter.js +9 -1
- package/modules/engageyaBidAdapter.js +1 -1
- package/modules/feedadBidAdapter.js +2 -2
- package/modules/feedadBidAdapter.md +4 -2
- package/modules/freewheel-sspBidAdapter.js +6 -0
- package/modules/futureads.md +48 -0
- package/modules/glimpseBidAdapter.js +16 -3
- package/modules/goldbachBidAdapter.js +1176 -0
- package/modules/goldbachBidAdapter.md +151 -0
- package/modules/gptPreAuction.js +55 -7
- package/modules/gridBidAdapter.js +4 -3
- package/modules/gumgumBidAdapter.js +7 -3
- package/modules/improvedigitalBidAdapter.js +19 -3
- package/modules/instreamTracking.js +4 -4
- package/modules/intersectionRtdProvider.js +114 -0
- package/modules/invibesBidAdapter.js +64 -14
- package/modules/invibesBidAdapter.md +2 -1
- package/modules/ipromBidAdapter.js +79 -0
- package/modules/ixBidAdapter.js +53 -18
- package/modules/kinessoIdSystem.js +1 -1
- package/modules/limelightDigitalBidAdapter.js +3 -1
- package/modules/livewrappedAnalyticsAdapter.js +3 -1
- package/modules/livewrappedBidAdapter.js +8 -2
- package/modules/loglyliftBidAdapter.js +79 -0
- package/modules/loglyliftBidAdapter.md +55 -0
- package/modules/lotamePanoramaIdSystem.js +80 -8
- package/modules/luponmediaBidAdapter.js +570 -0
- package/modules/mediasquareBidAdapter.js +1 -9
- package/modules/missenaBidAdapter.js +89 -0
- package/modules/nextMillenniumBidAdapter.js +37 -7
- package/modules/optimeraRtdProvider.js +8 -1
- package/modules/ozoneBidAdapter.js +21 -64
- package/modules/prebidServerBidAdapter/index.js +16 -12
- package/modules/pubgeniusBidAdapter.js +1 -1
- package/modules/pubmaticBidAdapter.js +3 -3
- package/modules/pubxaiAnalyticsAdapter.js +17 -0
- package/modules/relaidoBidAdapter.js +86 -65
- package/modules/richaudienceBidAdapter.js +2 -3
- package/modules/rtdModule/index.js +48 -18
- package/modules/rubiconBidAdapter.js +31 -19
- package/modules/sharedIdSystem.js +27 -1
- package/modules/smaatoBidAdapter.js +4 -1
- package/modules/smartxBidAdapter.js +17 -1
- package/modules/tappxBidAdapter.js +3 -1
- package/modules/targetVideoBidAdapter.js +187 -0
- package/modules/targetVideoBidAdapter.md +34 -0
- package/modules/telariaBidAdapter.js +2 -2
- package/modules/trustxBidAdapter.js +8 -16
- package/modules/undertoneBidAdapter.js +8 -1
- package/modules/userId/index.js +27 -2
- package/modules/ventes.md +71 -0
- package/modules/ventesBidAdapter.js +104 -64
- package/modules/ventesBidAdapter.md +0 -1
- package/modules/vidoomyBidAdapter.js +16 -10
- package/modules/visxBidAdapter.js +19 -2
- package/modules/visxBidAdapter.md +4 -6
- package/modules/weboramaRtdProvider.js +288 -73
- package/modules/weboramaRtdProvider.md +27 -10
- package/modules/yahoosspBidAdapter.js +5 -1
- package/modules/yahoosspBidAdapter.md +1 -1
- package/modules/yieldmoBidAdapter.js +23 -5
- package/modules/yieldoneBidAdapter.js +115 -11
- package/modules/zetaSspBidAdapter.md +33 -1
- package/modules/zeta_global_sspAnalyticsAdapter.js +97 -0
- package/modules/zeta_global_sspAnalyticsAdapter.md +24 -0
- package/modules/zeta_global_sspBidAdapter.js +22 -1
- package/package.json +1 -1
- package/plugins/pbjsGlobals.js +28 -1
- package/src/auction.js +5 -4
- package/src/config.js +27 -3
- package/src/prebid.js +3 -2
- package/src/targeting.js +24 -3
- package/src/utils.js +53 -8
- package/test/helpers/prebidGlobal.js +1 -0
- package/test/spec/config_spec.js +279 -0
- package/test/spec/integration/faker/googletag.js +6 -0
- package/test/spec/modules/33acrossBidAdapter_spec.js +300 -78
- package/test/spec/modules/adlooxAnalyticsAdapter_spec.js +6 -6
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +35 -0
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +6 -0
- package/test/spec/modules/adplusBidAdapter_spec.js +213 -0
- package/test/spec/modules/adxcgBidAdapter_spec.js +820 -571
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +75 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +49 -1
- package/test/spec/modules/beachfrontBidAdapter_spec.js +65 -1
- package/test/spec/modules/beopBidAdapter_spec.js +1 -1
- package/test/spec/modules/bidViewabilityIO_spec.js +2 -2
- package/test/spec/modules/bidViewability_spec.js +4 -4
- package/test/spec/modules/colossussspBidAdapter_spec.js +9 -0
- package/test/spec/modules/compassBidAdapter_spec.js +397 -0
- package/test/spec/modules/consentManagement_spec.js +20 -0
- package/test/spec/modules/cwireBidAdapter_spec.js +10 -8
- package/test/spec/modules/dailyhuntBidAdapter_spec.js +404 -0
- package/test/spec/modules/dchain_spec.js +329 -0
- package/test/spec/modules/docereeBidAdapter_spec.js +9 -1
- package/test/spec/modules/emx_digitalBidAdapter_spec.js +10 -0
- package/test/spec/modules/feedadBidAdapter_spec.js +15 -0
- package/test/spec/modules/freewheel-sspBidAdapter_spec.js +19 -0
- package/test/spec/modules/goldbachBidAdapter_spec.js +1359 -0
- package/test/spec/modules/gptPreAuction_spec.js +177 -2
- package/test/spec/modules/gumgumBidAdapter_spec.js +6 -0
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +3 -1
- package/test/spec/modules/intersectionRtdProvider_spec.js +141 -0
- package/test/spec/modules/invibesBidAdapter_spec.js +148 -4
- package/test/spec/modules/ipromBidAdapter_spec.js +195 -0
- package/test/spec/modules/ixBidAdapter_spec.js +112 -62
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +84 -23
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +22 -0
- package/test/spec/modules/livewrappedBidAdapter_spec.js +31 -0
- package/test/spec/modules/loglyliftBidAdapter_spec.js +172 -0
- package/test/spec/modules/lotamePanoramaIdSystem_spec.js +227 -0
- package/test/spec/modules/luponmediaBidAdapter_spec.js +412 -0
- package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -4
- package/test/spec/modules/missenaBidAdapter_spec.js +134 -0
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +26 -1
- package/test/spec/modules/optimeraRtdProvider_spec.js +14 -1
- package/test/spec/modules/ozoneBidAdapter_spec.js +43 -31
- package/test/spec/modules/prebidServerBidAdapter_spec.js +43 -0
- package/test/spec/modules/pubgeniusBidAdapter_spec.js +3 -3
- package/test/spec/modules/pubmaticBidAdapter_spec.js +1 -1
- package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +11 -0
- package/test/spec/modules/realTimeDataModule_spec.js +135 -49
- package/test/spec/modules/relaidoBidAdapter_spec.js +71 -63
- package/test/spec/modules/richaudienceBidAdapter_spec.js +2 -2
- package/test/spec/modules/rubiconBidAdapter_spec.js +65 -9
- package/test/spec/modules/sharedIdSystem_spec.js +52 -6
- package/test/spec/modules/smaatoBidAdapter_spec.js +31 -0
- package/test/spec/modules/smartxBidAdapter_spec.js +9 -0
- package/test/spec/modules/tappxBidAdapter_spec.js +4 -0
- package/test/spec/modules/targetVideoBidAdapter_spec.js +96 -0
- package/test/spec/modules/userId_spec.js +51 -0
- package/test/spec/modules/visxBidAdapter_spec.js +120 -4
- package/test/spec/modules/weboramaRtdProvider_spec.js +408 -214
- package/test/spec/modules/yahoosspBidAdapter_spec.js +28 -1
- package/test/spec/modules/yieldoneBidAdapter_spec.js +299 -53
- package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +427 -0
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +33 -1
- package/test/spec/unit/core/targeting_spec.js +116 -0
- package/test/spec/utils_spec.js +38 -0
- package/test/test_deps.js +3 -0
- package/test/test_index.js +1 -3
|
@@ -57,23 +57,34 @@ describe('RelaidoAdapter', function () {
|
|
|
57
57
|
serverResponse = {
|
|
58
58
|
body: {
|
|
59
59
|
status: 'ok',
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
ads: [{
|
|
61
|
+
placementId: 100000,
|
|
62
|
+
width: 640,
|
|
63
|
+
height: 360,
|
|
64
|
+
bidId: '2ed93003f7bb99',
|
|
65
|
+
price: 500,
|
|
66
|
+
model: 'vcpm',
|
|
67
|
+
currency: 'JPY',
|
|
68
|
+
creativeId: 1000,
|
|
69
|
+
vast: '<VAST version="3.0"><Ad><InLine></InLine></Ad></VAST>',
|
|
70
|
+
syncUrl: 'https://relaido/sync.html',
|
|
71
|
+
adomain: ['relaido.co.jp', 'www.cmertv.co.jp'],
|
|
72
|
+
mediaType: 'video'
|
|
73
|
+
}],
|
|
66
74
|
playerUrl: 'https://relaido/player.js',
|
|
67
|
-
syncUrl: 'https://
|
|
68
|
-
|
|
75
|
+
syncUrl: 'https://api-dev.ulizaex.com/tr/v1/prebid/sync.html',
|
|
76
|
+
uuid: relaido_uuid,
|
|
69
77
|
}
|
|
70
78
|
};
|
|
71
79
|
serverRequest = {
|
|
72
|
-
method: '
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
method: 'POST',
|
|
81
|
+
data: {
|
|
82
|
+
bids: [{
|
|
83
|
+
bidId: bidRequest.bidId,
|
|
84
|
+
width: bidRequest.mediaTypes.video.playerSize[0][0],
|
|
85
|
+
height: bidRequest.mediaTypes.video.playerSize[0][1],
|
|
86
|
+
mediaType: 'video'}]
|
|
87
|
+
}
|
|
77
88
|
};
|
|
78
89
|
});
|
|
79
90
|
|
|
@@ -195,28 +206,23 @@ describe('RelaidoAdapter', function () {
|
|
|
195
206
|
describe('spec.buildRequests', function () {
|
|
196
207
|
it('should build bid requests by video', function () {
|
|
197
208
|
const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
expect(
|
|
202
|
-
expect(
|
|
203
|
-
expect(
|
|
204
|
-
expect(
|
|
205
|
-
expect(request.
|
|
206
|
-
expect(request.
|
|
207
|
-
expect(
|
|
208
|
-
expect(request.
|
|
209
|
-
expect(
|
|
210
|
-
expect(request.
|
|
211
|
-
expect(request.
|
|
212
|
-
expect(request.
|
|
213
|
-
expect(
|
|
214
|
-
expect(
|
|
215
|
-
expect(request.data.media_type).to.equal('video');
|
|
216
|
-
expect(request.data.uuid).to.equal(relaido_uuid);
|
|
217
|
-
expect(request.data.width).to.equal(bidRequest.mediaTypes.video.playerSize[0][0]);
|
|
218
|
-
expect(request.data.height).to.equal(bidRequest.mediaTypes.video.playerSize[0][1]);
|
|
219
|
-
expect(request.data.pv).to.equal('$prebid.version$');
|
|
209
|
+
const data = JSON.parse(bidRequests.data);
|
|
210
|
+
expect(data.bids).to.have.lengthOf(1);
|
|
211
|
+
const request = data.bids[0];
|
|
212
|
+
expect(bidRequests.method).to.equal('POST');
|
|
213
|
+
expect(bidRequests.url).to.equal('https://api.relaido.jp/bid/v1/sprebid');
|
|
214
|
+
expect(data.ref).to.equal(bidderRequest.refererInfo.referer);
|
|
215
|
+
expect(data.timeout_ms).to.equal(bidderRequest.timeout);
|
|
216
|
+
expect(request.ad_unit_code).to.equal(bidRequest.adUnitCode);
|
|
217
|
+
expect(request.auction_id).to.equal(bidRequest.auctionId);
|
|
218
|
+
expect(data.bidder).to.equal(bidRequest.bidder);
|
|
219
|
+
expect(request.bidder_request_id).to.equal(bidRequest.bidderRequestId);
|
|
220
|
+
expect(data.bid_requests_count).to.equal(bidRequest.bidRequestsCount);
|
|
221
|
+
expect(request.bid_id).to.equal(bidRequest.bidId);
|
|
222
|
+
expect(request.transaction_id).to.equal(bidRequest.transactionId);
|
|
223
|
+
expect(request.media_type).to.equal('video');
|
|
224
|
+
expect(data.uuid).to.equal(relaido_uuid);
|
|
225
|
+
expect(data.pv).to.equal('$prebid.version$');
|
|
220
226
|
});
|
|
221
227
|
|
|
222
228
|
it('should build bid requests by banner', function () {
|
|
@@ -236,9 +242,10 @@ describe('RelaidoAdapter', function () {
|
|
|
236
242
|
}
|
|
237
243
|
};
|
|
238
244
|
const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
245
|
+
const data = JSON.parse(bidRequests.data);
|
|
246
|
+
expect(data.bids).to.have.lengthOf(1);
|
|
247
|
+
const request = data.bids[0];
|
|
248
|
+
expect(request.media_type).to.equal('banner');
|
|
242
249
|
});
|
|
243
250
|
|
|
244
251
|
it('should take 1x1 size', function () {
|
|
@@ -258,17 +265,18 @@ describe('RelaidoAdapter', function () {
|
|
|
258
265
|
}
|
|
259
266
|
};
|
|
260
267
|
const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
|
|
261
|
-
|
|
262
|
-
|
|
268
|
+
const data = JSON.parse(bidRequests.data);
|
|
269
|
+
expect(data.bids).to.have.lengthOf(1);
|
|
270
|
+
const request = data.bids[0];
|
|
263
271
|
|
|
264
272
|
expect(request.width).to.equal(1);
|
|
265
273
|
});
|
|
266
274
|
|
|
267
275
|
it('The referrer should be the last', function () {
|
|
268
276
|
const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
const keys = Object.keys(
|
|
277
|
+
const data = JSON.parse(bidRequests.data);
|
|
278
|
+
expect(data.bids).to.have.lengthOf(1);
|
|
279
|
+
const keys = Object.keys(data);
|
|
272
280
|
expect(keys[0]).to.equal('version');
|
|
273
281
|
expect(keys[keys.length - 1]).to.equal('ref');
|
|
274
282
|
});
|
|
@@ -277,9 +285,9 @@ describe('RelaidoAdapter', function () {
|
|
|
277
285
|
bidRequest.userId = {}
|
|
278
286
|
bidRequest.userId.imuid = 'i.tjHcK_7fTcqnbrS_YA2vaw';
|
|
279
287
|
const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
expect(
|
|
288
|
+
const data = JSON.parse(bidRequests.data);
|
|
289
|
+
expect(data.bids).to.have.lengthOf(1);
|
|
290
|
+
expect(data.imuid).to.equal('i.tjHcK_7fTcqnbrS_YA2vaw');
|
|
283
291
|
});
|
|
284
292
|
});
|
|
285
293
|
|
|
@@ -288,29 +296,29 @@ describe('RelaidoAdapter', function () {
|
|
|
288
296
|
const bidResponses = spec.interpretResponse(serverResponse, serverRequest);
|
|
289
297
|
expect(bidResponses).to.have.lengthOf(1);
|
|
290
298
|
const response = bidResponses[0];
|
|
291
|
-
expect(response.requestId).to.equal(serverRequest.bidId);
|
|
292
|
-
expect(response.width).to.equal(serverRequest.width);
|
|
293
|
-
expect(response.height).to.equal(serverRequest.height);
|
|
294
|
-
expect(response.cpm).to.equal(serverResponse.body.price);
|
|
295
|
-
expect(response.currency).to.equal(serverResponse.body.currency);
|
|
296
|
-
expect(response.creativeId).to.equal(serverResponse.body.creativeId);
|
|
297
|
-
expect(response.vastXml).to.equal(serverResponse.body.vast);
|
|
298
|
-
expect(response.meta.advertiserDomains).to.equal(serverResponse.body.adomain);
|
|
299
|
+
expect(response.requestId).to.equal(serverRequest.data.bids[0].bidId);
|
|
300
|
+
expect(response.width).to.equal(serverRequest.data.bids[0].width);
|
|
301
|
+
expect(response.height).to.equal(serverRequest.data.bids[0].height);
|
|
302
|
+
expect(response.cpm).to.equal(serverResponse.body.ads[0].price);
|
|
303
|
+
expect(response.currency).to.equal(serverResponse.body.ads[0].currency);
|
|
304
|
+
expect(response.creativeId).to.equal(serverResponse.body.ads[0].creativeId);
|
|
305
|
+
expect(response.vastXml).to.equal(serverResponse.body.ads[0].vast);
|
|
306
|
+
expect(response.meta.advertiserDomains).to.equal(serverResponse.body.ads[0].adomain);
|
|
299
307
|
expect(response.meta.mediaType).to.equal(VIDEO);
|
|
300
308
|
expect(response.ad).to.be.undefined;
|
|
301
309
|
});
|
|
302
310
|
|
|
303
311
|
it('should build bid response by banner', function () {
|
|
304
|
-
|
|
312
|
+
serverResponse.body.ads[0].mediaType = 'banner';
|
|
305
313
|
const bidResponses = spec.interpretResponse(serverResponse, serverRequest);
|
|
306
314
|
expect(bidResponses).to.have.lengthOf(1);
|
|
307
315
|
const response = bidResponses[0];
|
|
308
|
-
expect(response.requestId).to.equal(serverRequest.bidId);
|
|
309
|
-
expect(response.width).to.equal(serverRequest.width);
|
|
310
|
-
expect(response.height).to.equal(serverRequest.height);
|
|
311
|
-
expect(response.cpm).to.equal(serverResponse.body.price);
|
|
312
|
-
expect(response.currency).to.equal(serverResponse.body.currency);
|
|
313
|
-
expect(response.creativeId).to.equal(serverResponse.body.creativeId);
|
|
316
|
+
expect(response.requestId).to.equal(serverRequest.data.bids[0].bidId);
|
|
317
|
+
expect(response.width).to.equal(serverRequest.data.bids[0].width);
|
|
318
|
+
expect(response.height).to.equal(serverRequest.data.bids[0].height);
|
|
319
|
+
expect(response.cpm).to.equal(serverResponse.body.ads[0].price);
|
|
320
|
+
expect(response.currency).to.equal(serverResponse.body.ads[0].currency);
|
|
321
|
+
expect(response.creativeId).to.equal(serverResponse.body.ads[0].creativeId);
|
|
314
322
|
expect(response.vastXml).to.be.undefined;
|
|
315
323
|
expect(response.ad).to.include(`<div id="rop-prebid">`);
|
|
316
324
|
expect(response.ad).to.include(`<script src="https://relaido/player.js"></script>`);
|
|
@@ -370,8 +378,8 @@ describe('RelaidoAdapter', function () {
|
|
|
370
378
|
it('Should create nurl pixel if bid nurl', function () {
|
|
371
379
|
let bid = {
|
|
372
380
|
bidder: bidRequest.bidder,
|
|
373
|
-
creativeId: serverResponse.body.creativeId,
|
|
374
|
-
cpm: serverResponse.body.price,
|
|
381
|
+
creativeId: serverResponse.body.ads[0].creativeId,
|
|
382
|
+
cpm: serverResponse.body.ads[0].price,
|
|
375
383
|
params: [bidRequest.params],
|
|
376
384
|
auctionId: bidRequest.auctionId,
|
|
377
385
|
requestId: bidRequest.bidId,
|
|
@@ -905,7 +905,7 @@ describe('Richaudience adapter tests', function () {
|
|
|
905
905
|
}, [], {
|
|
906
906
|
consentString: null,
|
|
907
907
|
referer: 'http://domain.com',
|
|
908
|
-
gdprApplies:
|
|
908
|
+
gdprApplies: false
|
|
909
909
|
})
|
|
910
910
|
expect(syncs).to.have.lengthOf(1);
|
|
911
911
|
expect(syncs[0].type).to.equal('image');
|
|
@@ -942,7 +942,7 @@ describe('Richaudience adapter tests', function () {
|
|
|
942
942
|
}, [], {
|
|
943
943
|
consentString: null,
|
|
944
944
|
referer: 'http://domain.com',
|
|
945
|
-
gdprApplies:
|
|
945
|
+
gdprApplies: false
|
|
946
946
|
})
|
|
947
947
|
expect(syncs).to.have.lengthOf(0);
|
|
948
948
|
});
|
|
@@ -1408,7 +1408,7 @@ describe('the rubicon adapter', function () {
|
|
|
1408
1408
|
expect(data['tg_i.pbadslot']).to.equal('abc');
|
|
1409
1409
|
});
|
|
1410
1410
|
|
|
1411
|
-
it('should send \"tg_i.pbadslot\" if \"ortb2Imp.ext.data.pbadslot\" value is a valid string
|
|
1411
|
+
it('should send \"tg_i.pbadslot\" if \"ortb2Imp.ext.data.pbadslot\" value is a valid string', function () {
|
|
1412
1412
|
bidderRequest.bids[0].ortb2Imp = {
|
|
1413
1413
|
ext: {
|
|
1414
1414
|
data: {
|
|
@@ -1422,7 +1422,45 @@ describe('the rubicon adapter', function () {
|
|
|
1422
1422
|
|
|
1423
1423
|
expect(data).to.be.an('Object');
|
|
1424
1424
|
expect(data).to.have.property('tg_i.pbadslot');
|
|
1425
|
-
expect(data['tg_i.pbadslot']).to.equal('a/b/c');
|
|
1425
|
+
expect(data['tg_i.pbadslot']).to.equal('/a/b/c');
|
|
1426
|
+
});
|
|
1427
|
+
|
|
1428
|
+
it('should send gpid as p_gpid if valid', function () {
|
|
1429
|
+
bidderRequest.bids[0].ortb2Imp = {
|
|
1430
|
+
ext: {
|
|
1431
|
+
gpid: '/1233/sports&div1'
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
const [request] = spec.buildRequests(bidderRequest.bids, bidderRequest);
|
|
1436
|
+
const data = parseQuery(request.data);
|
|
1437
|
+
|
|
1438
|
+
expect(data).to.be.an('Object');
|
|
1439
|
+
expect(data).to.have.property('p_gpid');
|
|
1440
|
+
expect(data['p_gpid']).to.equal('/1233/sports&div1');
|
|
1441
|
+
});
|
|
1442
|
+
|
|
1443
|
+
it('should send gpid and pbadslot since it is prefered over dfp code', function () {
|
|
1444
|
+
bidderRequest.bids[0].ortb2Imp = {
|
|
1445
|
+
ext: {
|
|
1446
|
+
gpid: '/1233/sports&div1',
|
|
1447
|
+
data: {
|
|
1448
|
+
pbadslot: 'pb_slot',
|
|
1449
|
+
adserver: {
|
|
1450
|
+
adslot: '/1234/sports',
|
|
1451
|
+
name: 'gam'
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
const [request] = spec.buildRequests(bidderRequest.bids, bidderRequest);
|
|
1458
|
+
const data = parseQuery(request.data);
|
|
1459
|
+
|
|
1460
|
+
expect(data).to.be.an('Object');
|
|
1461
|
+
expect(data['p_gpid']).to.equal('/1233/sports&div1');
|
|
1462
|
+
expect(data).to.not.have.property('tg_i.dfp_ad_unit_code');
|
|
1463
|
+
expect(data['tg_i.pbadslot']).to.equal('pb_slot');
|
|
1426
1464
|
});
|
|
1427
1465
|
});
|
|
1428
1466
|
|
|
@@ -1470,12 +1508,13 @@ describe('the rubicon adapter', function () {
|
|
|
1470
1508
|
expect(data).to.not.have.property('tg_i.dfp_ad_unit_code');
|
|
1471
1509
|
});
|
|
1472
1510
|
|
|
1473
|
-
it('should send \"tg_i.dfp_ad_unit_code\" if \"ortb2Imp.ext.data.adServer.adslot\" value is a valid string', function () {
|
|
1511
|
+
it('should send NOT \"tg_i.dfp_ad_unit_code\" if \"ortb2Imp.ext.data.adServer.adslot\" value is a valid string but not gam', function () {
|
|
1474
1512
|
bidderRequest.bids[0].ortb2Imp = {
|
|
1475
1513
|
ext: {
|
|
1476
1514
|
data: {
|
|
1477
1515
|
adserver: {
|
|
1478
|
-
adslot: '
|
|
1516
|
+
adslot: '/a/b/c',
|
|
1517
|
+
name: 'not gam'
|
|
1479
1518
|
}
|
|
1480
1519
|
}
|
|
1481
1520
|
}
|
|
@@ -1485,16 +1524,16 @@ describe('the rubicon adapter', function () {
|
|
|
1485
1524
|
const data = parseQuery(request.data);
|
|
1486
1525
|
|
|
1487
1526
|
expect(data).to.be.an('Object');
|
|
1488
|
-
expect(data).to.have.property('tg_i.dfp_ad_unit_code');
|
|
1489
|
-
expect(data['tg_i.dfp_ad_unit_code']).to.equal('abc');
|
|
1527
|
+
expect(data).to.not.have.property('tg_i.dfp_ad_unit_code');
|
|
1490
1528
|
});
|
|
1491
1529
|
|
|
1492
|
-
it('should send \"tg_i.dfp_ad_unit_code\" if \"ortb2Imp.ext.data.adServer.adslot\" value is a valid string
|
|
1530
|
+
it('should send \"tg_i.dfp_ad_unit_code\" if \"ortb2Imp.ext.data.adServer.adslot\" value is a valid string and name is gam', function () {
|
|
1493
1531
|
bidderRequest.bids[0].ortb2Imp = {
|
|
1494
1532
|
ext: {
|
|
1495
1533
|
data: {
|
|
1496
1534
|
adserver: {
|
|
1497
|
-
|
|
1535
|
+
name: 'gam',
|
|
1536
|
+
adslot: '/a/b/c'
|
|
1498
1537
|
}
|
|
1499
1538
|
}
|
|
1500
1539
|
}
|
|
@@ -1505,7 +1544,7 @@ describe('the rubicon adapter', function () {
|
|
|
1505
1544
|
|
|
1506
1545
|
expect(data).to.be.an('Object');
|
|
1507
1546
|
expect(data).to.have.property('tg_i.dfp_ad_unit_code');
|
|
1508
|
-
expect(data['tg_i.dfp_ad_unit_code']).to.equal('a/b/c');
|
|
1547
|
+
expect(data['tg_i.dfp_ad_unit_code']).to.equal('/a/b/c');
|
|
1509
1548
|
});
|
|
1510
1549
|
});
|
|
1511
1550
|
});
|
|
@@ -3343,6 +3382,23 @@ describe('the rubicon adapter', function () {
|
|
|
3343
3382
|
type: 'iframe', url: `${emilyUrl}?gdpr_consent=foo&us_privacy=1NYN`
|
|
3344
3383
|
});
|
|
3345
3384
|
});
|
|
3385
|
+
|
|
3386
|
+
it('should pass gdprApplies', function () {
|
|
3387
|
+
expect(spec.getUserSyncs({iframeEnabled: true}, {}, {
|
|
3388
|
+
gdprApplies: true
|
|
3389
|
+
}, '1NYN')).to.deep.equal({
|
|
3390
|
+
type: 'iframe', url: `${emilyUrl}?gdpr=1&us_privacy=1NYN`
|
|
3391
|
+
});
|
|
3392
|
+
});
|
|
3393
|
+
|
|
3394
|
+
it('should pass all correctly', function () {
|
|
3395
|
+
expect(spec.getUserSyncs({iframeEnabled: true}, {}, {
|
|
3396
|
+
gdprApplies: true,
|
|
3397
|
+
consentString: 'foo'
|
|
3398
|
+
}, '1NYN')).to.deep.equal({
|
|
3399
|
+
type: 'iframe', url: `${emilyUrl}?gdpr=1&gdpr_consent=foo&us_privacy=1NYN`
|
|
3400
|
+
});
|
|
3401
|
+
});
|
|
3346
3402
|
});
|
|
3347
3403
|
|
|
3348
3404
|
describe('get price granularity', function () {
|
|
@@ -50,10 +50,10 @@ describe('SharedId System', function () {
|
|
|
50
50
|
expect(callbackSpy.calledOnce).to.be.true;
|
|
51
51
|
expect(callbackSpy.lastCall.lastArg).to.equal(UUID);
|
|
52
52
|
});
|
|
53
|
-
it('should
|
|
53
|
+
it('should abort if coppa is set', function () {
|
|
54
54
|
coppaDataHandlerDataStub.returns('true');
|
|
55
|
-
sharedIdSystemSubmodule.getId({});
|
|
56
|
-
expect(
|
|
55
|
+
const result = sharedIdSystemSubmodule.getId({});
|
|
56
|
+
expect(result).to.be.undefined;
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
59
|
describe('SharedId System extendId()', function () {
|
|
@@ -85,10 +85,56 @@ describe('SharedId System', function () {
|
|
|
85
85
|
let pubcommId = sharedIdSystemSubmodule.extendId(config, undefined, 'TestId').id;
|
|
86
86
|
expect(pubcommId).to.equal('TestId');
|
|
87
87
|
});
|
|
88
|
-
it('should
|
|
88
|
+
it('should abort if coppa is set', function () {
|
|
89
89
|
coppaDataHandlerDataStub.returns('true');
|
|
90
|
-
sharedIdSystemSubmodule.extendId({}, undefined, 'TestId');
|
|
91
|
-
expect(
|
|
90
|
+
const result = sharedIdSystemSubmodule.extendId({params: {extend: true}}, undefined, 'TestId');
|
|
91
|
+
expect(result).to.be.undefined;
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
describe('SharedID System domainOverride', () => {
|
|
96
|
+
let sandbox, domain, cookies, rejectCookiesFor;
|
|
97
|
+
|
|
98
|
+
beforeEach(() => {
|
|
99
|
+
sandbox = sinon.createSandbox();
|
|
100
|
+
sandbox.stub(document, 'domain').get(() => domain);
|
|
101
|
+
cookies = {};
|
|
102
|
+
sandbox.stub(storage, 'getCookie').callsFake((key) => cookies[key]);
|
|
103
|
+
rejectCookiesFor = null;
|
|
104
|
+
sandbox.stub(storage, 'setCookie').callsFake((key, value, expires, sameSite, domain) => {
|
|
105
|
+
if (domain !== rejectCookiesFor) {
|
|
106
|
+
if (expires != null) {
|
|
107
|
+
expires = new Date(expires);
|
|
108
|
+
}
|
|
109
|
+
if (expires == null || expires > Date.now()) {
|
|
110
|
+
cookies[key] = value;
|
|
111
|
+
} else {
|
|
112
|
+
delete cookies[key];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
afterEach(() => {
|
|
119
|
+
sandbox.restore();
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('should return TLD if cookies can be set there', () => {
|
|
123
|
+
domain = 'sub.domain.com';
|
|
124
|
+
rejectCookiesFor = 'com';
|
|
125
|
+
expect(sharedIdSystemSubmodule.domainOverride()).to.equal('domain.com');
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('should return undefined when cookies cannot be set', () => {
|
|
129
|
+
domain = 'sub.domain.com';
|
|
130
|
+
rejectCookiesFor = 'sub.domain.com';
|
|
131
|
+
expect(sharedIdSystemSubmodule.domainOverride()).to.be.undefined;
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('should return half-way domain if parent domain rejects cookies', () => {
|
|
135
|
+
domain = 'inner.outer.domain.com';
|
|
136
|
+
rejectCookiesFor = 'domain.com';
|
|
137
|
+
expect(sharedIdSystemSubmodule.domainOverride()).to.equal('outer.domain.com');
|
|
92
138
|
});
|
|
93
139
|
});
|
|
94
140
|
});
|
|
@@ -294,6 +294,16 @@ describe('smaatoBidAdapterTest', () => {
|
|
|
294
294
|
expect(req.source.ext.schain).to.not.exist;
|
|
295
295
|
});
|
|
296
296
|
|
|
297
|
+
it('sends instl if instl exists', () => {
|
|
298
|
+
const instl = { instl: 1 };
|
|
299
|
+
const bidRequestWithInstl = Object.assign({}, singleBannerBidRequest, {ortb2Imp: instl});
|
|
300
|
+
|
|
301
|
+
const reqs = spec.buildRequests([bidRequestWithInstl], defaultBidderRequest);
|
|
302
|
+
|
|
303
|
+
const req = extractPayloadOfFirstAndOnlyRequest(reqs);
|
|
304
|
+
expect(req.imp[0].instl).to.equal(1);
|
|
305
|
+
});
|
|
306
|
+
|
|
297
307
|
it('sends tmax', () => {
|
|
298
308
|
const reqs = spec.buildRequests([singleBannerBidRequest], defaultBidderRequest);
|
|
299
309
|
|
|
@@ -442,6 +452,16 @@ describe('smaatoBidAdapterTest', () => {
|
|
|
442
452
|
expect(req.imp[0].bidfloor).to.be.equal(0.456);
|
|
443
453
|
});
|
|
444
454
|
|
|
455
|
+
it('sends instl if instl exists', () => {
|
|
456
|
+
const instl = { instl: 1 };
|
|
457
|
+
const bidRequestWithInstl = Object.assign({}, singleVideoBidRequest, {ortb2Imp: instl});
|
|
458
|
+
|
|
459
|
+
const reqs = spec.buildRequests([bidRequestWithInstl], defaultBidderRequest);
|
|
460
|
+
|
|
461
|
+
const req = extractPayloadOfFirstAndOnlyRequest(reqs);
|
|
462
|
+
expect(req.imp[0].instl).to.equal(1);
|
|
463
|
+
});
|
|
464
|
+
|
|
445
465
|
it('splits multi format bid requests', () => {
|
|
446
466
|
const combinedBannerAndVideoBidRequest = {
|
|
447
467
|
bidder: 'smaato',
|
|
@@ -523,6 +543,17 @@ describe('smaatoBidAdapterTest', () => {
|
|
|
523
543
|
expect(req.imp[1].video.sequence).to.be.equal(2);
|
|
524
544
|
});
|
|
525
545
|
|
|
546
|
+
it('sends instl if instl exists', () => {
|
|
547
|
+
const instl = { instl: 1 };
|
|
548
|
+
const bidRequestWithInstl = Object.assign({}, longFormVideoBidRequest, {ortb2Imp: instl});
|
|
549
|
+
|
|
550
|
+
const reqs = spec.buildRequests([bidRequestWithInstl], defaultBidderRequest);
|
|
551
|
+
|
|
552
|
+
const req = extractPayloadOfFirstAndOnlyRequest(reqs);
|
|
553
|
+
expect(req.imp[0].instl).to.equal(1);
|
|
554
|
+
expect(req.imp[1].instl).to.equal(1);
|
|
555
|
+
});
|
|
556
|
+
|
|
526
557
|
it('sends bidfloor when configured', () => {
|
|
527
558
|
const longFormVideoBidRequestWithFloor = Object.assign({}, longFormVideoBidRequest);
|
|
528
559
|
longFormVideoBidRequestWithFloor.getFloor = function(arg) {
|
|
@@ -189,6 +189,14 @@ describe('The smartx adapter', function () {
|
|
|
189
189
|
domain: '',
|
|
190
190
|
publisher: {
|
|
191
191
|
id: '__name__'
|
|
192
|
+
},
|
|
193
|
+
content: {
|
|
194
|
+
ext: {
|
|
195
|
+
prebid: {
|
|
196
|
+
name: 'pbjs',
|
|
197
|
+
version: '$prebid.version$'
|
|
198
|
+
}
|
|
199
|
+
}
|
|
192
200
|
}
|
|
193
201
|
});
|
|
194
202
|
});
|
|
@@ -525,6 +533,7 @@ describe('The smartx adapter', function () {
|
|
|
525
533
|
bidderRequestObj.bidRequest.bids[0].params.outstream_options.title = 'abc';
|
|
526
534
|
bidderRequestObj.bidRequest.bids[0].params.outstream_options.skipOffset = 2;
|
|
527
535
|
bidderRequestObj.bidRequest.bids[0].params.outstream_options.desiredBitrate = 123;
|
|
536
|
+
bidderRequestObj.bidRequest.bids[0].params.outstream_options.visibilityThreshold = 30;
|
|
528
537
|
|
|
529
538
|
responses[0].renderer.render(responses[0]);
|
|
530
539
|
|
|
@@ -183,6 +183,10 @@ describe('Tappx bid adapter', function () {
|
|
|
183
183
|
badBidRequest_v.bids.mediaTypes.video.playerSize = [320, 250];
|
|
184
184
|
assert.isFalse(spec.isBidRequestValid(badBidRequest_v.bids));
|
|
185
185
|
});
|
|
186
|
+
|
|
187
|
+
it('should export the TCF vendor ID', function () {
|
|
188
|
+
expect(spec.gvlid).to.equal(628);
|
|
189
|
+
})
|
|
186
190
|
});
|
|
187
191
|
|
|
188
192
|
/**
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { spec } from '../../../modules/targetVideoBidAdapter.js'
|
|
2
|
+
|
|
3
|
+
describe('TargetVideo Bid Adapter', function() {
|
|
4
|
+
const bannerRequest = [{
|
|
5
|
+
bidder: 'targetVideo',
|
|
6
|
+
mediaTypes: {
|
|
7
|
+
banner: {
|
|
8
|
+
sizes: [[300, 250]],
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
params: {
|
|
12
|
+
placementId: 12345,
|
|
13
|
+
}
|
|
14
|
+
}];
|
|
15
|
+
|
|
16
|
+
it('Test the bid validation function', function() {
|
|
17
|
+
const validBid = spec.isBidRequestValid(bannerRequest[0]);
|
|
18
|
+
const invalidBid = spec.isBidRequestValid(null);
|
|
19
|
+
|
|
20
|
+
expect(validBid).to.be.true;
|
|
21
|
+
expect(invalidBid).to.be.false;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('Test the request processing function', function () {
|
|
25
|
+
const request = spec.buildRequests(bannerRequest, bannerRequest[0]);
|
|
26
|
+
expect(request).to.not.be.empty;
|
|
27
|
+
|
|
28
|
+
const payload = JSON.parse(request.data);
|
|
29
|
+
expect(payload).to.not.be.empty;
|
|
30
|
+
expect(payload.sdk).to.deep.equal({
|
|
31
|
+
source: 'pbjs',
|
|
32
|
+
version: '$prebid.version$'
|
|
33
|
+
});
|
|
34
|
+
expect(payload.tags[0].id).to.equal(12345);
|
|
35
|
+
expect(payload.tags[0].gpid).to.equal('targetVideo');
|
|
36
|
+
expect(payload.tags[0].ad_types[0]).to.equal('video');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('Handle nobid responses', function () {
|
|
40
|
+
const responseBody = {
|
|
41
|
+
'version': '0.0.1',
|
|
42
|
+
'tags': [{
|
|
43
|
+
'uuid': '84ab500420319d',
|
|
44
|
+
'tag_id': 5976557,
|
|
45
|
+
'auction_id': '297492697822162468',
|
|
46
|
+
'nobid': true
|
|
47
|
+
}]
|
|
48
|
+
};
|
|
49
|
+
const bidderRequest = null;
|
|
50
|
+
|
|
51
|
+
const bidResponse = spec.interpretResponse({ body: responseBody }, {bidderRequest});
|
|
52
|
+
expect(bidResponse.length).to.equal(0);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('Test the response parsing function', function () {
|
|
56
|
+
const responseBody = {
|
|
57
|
+
'tags': [{
|
|
58
|
+
'uuid': '84ab500420319d',
|
|
59
|
+
'ads': [{
|
|
60
|
+
'ad_type': 'video',
|
|
61
|
+
'cpm': 0.500000,
|
|
62
|
+
'notify_url': 'https://www.target-video.com/',
|
|
63
|
+
'rtb': {
|
|
64
|
+
'video': {
|
|
65
|
+
'player_width': 640,
|
|
66
|
+
'player_height': 360,
|
|
67
|
+
'asset_url': 'https://www.target-video.com/'
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}]
|
|
71
|
+
}]
|
|
72
|
+
};
|
|
73
|
+
const bidderRequest = {
|
|
74
|
+
bids: [{
|
|
75
|
+
bidId: '84ab500420319d',
|
|
76
|
+
adUnitCode: 'code',
|
|
77
|
+
mediaTypes: {
|
|
78
|
+
banner: {
|
|
79
|
+
sizes: [[300, 250]]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}]
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const bidResponse = spec.interpretResponse({ body: responseBody }, {bidderRequest});
|
|
86
|
+
expect(bidResponse).to.not.be.empty;
|
|
87
|
+
|
|
88
|
+
const bid = bidResponse[0];
|
|
89
|
+
expect(bid).to.not.be.empty;
|
|
90
|
+
expect(bid.cpm).to.equal(0.675);
|
|
91
|
+
expect(bid.width).to.equal(300);
|
|
92
|
+
expect(bid.height).to.equal(250);
|
|
93
|
+
expect(bid.ad).to.include('<script src="https://player.target-video.com/custom/targetvideo-banner.js"></script>')
|
|
94
|
+
expect(bid.ad).to.include('initPlayer')
|
|
95
|
+
});
|
|
96
|
+
});
|