prebid.js 8.7.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/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.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/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/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 +4 -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/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/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 +138 -137
- 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/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/admaticBidAdapter.js +5 -0
- package/modules/adqueryBidAdapter.js +23 -21
- package/modules/adqueryIdSystem.js +45 -30
- package/modules/adrelevantisBidAdapter.js +2 -0
- package/modules/bidViewability.js +7 -0
- package/modules/bidViewability.md +9 -8
- package/modules/brandmetricsRtdProvider.js +30 -27
- package/modules/criteoBidAdapter.js +66 -43
- package/modules/geoedgeRtdProvider.js +43 -13
- package/modules/geoedgeRtdProvider.md +2 -1
- package/modules/liveIntentIdSystem.js +16 -1
- 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/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/topicsFpdModule.js +35 -9
- 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/admaticBidAdapter_spec.js +5 -0
- package/test/spec/modules/adqueryIdSystem_spec.js +13 -24
- package/test/spec/modules/bidViewability_spec.js +32 -1
- package/test/spec/modules/brandmetricsRtdProvider_spec.js +6 -0
- package/test/spec/modules/criteoBidAdapter_spec.js +228 -0
- package/test/spec/modules/eids_spec.js +48 -0
- package/test/spec/modules/geoedgeRtdProvider_spec.js +44 -24
- package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +5 -0
- package/test/spec/modules/liveIntentIdSystem_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/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/topicsFpdModule_spec.js +102 -1
- package/test/spec/modules/visxBidAdapter_spec.js +151 -1
- package/test/spec/native_spec.js +5 -3
|
@@ -271,6 +271,39 @@ describe('eids array generation for known sub-modules', function() {
|
|
|
271
271
|
});
|
|
272
272
|
});
|
|
273
273
|
|
|
274
|
+
it('index', function() {
|
|
275
|
+
const userId = {
|
|
276
|
+
index: {'id': 'sample_id'}
|
|
277
|
+
};
|
|
278
|
+
const newEids = createEidsArray(userId);
|
|
279
|
+
expect(newEids.length).to.equal(1);
|
|
280
|
+
expect(newEids[0]).to.deep.equal({
|
|
281
|
+
source: 'liveintent.indexexchange.com',
|
|
282
|
+
uids: [{
|
|
283
|
+
id: 'sample_id',
|
|
284
|
+
atype: 3
|
|
285
|
+
}]
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
it('index with ext', function() {
|
|
290
|
+
const userId = {
|
|
291
|
+
index: {'id': 'sample_id', 'ext': {'provider': 'some.provider.com'}}
|
|
292
|
+
};
|
|
293
|
+
const newEids = createEidsArray(userId);
|
|
294
|
+
expect(newEids.length).to.equal(1);
|
|
295
|
+
expect(newEids[0]).to.deep.equal({
|
|
296
|
+
source: 'liveintent.indexexchange.com',
|
|
297
|
+
uids: [{
|
|
298
|
+
id: 'sample_id',
|
|
299
|
+
atype: 3,
|
|
300
|
+
ext: {
|
|
301
|
+
provider: 'some.provider.com'
|
|
302
|
+
}
|
|
303
|
+
}]
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
|
|
274
307
|
it('liveIntentId; getValue call and NO ext', function() {
|
|
275
308
|
const userId = {
|
|
276
309
|
lipb: {
|
|
@@ -547,6 +580,21 @@ describe('eids array generation for known sub-modules', function() {
|
|
|
547
580
|
});
|
|
548
581
|
});
|
|
549
582
|
|
|
583
|
+
it('operaId', function() {
|
|
584
|
+
const userId = {
|
|
585
|
+
operaId: 'some-random-id-value'
|
|
586
|
+
};
|
|
587
|
+
const newEids = createEidsArray(userId);
|
|
588
|
+
expect(newEids.length).to.equal(1);
|
|
589
|
+
expect(newEids[0]).to.deep.equal({
|
|
590
|
+
source: 't.adx.opera.com',
|
|
591
|
+
uids: [{
|
|
592
|
+
id: 'some-random-id-value',
|
|
593
|
+
atype: 1
|
|
594
|
+
}]
|
|
595
|
+
});
|
|
596
|
+
});
|
|
597
|
+
|
|
550
598
|
it('33acrossId', function() {
|
|
551
599
|
const userId = {
|
|
552
600
|
'33acrossId': {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as utils from '../../../src/utils.js';
|
|
2
|
+
import { loadExternalScript } from '../../../src/adloader.js';
|
|
2
3
|
import * as hook from '../../../src/hook.js'
|
|
3
|
-
import { beforeInit, geoedgeSubmodule, setWrapper, wrapper, htmlPlaceholder, WRAPPER_URL, getClientUrl } from '../../../modules/geoedgeRtdProvider.js';
|
|
4
|
+
import { beforeInit, geoedgeSubmodule, setWrapper, wrapper, htmlPlaceholder, WRAPPER_URL, getClientUrl, getInPageUrl } from '../../../modules/geoedgeRtdProvider.js';
|
|
4
5
|
import { server } from '../../../test/mocks/xhr.js';
|
|
5
6
|
import * as events from '../../../src/events.js';
|
|
6
7
|
import CONSTANTS from '../../../src/constants.json';
|
|
7
8
|
|
|
8
9
|
let key = '123123123';
|
|
9
|
-
function makeConfig() {
|
|
10
|
+
function makeConfig(gpt) {
|
|
10
11
|
return {
|
|
11
12
|
name: 'geoedge',
|
|
12
13
|
params: {
|
|
@@ -15,7 +16,8 @@ function makeConfig() {
|
|
|
15
16
|
bidders: {
|
|
16
17
|
bidderA: true,
|
|
17
18
|
bidderB: false
|
|
18
|
-
}
|
|
19
|
+
},
|
|
20
|
+
gpt: gpt
|
|
19
21
|
}
|
|
20
22
|
};
|
|
21
23
|
}
|
|
@@ -23,6 +25,7 @@ function makeConfig() {
|
|
|
23
25
|
function mockBid(bidderCode) {
|
|
24
26
|
return {
|
|
25
27
|
'ad': '<creative/>',
|
|
28
|
+
'adId': '1234',
|
|
26
29
|
'cpm': '1.00',
|
|
27
30
|
'width': 300,
|
|
28
31
|
'height': 250,
|
|
@@ -35,6 +38,15 @@ function mockBid(bidderCode) {
|
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
40
|
|
|
41
|
+
function mockMessageFromClient(key) {
|
|
42
|
+
return {
|
|
43
|
+
key,
|
|
44
|
+
impression: true,
|
|
45
|
+
adId: 1234,
|
|
46
|
+
type: 'impression'
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
38
50
|
let mockWrapper = `<wrapper>${htmlPlaceholder}</wrapper>`;
|
|
39
51
|
|
|
40
52
|
describe('Geoedge RTD module', function () {
|
|
@@ -47,22 +59,11 @@ describe('Geoedge RTD module', function () {
|
|
|
47
59
|
after(function () {
|
|
48
60
|
submoduleStub.restore();
|
|
49
61
|
});
|
|
50
|
-
it('should fetch the wrapper', function () {
|
|
51
|
-
beforeInit();
|
|
52
|
-
let request = server.requests[0];
|
|
53
|
-
let isWrapperRequest = request && request.url && request.url && request.url === WRAPPER_URL;
|
|
54
|
-
expect(isWrapperRequest).to.equal(true);
|
|
55
|
-
});
|
|
56
62
|
it('should register RTD submodule provider', function () {
|
|
63
|
+
beforeInit();
|
|
57
64
|
expect(submoduleStub.calledWith('realTimeData', geoedgeSubmodule)).to.equal(true);
|
|
58
65
|
});
|
|
59
66
|
});
|
|
60
|
-
describe('setWrapper', function () {
|
|
61
|
-
it('should set the wrapper', function () {
|
|
62
|
-
setWrapper(mockWrapper);
|
|
63
|
-
expect(wrapper).to.equal(mockWrapper);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
67
|
describe('submodule', function () {
|
|
67
68
|
describe('name', function () {
|
|
68
69
|
it('should be geoedge', function () {
|
|
@@ -84,35 +85,54 @@ describe('Geoedge RTD module', function () {
|
|
|
84
85
|
expect(missingParams || missingKey).to.equal(false);
|
|
85
86
|
});
|
|
86
87
|
it('should return true when params are ok', function () {
|
|
87
|
-
expect(geoedgeSubmodule.init(makeConfig())).to.equal(true);
|
|
88
|
+
expect(geoedgeSubmodule.init(makeConfig(false))).to.equal(true);
|
|
89
|
+
});
|
|
90
|
+
it('should fetch the wrapper', function () {
|
|
91
|
+
geoedgeSubmodule.init(makeConfig(false));
|
|
92
|
+
let request = server.requests[0];
|
|
93
|
+
let isWrapperRequest = request && request.url && request.url && request.url === WRAPPER_URL;
|
|
94
|
+
expect(isWrapperRequest).to.equal(true);
|
|
88
95
|
});
|
|
89
96
|
it('should preload the client', function () {
|
|
90
97
|
let isLinkPreloadAsScript = arg => arg.tagName === 'LINK' && arg.rel === 'preload' && arg.as === 'script' && arg.href === getClientUrl(key);
|
|
91
98
|
expect(insertElementStub.calledWith(sinon.match(isLinkPreloadAsScript))).to.equal(true);
|
|
92
99
|
});
|
|
93
|
-
it('should emit billable events with applicable winning bids', function () {
|
|
94
|
-
let applicableBid = mockBid('bidderA');
|
|
95
|
-
let nonApplicableBid = mockBid('bidderB');
|
|
100
|
+
it('should emit billable events with applicable winning bids', function (done) {
|
|
96
101
|
let counter = 0;
|
|
97
102
|
events.on(CONSTANTS.EVENTS.BILLABLE_EVENT, function (event) {
|
|
98
103
|
if (event.vendor === 'geoedge' && event.type === 'impression') {
|
|
99
104
|
counter += 1;
|
|
100
105
|
}
|
|
106
|
+
expect(counter).to.equal(1);
|
|
107
|
+
done();
|
|
101
108
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
109
|
+
window.postMessage(mockMessageFromClient(key), '*');
|
|
110
|
+
});
|
|
111
|
+
it('should load the in page code when gpt params is true', function () {
|
|
112
|
+
geoedgeSubmodule.init(makeConfig(true));
|
|
113
|
+
let isInPageUrl = arg => arg == getInPageUrl(key);
|
|
114
|
+
expect(loadExternalScript.calledWith(sinon.match(isInPageUrl))).to.equal(true);
|
|
115
|
+
});
|
|
116
|
+
it('should set the window.grumi config object when gpt params is true', function () {
|
|
117
|
+
let hasGrumiObj = typeof window.grumi === 'object';
|
|
118
|
+
expect(hasGrumiObj && window.grumi.key === key && window.grumi.fromPrebid).to.equal(true);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
describe('setWrapper', function () {
|
|
122
|
+
it('should set the wrapper', function () {
|
|
123
|
+
setWrapper(mockWrapper);
|
|
124
|
+
expect(wrapper).to.equal(mockWrapper);
|
|
105
125
|
});
|
|
106
126
|
});
|
|
107
127
|
describe('onBidResponseEvent', function () {
|
|
108
128
|
let bidFromA = mockBid('bidderA');
|
|
109
129
|
it('should wrap bid html when bidder is configured', function () {
|
|
110
|
-
geoedgeSubmodule.onBidResponseEvent(bidFromA, makeConfig());
|
|
130
|
+
geoedgeSubmodule.onBidResponseEvent(bidFromA, makeConfig(false));
|
|
111
131
|
expect(bidFromA.ad.indexOf('<wrapper>')).to.equal(0);
|
|
112
132
|
});
|
|
113
133
|
it('should not wrap bid html when bidder is not configured', function () {
|
|
114
134
|
let bidFromB = mockBid('bidderB');
|
|
115
|
-
geoedgeSubmodule.onBidResponseEvent(bidFromB, makeConfig());
|
|
135
|
+
geoedgeSubmodule.onBidResponseEvent(bidFromB, makeConfig(false));
|
|
116
136
|
expect(bidFromB.ad.indexOf('<wrapper>')).to.equal(-1);
|
|
117
137
|
});
|
|
118
138
|
it('should only muatate the bid ad porperty', function () {
|
|
@@ -266,6 +266,11 @@ describe('LiveIntentMinimalId', function() {
|
|
|
266
266
|
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'magnite': 'bar'}, 'magnite': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
|
|
267
267
|
});
|
|
268
268
|
|
|
269
|
+
it('should decode an index id to a seperate object when present', function() {
|
|
270
|
+
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', index: 'bar' });
|
|
271
|
+
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'index': 'bar'}, 'index': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
|
|
272
|
+
});
|
|
273
|
+
|
|
269
274
|
it('should allow disabling nonId resolution', function() {
|
|
270
275
|
let callBackSpy = sinon.spy();
|
|
271
276
|
let submoduleCallback = liveIntentIdSubmodule.getId({ params: {
|
|
@@ -378,6 +378,11 @@ describe('LiveIntentId', function() {
|
|
|
378
378
|
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'magnite': 'bar'}, 'magnite': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
|
|
379
379
|
});
|
|
380
380
|
|
|
381
|
+
it('should decode an index id to a seperate object when present', function() {
|
|
382
|
+
const result = liveIntentIdSubmodule.decode({ nonId: 'foo', index: 'bar' });
|
|
383
|
+
expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'index': 'bar'}, 'index': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
|
|
384
|
+
});
|
|
385
|
+
|
|
381
386
|
it('should allow disabling nonId resolution', function() {
|
|
382
387
|
let callBackSpy = sinon.spy();
|
|
383
388
|
let submoduleCallback = liveIntentIdSubmodule.getId({ params: {
|
|
@@ -112,7 +112,7 @@ describe('nativoBidAdapterTests', function () {
|
|
|
112
112
|
bidRequests = [JSON.parse(bidRequestString)]
|
|
113
113
|
})
|
|
114
114
|
|
|
115
|
-
it('
|
|
115
|
+
it('Request should be POST, with JSON string payload and QS params should be added to the url', function () {
|
|
116
116
|
const request = spec.buildRequests(bidRequests, {
|
|
117
117
|
bidderRequestId: 123456,
|
|
118
118
|
refererInfo: {
|
|
@@ -120,6 +120,11 @@ describe('nativoBidAdapterTests', function () {
|
|
|
120
120
|
},
|
|
121
121
|
})
|
|
122
122
|
|
|
123
|
+
expect(request.method).to.equal('POST')
|
|
124
|
+
|
|
125
|
+
expect(request.data).to.exist
|
|
126
|
+
expect(request.data).to.be.a('string')
|
|
127
|
+
|
|
123
128
|
expect(request.url).to.exist
|
|
124
129
|
expect(request.url).to.be.a('string')
|
|
125
130
|
|
|
@@ -312,6 +312,75 @@ describe('onetag', function () {
|
|
|
312
312
|
expect(payload.usPrivacy).to.exist;
|
|
313
313
|
expect(payload.usPrivacy).to.exist.and.to.equal(consentString);
|
|
314
314
|
});
|
|
315
|
+
it('Should send FPD (ortb2 field)', function () {
|
|
316
|
+
const firtPartyData = {
|
|
317
|
+
// this is where the contextual data is placed
|
|
318
|
+
site: {
|
|
319
|
+
name: 'example',
|
|
320
|
+
domain: 'page.example.com',
|
|
321
|
+
// OpenRTB 2.5 spec / Content Taxonomy
|
|
322
|
+
cat: ['IAB2'],
|
|
323
|
+
sectioncat: ['IAB2-2'],
|
|
324
|
+
pagecat: ['IAB2-2'],
|
|
325
|
+
page: 'https://page.example.com/here.html',
|
|
326
|
+
ref: 'https://ref.example.com',
|
|
327
|
+
keywords: 'power tools, drills',
|
|
328
|
+
search: 'drill',
|
|
329
|
+
content: {
|
|
330
|
+
userrating: '4',
|
|
331
|
+
data: [{
|
|
332
|
+
name: 'www.dataprovider1.com', // who resolved the segments
|
|
333
|
+
ext: {
|
|
334
|
+
segtax: 7, // taxonomy used to encode the segments
|
|
335
|
+
cids: ['iris_c73g5jq96mwso4d8']
|
|
336
|
+
},
|
|
337
|
+
// the bare minimum are the IDs. These IDs are the ones from the new IAB Content Taxonomy v3
|
|
338
|
+
segment: [ { id: '687' }, { id: '123' } ]
|
|
339
|
+
}]
|
|
340
|
+
},
|
|
341
|
+
ext: {
|
|
342
|
+
data: { // fields that aren't part of openrtb 2.6
|
|
343
|
+
pageType: 'article',
|
|
344
|
+
category: 'repair'
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
// this is where the user data is placed
|
|
349
|
+
user: {
|
|
350
|
+
keywords: 'a,b',
|
|
351
|
+
data: [{
|
|
352
|
+
name: 'dataprovider.com',
|
|
353
|
+
ext: {
|
|
354
|
+
segtax: 4
|
|
355
|
+
},
|
|
356
|
+
segment: [{
|
|
357
|
+
id: '1'
|
|
358
|
+
}]
|
|
359
|
+
}],
|
|
360
|
+
ext: {
|
|
361
|
+
data: {
|
|
362
|
+
registered: true,
|
|
363
|
+
interests: ['cars']
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
regs: {
|
|
368
|
+
gpp: 'abc1234',
|
|
369
|
+
gpp_sid: [7]
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
let bidderRequest = {
|
|
373
|
+
'bidderCode': 'onetag',
|
|
374
|
+
'auctionId': '1d1a030790a475',
|
|
375
|
+
'bidderRequestId': '22edbae2733bf6',
|
|
376
|
+
'timeout': 3000,
|
|
377
|
+
'ortb2': firtPartyData
|
|
378
|
+
}
|
|
379
|
+
let serverRequest = spec.buildRequests([bannerBid], bidderRequest);
|
|
380
|
+
const payload = JSON.parse(serverRequest.data);
|
|
381
|
+
expect(payload.ortb2).to.exist;
|
|
382
|
+
expect(payload.ortb2).to.exist.and.to.deep.equal(firtPartyData);
|
|
383
|
+
});
|
|
315
384
|
});
|
|
316
385
|
describe('interpretResponse', function () {
|
|
317
386
|
const request = getBannerVideoRequest();
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { operaIdSubmodule } from 'modules/operaadsIdSystem'
|
|
2
|
+
import * as ajaxLib from 'src/ajax.js'
|
|
3
|
+
|
|
4
|
+
const TEST_ID = 'opera-test-id';
|
|
5
|
+
const operaIdRemoteResponse = { uid: TEST_ID };
|
|
6
|
+
|
|
7
|
+
describe('operaId submodule properties', () => {
|
|
8
|
+
it('should expose a "name" property equal to "operaId"', () => {
|
|
9
|
+
expect(operaIdSubmodule.name).to.equal('operaId');
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
function fakeRequest(fn) {
|
|
14
|
+
const ajaxBuilderStub = sinon.stub(ajaxLib, 'ajaxBuilder').callsFake(() => {
|
|
15
|
+
return (url, cbObj) => {
|
|
16
|
+
cbObj.success(JSON.stringify(operaIdRemoteResponse));
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
fn();
|
|
20
|
+
ajaxBuilderStub.restore();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
describe('operaId submodule getId', function() {
|
|
24
|
+
it('request to the fake server to correctly extract test ID', function() {
|
|
25
|
+
fakeRequest(() => {
|
|
26
|
+
const moduleIdCallbackResponse = operaIdSubmodule.getId({ params: { pid: 'pub123' } });
|
|
27
|
+
moduleIdCallbackResponse.callback((id) => {
|
|
28
|
+
expect(id).to.equal(operaIdRemoteResponse.operaId);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('request to the fake server without publiser ID', function() {
|
|
34
|
+
fakeRequest(() => {
|
|
35
|
+
const moduleIdCallbackResponse = operaIdSubmodule.getId({ params: {} });
|
|
36
|
+
expect(moduleIdCallbackResponse).to.equal(undefined);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe('operaId submodule decode', function() {
|
|
42
|
+
it('should respond with an object containing "operaId" as key with the value', () => {
|
|
43
|
+
expect(operaIdSubmodule.decode(TEST_ID)).to.deep.equal({
|
|
44
|
+
operaId: TEST_ID
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('should respond with undefined if the value is not a string or an empty string', () => {
|
|
49
|
+
[1, 2.0, null, undefined, NaN, [], {}].forEach((value) => {
|
|
50
|
+
expect(operaIdSubmodule.decode(value)).to.equal(undefined);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -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;
|