prebid.js 6.5.0 → 6.9.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/.eslintrc.js +8 -1
- package/integrationExamples/gpt/amp/creative.html +11 -33
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +154 -115
- package/integrationExamples/gpt/x-domain/creative.html +63 -29
- package/modules/.submodules.json +2 -1
- package/modules/adagioBidAdapter.js +0 -8
- package/modules/adagioBidAdapter.md +1 -1
- package/modules/adbookpspBidAdapter.js +27 -10
- package/modules/adhashBidAdapter.js +3 -3
- package/modules/adkernelBidAdapter.js +2 -1
- package/modules/admanBidAdapter.js +10 -4
- package/modules/adomikAnalyticsAdapter.js +23 -11
- package/modules/adqueryIdSystem.js +103 -0
- package/modules/adqueryIdSystem.md +35 -0
- package/modules/appnexusBidAdapter.js +14 -2
- package/modules/asealBidAdapter.js +58 -0
- package/modules/asealBidAdapter.md +52 -0
- package/modules/bliinkBidAdapter.js +2 -1
- package/modules/brandmetricsRtdProvider.js +168 -0
- package/modules/brandmetricsRtdProvider.md +40 -0
- package/modules/colossussspBidAdapter.js +12 -8
- package/modules/colossussspBidAdapter.md +15 -1
- package/modules/compassBidAdapter.js +10 -3
- package/modules/consumableBidAdapter.md +1 -1
- package/modules/conversantBidAdapter.js +7 -0
- package/modules/criteoBidAdapter.js +10 -1
- package/modules/criteoIdSystem.js +29 -7
- package/modules/currency.js +26 -1
- package/modules/displayioBidAdapter.js +157 -0
- package/modules/displayioBidAdapter.md +148 -0
- package/modules/e_volutionBidAdapter.js +158 -0
- package/modules/glimpseBidAdapter.js +66 -44
- package/modules/gnetBidAdapter.js +3 -3
- package/modules/gnetBidAdapter.md +4 -4
- package/modules/gumgumBidAdapter.js +56 -42
- package/modules/idImportLibrary.js +45 -8
- package/modules/idImportLibrary.md +4 -0
- package/modules/improvedigitalBidAdapter.js +29 -2
- package/modules/interactiveOffersBidAdapter.js +9 -6
- package/modules/jwplayerRtdProvider.js +71 -6
- package/modules/jwplayerRtdProvider.md +27 -11
- package/modules/kargoBidAdapter.js +2 -2
- package/modules/lunamediahbBidAdapter.js +32 -4
- package/modules/nextMillenniumBidAdapter.js +3 -1
- package/modules/oguryBidAdapter.js +14 -14
- package/modules/onetagBidAdapter.js +4 -2
- package/modules/pilotxBidAdapter.js +147 -0
- package/modules/pilotxBidAdapter.md +50 -0
- package/modules/priceFloors.js +2 -1
- package/modules/proxistoreBidAdapter.js +0 -2
- package/modules/pubmaticAnalyticsAdapter.js +16 -0
- package/modules/richaudienceBidAdapter.js +10 -4
- package/modules/riseBidAdapter.js +18 -7
- package/modules/rtbhouseBidAdapter.js +14 -4
- package/modules/rtdModule/index.js +14 -15
- package/modules/rubiconAnalyticsAdapter.js +8 -2
- package/modules/seedingAllianceBidAdapter.js +3 -3
- package/modules/sharethroughBidAdapter.js +12 -17
- package/modules/showheroes-bsBidAdapter.js +13 -2
- package/modules/sortableAnalyticsAdapter.js +5 -4
- package/modules/sovrnBidAdapter.js +93 -18
- package/modules/sovrnBidAdapter.md +80 -2
- package/modules/synacormediaBidAdapter.js +31 -10
- package/modules/tappxBidAdapter.js +8 -5
- package/modules/teadsBidAdapter.js +1 -2
- package/modules/undertoneBidAdapter.js +17 -1
- package/modules/userId/eids.js +7 -1
- package/modules/userId/userId.md +8 -0
- package/modules/viewability.js +177 -0
- package/modules/viewability.md +87 -0
- package/modules/weboramaRtdProvider.js +264 -34
- package/modules/weboramaRtdProvider.md +110 -40
- package/modules/welectBidAdapter.js +106 -0
- package/modules/yahoosspBidAdapter.js +2 -0
- package/package.json +2 -1
- package/src/adRendering.js +38 -0
- package/src/adloader.js +2 -1
- package/src/auction.js +103 -73
- package/src/bidderSettings.js +69 -0
- package/src/hook.js +5 -1
- package/src/prebid.js +19 -21
- package/src/secureCreatives.js +131 -47
- package/src/targeting.js +3 -2
- package/src/utils.js +13 -10
- package/test/helpers/syncPromise.js +71 -0
- package/test/spec/auctionmanager_spec.js +179 -15
- package/test/spec/modules/adagioBidAdapter_spec.js +0 -10
- package/test/spec/modules/adbookpspBidAdapter_spec.js +17 -3
- package/test/spec/modules/adhashBidAdapter_spec.js +2 -2
- package/test/spec/modules/admanBidAdapter_spec.js +2 -2
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +3 -1
- package/test/spec/modules/adqueryIdSystem_spec.js +74 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +27 -0
- package/test/spec/modules/asealBidAdapter_spec.js +144 -0
- package/test/spec/modules/bliinkBidAdapter_spec.js +2 -0
- package/test/spec/modules/brandmetricsRtdProvider_spec.js +191 -0
- package/test/spec/modules/colossussspBidAdapter_spec.js +5 -2
- package/test/spec/modules/compassBidAdapter_spec.js +1 -0
- package/test/spec/modules/conversantBidAdapter_spec.js +54 -2
- package/test/spec/modules/criteoBidAdapter_spec.js +21 -0
- package/test/spec/modules/criteoIdSystem_spec.js +6 -3
- package/test/spec/modules/currency_spec.js +21 -6
- package/test/spec/modules/displayioBidAdapter_spec.js +239 -0
- package/test/spec/modules/e_volutionBidAdapter_spec.js +242 -0
- package/test/spec/modules/eids_spec.js +15 -0
- package/test/spec/modules/glimpseBidAdapter_spec.js +0 -18
- package/test/spec/modules/gnetBidAdapter_spec.js +6 -6
- package/test/spec/modules/gumgumBidAdapter_spec.js +46 -0
- package/test/spec/modules/idImportLibrary_spec.js +197 -10
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +61 -0
- package/test/spec/modules/jwplayerRtdProvider_spec.js +195 -2
- package/test/spec/modules/kargoBidAdapter_spec.js +1 -1
- package/test/spec/modules/loglyliftBidAdapter_spec.js +1 -1
- package/test/spec/modules/lunamediahbBidAdapter_spec.js +27 -1
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +1 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +69 -3
- package/test/spec/modules/pilotxBidAdapter_spec.js +244 -0
- package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +13 -1
- package/test/spec/modules/realTimeDataModule_spec.js +67 -5
- package/test/spec/modules/richaudienceBidAdapter_spec.js +40 -0
- package/test/spec/modules/riseBidAdapter_spec.js +31 -5
- package/test/spec/modules/rtbhouseBidAdapter_spec.js +20 -0
- package/test/spec/modules/rubiconAnalyticsAdapter_spec.js +61 -1
- package/test/spec/modules/sharethroughBidAdapter_spec.js +91 -6
- package/test/spec/modules/showheroes-bsBidAdapter_spec.js +2 -0
- package/test/spec/modules/sortableAnalyticsAdapter_spec.js +2 -3
- package/test/spec/modules/sovrnBidAdapter_spec.js +413 -333
- package/test/spec/modules/synacormediaBidAdapter_spec.js +70 -0
- package/test/spec/modules/tappxBidAdapter_spec.js +0 -19
- package/test/spec/modules/teadsBidAdapter_spec.js +14 -59
- package/test/spec/modules/undertoneBidAdapter_spec.js +55 -2
- package/test/spec/modules/userId_spec.js +68 -19
- package/test/spec/modules/viewability_spec.js +280 -0
- package/test/spec/modules/weboramaRtdProvider_spec.js +536 -20
- package/test/spec/modules/welectBidAdapter_spec.js +211 -0
- package/test/spec/modules/yahoosspBidAdapter_spec.js +10 -0
- package/test/spec/unit/core/bidderSettings_spec.js +123 -0
- package/test/spec/unit/pbjs_api_spec.js +21 -8
- package/test/spec/unit/secureCreatives_spec.js +143 -24
|
@@ -8,14 +8,21 @@ import {
|
|
|
8
8
|
storage,
|
|
9
9
|
DEFAULT_LOCAL_STORAGE_USER_PROFILE_KEY
|
|
10
10
|
} from '../../../modules/weboramaRtdProvider.js';
|
|
11
|
+
import {
|
|
12
|
+
config
|
|
13
|
+
} from 'src/config.js';
|
|
14
|
+
import {
|
|
15
|
+
getGlobal
|
|
16
|
+
} from 'src/prebidGlobal.js';
|
|
17
|
+
import 'src/prebid.js';
|
|
11
18
|
|
|
12
19
|
const responseHeader = {
|
|
13
20
|
'Content-Type': 'application/json'
|
|
14
21
|
};
|
|
15
22
|
|
|
16
|
-
describe('weboramaRtdProvider', function() {
|
|
17
|
-
describe('weboramaSubmodule', function() {
|
|
18
|
-
it('successfully instantiates and call contextual api', function() {
|
|
23
|
+
describe('weboramaRtdProvider', function () {
|
|
24
|
+
describe('weboramaSubmodule', function () {
|
|
25
|
+
it('successfully instantiates and call contextual api', function () {
|
|
19
26
|
const moduleConfig = {
|
|
20
27
|
params: {
|
|
21
28
|
weboCtxConf: {
|
|
@@ -28,7 +35,7 @@ describe('weboramaRtdProvider', function() {
|
|
|
28
35
|
expect(weboramaSubmodule.init(moduleConfig)).to.equal(true);
|
|
29
36
|
});
|
|
30
37
|
|
|
31
|
-
it('instantiate without contextual token should fail', function() {
|
|
38
|
+
it('instantiate without contextual token should fail', function () {
|
|
32
39
|
const moduleConfig = {
|
|
33
40
|
params: {
|
|
34
41
|
weboCtxConf: {}
|
|
@@ -37,7 +44,7 @@ describe('weboramaRtdProvider', function() {
|
|
|
37
44
|
expect(weboramaSubmodule.init(moduleConfig)).to.equal(false);
|
|
38
45
|
});
|
|
39
46
|
|
|
40
|
-
it('instantiate with empty weboUserData conf should return true', function() {
|
|
47
|
+
it('instantiate with empty weboUserData conf should return true', function () {
|
|
41
48
|
const moduleConfig = {
|
|
42
49
|
params: {
|
|
43
50
|
weboUserDataConf: {}
|
|
@@ -47,26 +54,37 @@ describe('weboramaRtdProvider', function() {
|
|
|
47
54
|
});
|
|
48
55
|
});
|
|
49
56
|
|
|
50
|
-
describe('Handle Set Targeting', function() {
|
|
57
|
+
describe('Handle Set Targeting', function () {
|
|
51
58
|
let sandbox;
|
|
52
59
|
|
|
53
|
-
beforeEach(function() {
|
|
60
|
+
beforeEach(function () {
|
|
54
61
|
sandbox = sinon.sandbox.create();
|
|
55
62
|
|
|
56
63
|
storage.removeDataFromLocalStorage('webo_wam2gam_entry');
|
|
64
|
+
|
|
65
|
+
getGlobal().setConfig({
|
|
66
|
+
ortb2: undefined
|
|
67
|
+
});
|
|
57
68
|
});
|
|
58
69
|
|
|
59
|
-
afterEach(function() {
|
|
70
|
+
afterEach(function () {
|
|
60
71
|
sandbox.restore();
|
|
61
72
|
});
|
|
62
73
|
|
|
63
|
-
describe('Add Contextual Data', function() {
|
|
64
|
-
it('should set gam targeting and send to bidders by default', function() {
|
|
74
|
+
describe('Add Contextual Data', function () {
|
|
75
|
+
it('should set gam targeting and send to bidders by default', function () {
|
|
76
|
+
let onDataResponse = {};
|
|
65
77
|
const moduleConfig = {
|
|
66
78
|
params: {
|
|
67
79
|
weboCtxConf: {
|
|
68
80
|
token: 'foo',
|
|
69
81
|
targetURL: 'https://prebid.org',
|
|
82
|
+
onData: (data, site) => {
|
|
83
|
+
onDataResponse = {
|
|
84
|
+
data: data,
|
|
85
|
+
site: site,
|
|
86
|
+
};
|
|
87
|
+
},
|
|
70
88
|
}
|
|
71
89
|
}
|
|
72
90
|
};
|
|
@@ -79,9 +97,18 @@ describe('weboramaRtdProvider', function() {
|
|
|
79
97
|
adUnits: [{
|
|
80
98
|
bids: [{
|
|
81
99
|
bidder: 'smartadserver'
|
|
100
|
+
}, {
|
|
101
|
+
bidder: 'pubmatic'
|
|
102
|
+
}, {
|
|
103
|
+
bidder: 'appnexus'
|
|
104
|
+
}, {
|
|
105
|
+
bidder: 'rubicon'
|
|
106
|
+
}, {
|
|
107
|
+
bidder: 'other'
|
|
82
108
|
}]
|
|
83
109
|
}]
|
|
84
110
|
};
|
|
111
|
+
|
|
85
112
|
const onDoneSpy = sinon.spy();
|
|
86
113
|
|
|
87
114
|
expect(weboramaSubmodule.init(moduleConfig)).to.be.true;
|
|
@@ -104,10 +131,34 @@ describe('weboramaRtdProvider', function() {
|
|
|
104
131
|
'adunit2': data,
|
|
105
132
|
});
|
|
106
133
|
|
|
134
|
+
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
|
|
107
135
|
expect(reqBidsConfigObj.adUnits[0].bids[0].params.target).to.equal('webo_ctx=foo;webo_ctx=bar;webo_ds=baz');
|
|
136
|
+
expect(reqBidsConfigObj.adUnits[0].bids[1].params.dctr).to.equal('webo_ctx=foo,bar|webo_ds=baz');
|
|
137
|
+
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(data);
|
|
138
|
+
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.deep.equal({
|
|
139
|
+
inventory: data
|
|
140
|
+
});
|
|
141
|
+
expect(reqBidsConfigObj.adUnits[0].bids[4].ortb2).to.deep.equal({
|
|
142
|
+
site: {
|
|
143
|
+
ext: {
|
|
144
|
+
data: data
|
|
145
|
+
},
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
expect(getGlobal().getConfig('ortb2')).to.deep.equal({
|
|
149
|
+
site: {
|
|
150
|
+
ext: {
|
|
151
|
+
data: data
|
|
152
|
+
},
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
expect(onDataResponse).to.deep.equal({
|
|
156
|
+
data: data,
|
|
157
|
+
site: true,
|
|
158
|
+
});
|
|
108
159
|
});
|
|
109
160
|
|
|
110
|
-
it('should set gam targeting but not send to bidders with setPrebidTargeting=true/sendToBidders=false', function() {
|
|
161
|
+
it('should set gam targeting but not send to bidders with setPrebidTargeting=true/sendToBidders=false', function () {
|
|
111
162
|
const moduleConfig = {
|
|
112
163
|
params: {
|
|
113
164
|
weboCtxConf: {
|
|
@@ -130,6 +181,30 @@ describe('weboramaRtdProvider', function() {
|
|
|
130
181
|
params: {
|
|
131
182
|
target: 'foo=bar'
|
|
132
183
|
}
|
|
184
|
+
}, {
|
|
185
|
+
bidder: 'pubmatic',
|
|
186
|
+
params: {
|
|
187
|
+
dctr: 'foo=bar'
|
|
188
|
+
}
|
|
189
|
+
}, {
|
|
190
|
+
bidder: 'appnexus',
|
|
191
|
+
params: {
|
|
192
|
+
keywords: {
|
|
193
|
+
foo: ['bar']
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}, {
|
|
197
|
+
bidder: 'rubicon',
|
|
198
|
+
params: {
|
|
199
|
+
inventory: {
|
|
200
|
+
foo: 'bar',
|
|
201
|
+
},
|
|
202
|
+
visitor: {
|
|
203
|
+
baz: 'bam',
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}, {
|
|
207
|
+
bidder: 'other',
|
|
133
208
|
}]
|
|
134
209
|
}]
|
|
135
210
|
};
|
|
@@ -155,10 +230,90 @@ describe('weboramaRtdProvider', function() {
|
|
|
155
230
|
'adunit2': data,
|
|
156
231
|
});
|
|
157
232
|
|
|
233
|
+
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
|
|
158
234
|
expect(reqBidsConfigObj.adUnits[0].bids[0].params.target).to.equal('foo=bar');
|
|
235
|
+
expect(reqBidsConfigObj.adUnits[0].bids[1].params.dctr).to.equal('foo=bar');
|
|
236
|
+
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal({
|
|
237
|
+
foo: ['bar']
|
|
238
|
+
});
|
|
239
|
+
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.deep.equal({
|
|
240
|
+
inventory: {
|
|
241
|
+
foo: 'bar',
|
|
242
|
+
},
|
|
243
|
+
visitor: {
|
|
244
|
+
baz: 'bam',
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
expect(reqBidsConfigObj.adUnits[0].bids[4].ortb2).to.be.undefined;
|
|
248
|
+
expect(getGlobal().getConfig('ortb2')).to.be.undefined;
|
|
159
249
|
});
|
|
160
250
|
|
|
161
|
-
it('should
|
|
251
|
+
it('should set gam targeting but not send to bidders with (submodule override) setPrebidTargeting=true/(global) sendToBidders=false', function () {
|
|
252
|
+
let onDataResponse = {};
|
|
253
|
+
const moduleConfig = {
|
|
254
|
+
params: {
|
|
255
|
+
setPrebidTargeting: false,
|
|
256
|
+
sendToBidders: false,
|
|
257
|
+
onData: (data, site) => {
|
|
258
|
+
onDataResponse = {
|
|
259
|
+
data: data,
|
|
260
|
+
site: site,
|
|
261
|
+
};
|
|
262
|
+
},
|
|
263
|
+
weboCtxConf: {
|
|
264
|
+
token: 'foo',
|
|
265
|
+
targetURL: 'https://prebid.org',
|
|
266
|
+
setPrebidTargeting: true, // submodule parameter will override module parameter
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
const data = {
|
|
271
|
+
webo_ctx: ['foo', 'bar'],
|
|
272
|
+
webo_ds: ['baz'],
|
|
273
|
+
};
|
|
274
|
+
const adUnitsCodes = ['adunit1', 'adunit2'];
|
|
275
|
+
const reqBidsConfigObj = {
|
|
276
|
+
adUnits: [{
|
|
277
|
+
bids: [{
|
|
278
|
+
bidder: 'smartadserver',
|
|
279
|
+
params: {
|
|
280
|
+
target: 'foo=bar'
|
|
281
|
+
}
|
|
282
|
+
}]
|
|
283
|
+
}]
|
|
284
|
+
};
|
|
285
|
+
const onDoneSpy = sinon.spy();
|
|
286
|
+
|
|
287
|
+
expect(weboramaSubmodule.init(moduleConfig)).to.be.true;
|
|
288
|
+
weboramaSubmodule.getBidRequestData(reqBidsConfigObj, onDoneSpy, moduleConfig);
|
|
289
|
+
|
|
290
|
+
let request = server.requests[0];
|
|
291
|
+
|
|
292
|
+
expect(request.method).to.equal('GET');
|
|
293
|
+
expect(request.url).to.equal('https://ctx.weborama.com/api/profile?token=foo&url=https%3A%2F%2Fprebid.org&');
|
|
294
|
+
expect(request.withCredentials).to.be.false;
|
|
295
|
+
|
|
296
|
+
request.respond(200, responseHeader, JSON.stringify(data));
|
|
297
|
+
|
|
298
|
+
expect(onDoneSpy.calledOnce).to.be.true;
|
|
299
|
+
|
|
300
|
+
const targeting = weboramaSubmodule.getTargetingData(adUnitsCodes, moduleConfig);
|
|
301
|
+
|
|
302
|
+
expect(targeting).to.deep.equal({
|
|
303
|
+
'adunit1': data,
|
|
304
|
+
'adunit2': data,
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(1);
|
|
308
|
+
expect(getGlobal().getConfig('ortb2')).to.be.undefined;
|
|
309
|
+
|
|
310
|
+
expect(onDataResponse).to.deep.equal({
|
|
311
|
+
data: data,
|
|
312
|
+
site: true,
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
it('should not set gam targeting with setPrebidTargeting=false but send to bidders', function () {
|
|
162
317
|
const moduleConfig = {
|
|
163
318
|
params: {
|
|
164
319
|
weboCtxConf: {
|
|
@@ -180,6 +335,30 @@ describe('weboramaRtdProvider', function() {
|
|
|
180
335
|
params: {
|
|
181
336
|
target: 'foo=bar'
|
|
182
337
|
}
|
|
338
|
+
}, {
|
|
339
|
+
bidder: 'pubmatic',
|
|
340
|
+
params: {
|
|
341
|
+
dctr: 'foo=bar'
|
|
342
|
+
}
|
|
343
|
+
}, {
|
|
344
|
+
bidder: 'appnexus',
|
|
345
|
+
params: {
|
|
346
|
+
keywords: {
|
|
347
|
+
foo: ['bar']
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}, {
|
|
351
|
+
bidder: 'rubicon',
|
|
352
|
+
params: {
|
|
353
|
+
inventory: {
|
|
354
|
+
foo: 'bar',
|
|
355
|
+
},
|
|
356
|
+
visitor: {
|
|
357
|
+
baz: 'bam',
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}, {
|
|
361
|
+
bidder: 'other',
|
|
183
362
|
}]
|
|
184
363
|
}]
|
|
185
364
|
}
|
|
@@ -202,13 +381,45 @@ describe('weboramaRtdProvider', function() {
|
|
|
202
381
|
|
|
203
382
|
expect(targeting).to.deep.equal({});
|
|
204
383
|
|
|
384
|
+
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
|
|
205
385
|
expect(reqBidsConfigObj.adUnits[0].bids[0].params.target).to.equal('foo=bar;webo_ctx=foo;webo_ctx=bar;webo_ds=baz');
|
|
386
|
+
expect(reqBidsConfigObj.adUnits[0].bids[1].params.dctr).to.equal('foo=bar|webo_ctx=foo,bar|webo_ds=baz');
|
|
387
|
+
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal({
|
|
388
|
+
foo: ['bar'],
|
|
389
|
+
webo_ctx: ['foo', 'bar'],
|
|
390
|
+
webo_ds: ['baz'],
|
|
391
|
+
});
|
|
392
|
+
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.deep.equal({
|
|
393
|
+
inventory: {
|
|
394
|
+
foo: 'bar',
|
|
395
|
+
webo_ctx: ['foo', 'bar'],
|
|
396
|
+
webo_ds: ['baz'],
|
|
397
|
+
},
|
|
398
|
+
visitor: {
|
|
399
|
+
baz: 'bam',
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
expect(reqBidsConfigObj.adUnits[0].bids[4].ortb2).to.deep.equal({
|
|
403
|
+
site: {
|
|
404
|
+
ext: {
|
|
405
|
+
data: data
|
|
406
|
+
},
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
expect(getGlobal().getConfig('ortb2')).to.deep.equal({
|
|
410
|
+
site: {
|
|
411
|
+
ext: {
|
|
412
|
+
data: data
|
|
413
|
+
},
|
|
414
|
+
}
|
|
415
|
+
});
|
|
206
416
|
});
|
|
207
417
|
|
|
208
|
-
it('should use default profile in case of api error', function() {
|
|
418
|
+
it('should use default profile in case of api error', function () {
|
|
209
419
|
const defaultProfile = {
|
|
210
420
|
webo_ctx: ['baz'],
|
|
211
421
|
};
|
|
422
|
+
let onDataResponse = {};
|
|
212
423
|
const moduleConfig = {
|
|
213
424
|
params: {
|
|
214
425
|
weboCtxConf: {
|
|
@@ -216,6 +427,12 @@ describe('weboramaRtdProvider', function() {
|
|
|
216
427
|
targetURL: 'https://prebid.org',
|
|
217
428
|
setPrebidTargeting: true,
|
|
218
429
|
defaultProfile: defaultProfile,
|
|
430
|
+
onData: (data, site) => {
|
|
431
|
+
onDataResponse = {
|
|
432
|
+
data: data,
|
|
433
|
+
site: site,
|
|
434
|
+
};
|
|
435
|
+
},
|
|
219
436
|
}
|
|
220
437
|
}
|
|
221
438
|
};
|
|
@@ -225,6 +442,14 @@ describe('weboramaRtdProvider', function() {
|
|
|
225
442
|
adUnits: [{
|
|
226
443
|
bids: [{
|
|
227
444
|
bidder: 'smartadserver'
|
|
445
|
+
}, {
|
|
446
|
+
bidder: 'pubmatic'
|
|
447
|
+
}, {
|
|
448
|
+
bidder: 'appnexus'
|
|
449
|
+
}, {
|
|
450
|
+
bidder: 'rubicon'
|
|
451
|
+
}, {
|
|
452
|
+
bidder: 'other'
|
|
228
453
|
}]
|
|
229
454
|
}]
|
|
230
455
|
};
|
|
@@ -250,15 +475,48 @@ describe('weboramaRtdProvider', function() {
|
|
|
250
475
|
'adunit2': defaultProfile,
|
|
251
476
|
});
|
|
252
477
|
|
|
478
|
+
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
|
|
253
479
|
expect(reqBidsConfigObj.adUnits[0].bids[0].params.target).to.equal('webo_ctx=baz');
|
|
480
|
+
expect(reqBidsConfigObj.adUnits[0].bids[1].params.dctr).to.equal('webo_ctx=baz');
|
|
481
|
+
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(defaultProfile);
|
|
482
|
+
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.deep.equal({
|
|
483
|
+
inventory: defaultProfile
|
|
484
|
+
});
|
|
485
|
+
expect(reqBidsConfigObj.adUnits[0].bids[4].ortb2).to.deep.equal({
|
|
486
|
+
site: {
|
|
487
|
+
ext: {
|
|
488
|
+
data: defaultProfile
|
|
489
|
+
},
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
expect(getGlobal().getConfig('ortb2')).to.deep.equal({
|
|
493
|
+
site: {
|
|
494
|
+
ext: {
|
|
495
|
+
data: defaultProfile
|
|
496
|
+
},
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
expect(onDataResponse).to.deep.equal({
|
|
500
|
+
data: defaultProfile,
|
|
501
|
+
site: true,
|
|
502
|
+
});
|
|
254
503
|
});
|
|
255
504
|
});
|
|
256
505
|
|
|
257
|
-
describe('Add WAM2GAM
|
|
258
|
-
it('should set gam targeting from local storage and send to bidders by default', function() {
|
|
506
|
+
describe('Add user-centric data (WAM2GAM)', function () {
|
|
507
|
+
it('should set gam targeting from local storage and send to bidders by default', function () {
|
|
508
|
+
let onDataResponse = {};
|
|
259
509
|
const moduleConfig = {
|
|
260
510
|
params: {
|
|
261
|
-
weboUserDataConf: {
|
|
511
|
+
weboUserDataConf: {
|
|
512
|
+
accountID: 12345,
|
|
513
|
+
onData: (data, site) => {
|
|
514
|
+
onDataResponse = {
|
|
515
|
+
data: data,
|
|
516
|
+
site: site,
|
|
517
|
+
};
|
|
518
|
+
},
|
|
519
|
+
}
|
|
262
520
|
}
|
|
263
521
|
};
|
|
264
522
|
const data = {
|
|
@@ -280,6 +538,14 @@ describe('weboramaRtdProvider', function() {
|
|
|
280
538
|
adUnits: [{
|
|
281
539
|
bids: [{
|
|
282
540
|
bidder: 'smartadserver'
|
|
541
|
+
}, {
|
|
542
|
+
bidder: 'pubmatic'
|
|
543
|
+
}, {
|
|
544
|
+
bidder: 'appnexus'
|
|
545
|
+
}, {
|
|
546
|
+
bidder: 'rubicon'
|
|
547
|
+
}, {
|
|
548
|
+
bidder: 'other'
|
|
283
549
|
}]
|
|
284
550
|
}]
|
|
285
551
|
};
|
|
@@ -297,10 +563,34 @@ describe('weboramaRtdProvider', function() {
|
|
|
297
563
|
'adunit2': data,
|
|
298
564
|
});
|
|
299
565
|
|
|
566
|
+
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
|
|
300
567
|
expect(reqBidsConfigObj.adUnits[0].bids[0].params.target).to.equal('webo_cs=foo;webo_cs=bar;webo_audiences=baz');
|
|
568
|
+
expect(reqBidsConfigObj.adUnits[0].bids[1].params.dctr).to.equal('webo_cs=foo,bar|webo_audiences=baz');
|
|
569
|
+
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(data);
|
|
570
|
+
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.deep.equal({
|
|
571
|
+
visitor: data
|
|
572
|
+
});
|
|
573
|
+
expect(reqBidsConfigObj.adUnits[0].bids[4].ortb2).to.deep.equal({
|
|
574
|
+
user: {
|
|
575
|
+
ext: {
|
|
576
|
+
data: data
|
|
577
|
+
},
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
expect(getGlobal().getConfig('ortb2')).to.deep.equal({
|
|
581
|
+
user: {
|
|
582
|
+
ext: {
|
|
583
|
+
data: data
|
|
584
|
+
},
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
expect(onDataResponse).to.deep.equal({
|
|
588
|
+
data: data,
|
|
589
|
+
site: false,
|
|
590
|
+
});
|
|
301
591
|
});
|
|
302
592
|
|
|
303
|
-
it('should set gam targeting but not send to bidders with setPrebidTargeting=true/sendToBidders=false', function() {
|
|
593
|
+
it('should set gam targeting but not send to bidders with setPrebidTargeting=true/sendToBidders=false', function () {
|
|
304
594
|
const moduleConfig = {
|
|
305
595
|
params: {
|
|
306
596
|
weboUserDataConf: {
|
|
@@ -331,6 +621,30 @@ describe('weboramaRtdProvider', function() {
|
|
|
331
621
|
params: {
|
|
332
622
|
target: 'foo=bar'
|
|
333
623
|
}
|
|
624
|
+
}, {
|
|
625
|
+
bidder: 'pubmatic',
|
|
626
|
+
params: {
|
|
627
|
+
dctr: 'foo=bar'
|
|
628
|
+
}
|
|
629
|
+
}, {
|
|
630
|
+
bidder: 'appnexus',
|
|
631
|
+
params: {
|
|
632
|
+
keywords: {
|
|
633
|
+
foo: ['bar']
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
}, {
|
|
637
|
+
bidder: 'rubicon',
|
|
638
|
+
params: {
|
|
639
|
+
inventory: {
|
|
640
|
+
foo: 'bar'
|
|
641
|
+
},
|
|
642
|
+
visitor: {
|
|
643
|
+
baz: 'bam'
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}, {
|
|
647
|
+
bidder: 'other'
|
|
334
648
|
}]
|
|
335
649
|
}]
|
|
336
650
|
};
|
|
@@ -348,10 +662,90 @@ describe('weboramaRtdProvider', function() {
|
|
|
348
662
|
'adunit2': data,
|
|
349
663
|
});
|
|
350
664
|
|
|
665
|
+
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
|
|
351
666
|
expect(reqBidsConfigObj.adUnits[0].bids[0].params.target).to.equal('foo=bar');
|
|
667
|
+
expect(reqBidsConfigObj.adUnits[0].bids[1].params.dctr).to.equal('foo=bar');
|
|
668
|
+
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal({
|
|
669
|
+
foo: ['bar']
|
|
670
|
+
});
|
|
671
|
+
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.deep.equal({
|
|
672
|
+
inventory: {
|
|
673
|
+
foo: 'bar'
|
|
674
|
+
},
|
|
675
|
+
visitor: {
|
|
676
|
+
baz: 'bam'
|
|
677
|
+
}
|
|
678
|
+
});
|
|
679
|
+
expect(reqBidsConfigObj.adUnits[0].bids[4].ortb2).to.be.undefined;
|
|
680
|
+
expect(getGlobal().getConfig('ortb2')).to.be.undefined;
|
|
352
681
|
});
|
|
353
682
|
|
|
354
|
-
it('should
|
|
683
|
+
it('should set gam targeting but not send to bidders with (submodule override) setPrebidTargeting=true/(global) sendToBidders=false', function () {
|
|
684
|
+
let onDataResponse = {};
|
|
685
|
+
const moduleConfig = {
|
|
686
|
+
params: {
|
|
687
|
+
setPrebidTargeting: false,
|
|
688
|
+
sendToBidders: false,
|
|
689
|
+
onData: (data, site) => {
|
|
690
|
+
onDataResponse = {
|
|
691
|
+
data: data,
|
|
692
|
+
site: site,
|
|
693
|
+
};
|
|
694
|
+
},
|
|
695
|
+
weboUserDataConf: {
|
|
696
|
+
setPrebidTargeting: true, // submodule parameter will override module parameter
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
};
|
|
700
|
+
const data = {
|
|
701
|
+
webo_cs: ['foo', 'bar'],
|
|
702
|
+
webo_audiences: ['baz'],
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
const entry = {
|
|
706
|
+
targeting: data,
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
sandbox.stub(storage, 'localStorageIsEnabled').returns(true);
|
|
710
|
+
sandbox.stub(storage, 'getDataFromLocalStorage')
|
|
711
|
+
.withArgs(DEFAULT_LOCAL_STORAGE_USER_PROFILE_KEY)
|
|
712
|
+
.returns(JSON.stringify(entry));
|
|
713
|
+
|
|
714
|
+
const adUnitsCodes = ['adunit1', 'adunit2'];
|
|
715
|
+
const reqBidsConfigObj = {
|
|
716
|
+
adUnits: [{
|
|
717
|
+
bids: [{
|
|
718
|
+
bidder: 'smartadserver',
|
|
719
|
+
params: {
|
|
720
|
+
target: 'foo=bar'
|
|
721
|
+
}
|
|
722
|
+
}]
|
|
723
|
+
}]
|
|
724
|
+
};
|
|
725
|
+
const onDoneSpy = sinon.spy();
|
|
726
|
+
|
|
727
|
+
expect(weboramaSubmodule.init(moduleConfig)).to.be.true;
|
|
728
|
+
weboramaSubmodule.getBidRequestData(reqBidsConfigObj, onDoneSpy, moduleConfig);
|
|
729
|
+
|
|
730
|
+
expect(onDoneSpy.calledOnce).to.be.true;
|
|
731
|
+
|
|
732
|
+
const targeting = weboramaSubmodule.getTargetingData(adUnitsCodes, moduleConfig);
|
|
733
|
+
|
|
734
|
+
expect(targeting).to.deep.equal({
|
|
735
|
+
'adunit1': data,
|
|
736
|
+
'adunit2': data,
|
|
737
|
+
});
|
|
738
|
+
|
|
739
|
+
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(1);
|
|
740
|
+
expect(reqBidsConfigObj.adUnits[0].bids[0].params.target).to.equal('foo=bar');
|
|
741
|
+
expect(getGlobal().getConfig('ortb2')).to.be.undefined;
|
|
742
|
+
expect(onDataResponse).to.deep.equal({
|
|
743
|
+
data: data,
|
|
744
|
+
site: false,
|
|
745
|
+
});
|
|
746
|
+
});
|
|
747
|
+
|
|
748
|
+
it('should not set gam targeting with setPrebidTargeting=false but send to bidders', function () {
|
|
355
749
|
const moduleConfig = {
|
|
356
750
|
params: {
|
|
357
751
|
weboUserDataConf: {
|
|
@@ -381,6 +775,30 @@ describe('weboramaRtdProvider', function() {
|
|
|
381
775
|
params: {
|
|
382
776
|
target: 'foo=bar'
|
|
383
777
|
}
|
|
778
|
+
}, {
|
|
779
|
+
bidder: 'pubmatic',
|
|
780
|
+
params: {
|
|
781
|
+
dctr: 'foo=bar'
|
|
782
|
+
}
|
|
783
|
+
}, {
|
|
784
|
+
bidder: 'appnexus',
|
|
785
|
+
params: {
|
|
786
|
+
keywords: {
|
|
787
|
+
foo: ['bar']
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
}, {
|
|
791
|
+
bidder: 'rubicon',
|
|
792
|
+
params: {
|
|
793
|
+
inventory: {
|
|
794
|
+
foo: 'bar',
|
|
795
|
+
},
|
|
796
|
+
visitor: {
|
|
797
|
+
baz: 'bam',
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}, {
|
|
801
|
+
bidder: 'other'
|
|
384
802
|
}]
|
|
385
803
|
}]
|
|
386
804
|
};
|
|
@@ -395,10 +813,41 @@ describe('weboramaRtdProvider', function() {
|
|
|
395
813
|
|
|
396
814
|
expect(targeting).to.deep.equal({});
|
|
397
815
|
|
|
816
|
+
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
|
|
398
817
|
expect(reqBidsConfigObj.adUnits[0].bids[0].params.target).to.equal('foo=bar;webo_cs=foo;webo_cs=bar;webo_audiences=baz');
|
|
818
|
+
expect(reqBidsConfigObj.adUnits[0].bids[1].params.dctr).to.equal('foo=bar|webo_cs=foo,bar|webo_audiences=baz');
|
|
819
|
+
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal({
|
|
820
|
+
foo: ['bar'],
|
|
821
|
+
webo_cs: ['foo', 'bar'],
|
|
822
|
+
webo_audiences: ['baz'],
|
|
823
|
+
});
|
|
824
|
+
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.deep.equal({
|
|
825
|
+
inventory: {
|
|
826
|
+
foo: 'bar',
|
|
827
|
+
},
|
|
828
|
+
visitor: {
|
|
829
|
+
baz: 'bam',
|
|
830
|
+
webo_cs: ['foo', 'bar'],
|
|
831
|
+
webo_audiences: ['baz'],
|
|
832
|
+
}
|
|
833
|
+
});
|
|
834
|
+
expect(reqBidsConfigObj.adUnits[0].bids[4].ortb2).to.deep.equal({
|
|
835
|
+
user: {
|
|
836
|
+
ext: {
|
|
837
|
+
data: data
|
|
838
|
+
},
|
|
839
|
+
}
|
|
840
|
+
});
|
|
841
|
+
expect(getGlobal().getConfig('ortb2')).to.deep.equal({
|
|
842
|
+
user: {
|
|
843
|
+
ext: {
|
|
844
|
+
data: data
|
|
845
|
+
},
|
|
846
|
+
}
|
|
847
|
+
});
|
|
399
848
|
});
|
|
400
849
|
|
|
401
|
-
it('should use default profile in case of nothing on local storage', function() {
|
|
850
|
+
it('should use default profile in case of nothing on local storage', function () {
|
|
402
851
|
const defaultProfile = {
|
|
403
852
|
webo_audiences: ['baz']
|
|
404
853
|
};
|
|
@@ -418,6 +867,14 @@ describe('weboramaRtdProvider', function() {
|
|
|
418
867
|
adUnits: [{
|
|
419
868
|
bids: [{
|
|
420
869
|
bidder: 'smartadserver'
|
|
870
|
+
}, {
|
|
871
|
+
bidder: 'pubmatic'
|
|
872
|
+
}, {
|
|
873
|
+
bidder: 'appnexus'
|
|
874
|
+
}, {
|
|
875
|
+
bidder: 'rubicon'
|
|
876
|
+
}, {
|
|
877
|
+
bidder: 'other'
|
|
421
878
|
}]
|
|
422
879
|
}]
|
|
423
880
|
};
|
|
@@ -435,18 +892,45 @@ describe('weboramaRtdProvider', function() {
|
|
|
435
892
|
'adunit2': defaultProfile,
|
|
436
893
|
});
|
|
437
894
|
|
|
895
|
+
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
|
|
438
896
|
expect(reqBidsConfigObj.adUnits[0].bids[0].params.target).to.equal('webo_audiences=baz');
|
|
897
|
+
expect(reqBidsConfigObj.adUnits[0].bids[1].params.dctr).to.equal('webo_audiences=baz');
|
|
898
|
+
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(defaultProfile);
|
|
899
|
+
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.deep.equal({
|
|
900
|
+
visitor: defaultProfile
|
|
901
|
+
});
|
|
902
|
+
expect(reqBidsConfigObj.adUnits[0].bids[4].ortb2).to.deep.equal({
|
|
903
|
+
user: {
|
|
904
|
+
ext: {
|
|
905
|
+
data: defaultProfile
|
|
906
|
+
},
|
|
907
|
+
}
|
|
908
|
+
});
|
|
909
|
+
expect(getGlobal().getConfig('ortb2')).to.deep.equal({
|
|
910
|
+
user: {
|
|
911
|
+
ext: {
|
|
912
|
+
data: defaultProfile
|
|
913
|
+
},
|
|
914
|
+
}
|
|
915
|
+
});
|
|
439
916
|
});
|
|
440
917
|
|
|
441
|
-
it('should use default profile if cant read from local storage', function() {
|
|
918
|
+
it('should use default profile if cant read from local storage', function () {
|
|
442
919
|
const defaultProfile = {
|
|
443
920
|
webo_audiences: ['baz']
|
|
444
921
|
};
|
|
922
|
+
let onDataResponse = {};
|
|
445
923
|
const moduleConfig = {
|
|
446
924
|
params: {
|
|
447
925
|
weboUserDataConf: {
|
|
448
926
|
setPrebidTargeting: true,
|
|
449
927
|
defaultProfile: defaultProfile,
|
|
928
|
+
onData: (data, site) => {
|
|
929
|
+
onDataResponse = {
|
|
930
|
+
data: data,
|
|
931
|
+
site: site,
|
|
932
|
+
};
|
|
933
|
+
},
|
|
450
934
|
}
|
|
451
935
|
}
|
|
452
936
|
};
|
|
@@ -458,6 +942,14 @@ describe('weboramaRtdProvider', function() {
|
|
|
458
942
|
adUnits: [{
|
|
459
943
|
bids: [{
|
|
460
944
|
bidder: 'smartadserver'
|
|
945
|
+
}, {
|
|
946
|
+
bidder: 'pubmatic'
|
|
947
|
+
}, {
|
|
948
|
+
bidder: 'appnexus'
|
|
949
|
+
}, {
|
|
950
|
+
bidder: 'rubicon'
|
|
951
|
+
}, {
|
|
952
|
+
bidder: 'other'
|
|
461
953
|
}]
|
|
462
954
|
}]
|
|
463
955
|
};
|
|
@@ -475,7 +967,31 @@ describe('weboramaRtdProvider', function() {
|
|
|
475
967
|
'adunit2': defaultProfile,
|
|
476
968
|
});
|
|
477
969
|
|
|
970
|
+
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
|
|
478
971
|
expect(reqBidsConfigObj.adUnits[0].bids[0].params.target).to.equal('webo_audiences=baz');
|
|
972
|
+
expect(reqBidsConfigObj.adUnits[0].bids[1].params.dctr).to.equal('webo_audiences=baz');
|
|
973
|
+
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(defaultProfile);
|
|
974
|
+
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.deep.equal({
|
|
975
|
+
visitor: defaultProfile
|
|
976
|
+
});
|
|
977
|
+
expect(reqBidsConfigObj.adUnits[0].bids[4].ortb2).to.deep.equal({
|
|
978
|
+
user: {
|
|
979
|
+
ext: {
|
|
980
|
+
data: defaultProfile
|
|
981
|
+
},
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
expect(getGlobal().getConfig('ortb2')).to.deep.equal({
|
|
985
|
+
user: {
|
|
986
|
+
ext: {
|
|
987
|
+
data: defaultProfile
|
|
988
|
+
},
|
|
989
|
+
}
|
|
990
|
+
});
|
|
991
|
+
expect(onDataResponse).to.deep.equal({
|
|
992
|
+
data: defaultProfile,
|
|
993
|
+
site: false,
|
|
994
|
+
});
|
|
479
995
|
});
|
|
480
996
|
});
|
|
481
997
|
});
|