prebid.js 5.20.0 → 6.3.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/.babelrc.js +1 -10
- package/README.md +4 -2
- package/browsers.json +13 -37
- package/gulpfile.js +1 -8
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +23 -14
- package/karma.conf.maker.js +1 -1
- package/modules/33acrossBidAdapter.js +189 -102
- package/modules/adagioBidAdapter.js +1 -1
- package/modules/addefendBidAdapter.js +1 -0
- package/modules/adheseBidAdapter.js +7 -2
- package/modules/adkernelBidAdapter.js +1 -0
- package/modules/adlivetechBidAdapter.md +61 -0
- package/modules/admanBidAdapter.js +1 -0
- package/modules/admixerBidAdapter.js +3 -2
- package/modules/adnuntiusBidAdapter.js +5 -2
- package/modules/adomikAnalyticsAdapter.js +10 -4
- 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 +7 -2
- package/modules/appnexusBidAdapter.js +23 -3
- package/modules/beachfrontBidAdapter.js +14 -17
- package/modules/beopBidAdapter.js +5 -3
- package/modules/codefuelBidAdapter.js +1 -3
- package/modules/codefuelBidAdapter.md +3 -3
- package/modules/colossussspBidAdapter.js +7 -0
- package/modules/craftBidAdapter.js +5 -3
- package/modules/criteoBidAdapter.js +1 -1
- package/modules/cwireBidAdapter.js +3 -0
- package/modules/datablocksBidAdapter.js +3 -3
- package/modules/dchain.js +149 -0
- package/modules/dchain.md +45 -0
- package/modules/deepintentBidAdapter.js +1 -1
- package/modules/dspxBidAdapter.js +1 -1
- package/modules/emx_digitalBidAdapter.js +9 -1
- package/modules/engageyaBidAdapter.js +68 -54
- package/modules/freewheel-sspBidAdapter.js +6 -0
- package/modules/futureads.md +48 -0
- package/modules/glimpseBidAdapter.js +44 -16
- package/modules/goldbachBidAdapter.js +1176 -0
- package/modules/goldbachBidAdapter.md +151 -0
- package/modules/gptPreAuction.js +11 -5
- package/modules/gridBidAdapter.js +1 -1
- package/modules/gumgumBidAdapter.js +7 -3
- package/modules/id5IdSystem.md +6 -6
- package/modules/imRtdProvider.js +31 -0
- package/modules/intersectionRtdProvider.js +114 -0
- package/modules/invibesBidAdapter.js +15 -9
- package/modules/ipromBidAdapter.js +79 -0
- package/modules/ixBidAdapter.js +166 -21
- package/modules/kinessoIdSystem.js +1 -1
- package/modules/limelightDigitalBidAdapter.js +2 -1
- package/modules/lotamePanoramaIdSystem.js +80 -8
- package/modules/luponmediaBidAdapter.js +570 -0
- package/modules/mediasquareBidAdapter.js +1 -9
- package/modules/merkleIdSystem.js +5 -0
- package/modules/missenaBidAdapter.js +89 -0
- package/modules/nativoBidAdapter.js +27 -1
- package/modules/nextMillenniumBidAdapter.js +29 -1
- package/modules/oguryBidAdapter.js +2 -1
- package/modules/openxBidAdapter.js +6 -1
- package/modules/prebidServerBidAdapter/index.js +19 -15
- package/modules/pubmaticBidAdapter.js +5 -3
- package/modules/relaidoBidAdapter.js +86 -65
- package/modules/richaudienceBidAdapter.js +2 -3
- package/modules/rtdModule/index.js +48 -18
- package/modules/rubiconBidAdapter.js +10 -8
- package/modules/saambaaBidAdapter.js +420 -0
- package/modules/saambaaBidAdapter.md +65 -68
- package/modules/seedtagBidAdapter.js +6 -0
- package/modules/sharedIdSystem.js +27 -1
- package/modules/smaatoBidAdapter.js +9 -1
- package/modules/smartxBidAdapter.js +17 -1
- package/modules/sspBCBidAdapter.js +34 -3
- package/modules/tappxBidAdapter.js +3 -1
- package/modules/targetVideoBidAdapter.js +187 -0
- package/modules/targetVideoBidAdapter.md +34 -0
- package/modules/trustxBidAdapter.js +10 -1
- 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 +65 -108
- package/modules/visxBidAdapter.js +20 -3
- 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/yieldlabBidAdapter.js +41 -10
- package/modules/yieldlabBidAdapter.md +91 -48
- package/modules/yieldoneBidAdapter.js +115 -11
- package/modules/zetaSspBidAdapter.md +33 -1
- package/modules/zeta_global_sspBidAdapter.js +22 -1
- package/package.json +6 -1
- package/plugins/pbjsGlobals.js +28 -1
- package/src/adapterManager.js +14 -8
- package/src/auction.js +3 -2
- package/src/prebid.js +1 -2
- package/src/targeting.js +24 -3
- package/src/utils.js +41 -7
- package/test/spec/integration/faker/googletag.js +6 -0
- package/test/spec/modules/33acrossBidAdapter_spec.js +300 -78
- package/test/spec/modules/adheseBidAdapter_spec.js +27 -1
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +35 -0
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +3 -1
- 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 +26 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +63 -1
- package/test/spec/modules/beachfrontBidAdapter_spec.js +65 -1
- package/test/spec/modules/codefuelBidAdapter_spec.js +1 -1
- package/test/spec/modules/colossussspBidAdapter_spec.js +9 -0
- package/test/spec/modules/cwireBidAdapter_spec.js +10 -8
- package/test/spec/modules/datablocksBidAdapter_spec.js +3 -3
- package/test/spec/modules/dchain_spec.js +329 -0
- package/test/spec/modules/emx_digitalBidAdapter_spec.js +10 -0
- package/test/spec/modules/engageyaBidAdapter_spec.js +231 -95
- package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
- package/test/spec/modules/freewheel-sspBidAdapter_spec.js +19 -0
- package/test/spec/modules/glimpseBidAdapter_spec.js +33 -0
- package/test/spec/modules/goldbachBidAdapter_spec.js +1359 -0
- package/test/spec/modules/gptPreAuction_spec.js +58 -4
- package/test/spec/modules/gumgumBidAdapter_spec.js +6 -0
- package/test/spec/modules/imRtdProvider_spec.js +25 -0
- package/test/spec/modules/intersectionRtdProvider_spec.js +141 -0
- package/test/spec/modules/invibesBidAdapter_spec.js +29 -4
- package/test/spec/modules/ipromBidAdapter_spec.js +195 -0
- package/test/spec/modules/ixBidAdapter_spec.js +285 -2
- package/test/spec/modules/konduitWrapper_spec.js +0 -1
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +10 -7
- 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/merkleIdSystem_spec.js +18 -0
- package/test/spec/modules/missenaBidAdapter_spec.js +134 -0
- package/test/spec/modules/nativoBidAdapter_spec.js +35 -18
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +18 -0
- package/test/spec/modules/oguryBidAdapter_spec.js +13 -11
- package/test/spec/modules/openxBidAdapter_spec.js +5 -0
- package/test/spec/modules/prebidServerBidAdapter_spec.js +62 -2
- package/test/spec/modules/pubmaticBidAdapter_spec.js +1 -1
- 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 +17 -0
- package/test/spec/modules/seedtagBidAdapter_spec.js +3 -0
- package/test/spec/modules/sharedIdSystem_spec.js +52 -6
- package/test/spec/modules/smaatoBidAdapter_spec.js +61 -0
- package/test/spec/modules/smartxBidAdapter_spec.js +9 -0
- package/test/spec/modules/sspBCBidAdapter_spec.js +33 -3
- package/test/spec/modules/tappxBidAdapter_spec.js +4 -0
- package/test/spec/modules/targetVideoBidAdapter_spec.js +96 -0
- package/test/spec/modules/trustxBidAdapter_spec.js +42 -0
- package/test/spec/modules/userId_spec.js +51 -0
- package/test/spec/modules/vidoomyBidAdapter_spec.js +32 -13
- package/test/spec/modules/visxBidAdapter_spec.js +121 -5
- package/test/spec/modules/weboramaRtdProvider_spec.js +408 -214
- package/test/spec/modules/yahoosspBidAdapter_spec.js +28 -1
- package/test/spec/modules/yieldlabBidAdapter_spec.js +81 -0
- package/test/spec/modules/yieldoneBidAdapter_spec.js +299 -53
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +33 -1
- package/test/spec/unit/core/adapterManager_spec.js +24 -6
- package/test/spec/unit/core/targeting_spec.js +116 -0
- package/test/spec/utils_spec.js +38 -0
- package/wdio.conf.js +1 -1
|
@@ -161,11 +161,20 @@ export const spec = {
|
|
|
161
161
|
domain: domain,
|
|
162
162
|
publisher: {
|
|
163
163
|
id: publisherId
|
|
164
|
+
},
|
|
165
|
+
content: {
|
|
166
|
+
ext: {
|
|
167
|
+
prebid: {
|
|
168
|
+
name: 'pbjs',
|
|
169
|
+
version: '$prebid.version$'
|
|
170
|
+
}
|
|
171
|
+
}
|
|
164
172
|
}
|
|
165
173
|
},
|
|
166
174
|
device: device,
|
|
167
175
|
at: at,
|
|
168
|
-
cur: cur
|
|
176
|
+
cur: cur,
|
|
177
|
+
ext: {}
|
|
169
178
|
};
|
|
170
179
|
|
|
171
180
|
const userExt = {};
|
|
@@ -194,6 +203,8 @@ export const spec = {
|
|
|
194
203
|
};
|
|
195
204
|
}
|
|
196
205
|
|
|
206
|
+
// requestPayload.user.ext.ver = pbjs.version;
|
|
207
|
+
|
|
197
208
|
// Targeting
|
|
198
209
|
if (getBidIdParameter('data', bid.params.user)) {
|
|
199
210
|
var targetingarr = [];
|
|
@@ -336,6 +347,7 @@ function createOutstreamConfig(bid) {
|
|
|
336
347
|
let confTitle = getBidIdParameter('title', bid.renderer.config.outstream_options);
|
|
337
348
|
let confSkipOffset = getBidIdParameter('skipOffset', bid.renderer.config.outstream_options);
|
|
338
349
|
let confDesiredBitrate = getBidIdParameter('desiredBitrate', bid.renderer.config.outstream_options);
|
|
350
|
+
let confVisibilityThreshold = getBidIdParameter('visibilityThreshold', bid.renderer.config.outstream_options);
|
|
339
351
|
let elementId = getBidIdParameter('slot', bid.renderer.config.outstream_options) || bid.adUnitCode;
|
|
340
352
|
|
|
341
353
|
logMessage('[SMARTX][renderer] Handle SmartX outstream renderer');
|
|
@@ -384,6 +396,10 @@ function createOutstreamConfig(bid) {
|
|
|
384
396
|
smartPlayObj.desiredBitrate = confDesiredBitrate;
|
|
385
397
|
}
|
|
386
398
|
|
|
399
|
+
if (confVisibilityThreshold) {
|
|
400
|
+
smartPlayObj.visibilityThreshold = confVisibilityThreshold;
|
|
401
|
+
}
|
|
402
|
+
|
|
387
403
|
smartPlayObj.adResponse = bid.vastContent;
|
|
388
404
|
|
|
389
405
|
const divID = '[id="' + elementId + '"]';
|
|
@@ -9,11 +9,13 @@ const BIDDER_URL = 'https://ssp.wp.pl/bidder/';
|
|
|
9
9
|
const SYNC_URL = 'https://ssp.wp.pl/bidder/usersync';
|
|
10
10
|
const NOTIFY_URL = 'https://ssp.wp.pl/bidder/notify';
|
|
11
11
|
const TMAX = 450;
|
|
12
|
-
const BIDDER_VERSION = '5.
|
|
12
|
+
const BIDDER_VERSION = '5.3';
|
|
13
13
|
const W = window;
|
|
14
14
|
const { navigator } = W;
|
|
15
15
|
const oneCodeDetection = {};
|
|
16
|
+
const adUnitsCalled = {};
|
|
16
17
|
const adSizesCalled = {};
|
|
18
|
+
const pageView = {};
|
|
17
19
|
var consentApiVersion;
|
|
18
20
|
|
|
19
21
|
/**
|
|
@@ -70,6 +72,7 @@ const cookieSupport = () => {
|
|
|
70
72
|
};
|
|
71
73
|
|
|
72
74
|
const applyClientHints = ortbRequest => {
|
|
75
|
+
const { location } = document;
|
|
73
76
|
const { connection = {}, deviceMemory, userAgentData = {} } = navigator;
|
|
74
77
|
const viewport = W.visualViewport || false;
|
|
75
78
|
const segments = [];
|
|
@@ -85,6 +88,16 @@ const applyClientHints = ortbRequest => {
|
|
|
85
88
|
'CH-isMobile': userAgentData.mobile,
|
|
86
89
|
};
|
|
87
90
|
|
|
91
|
+
/**
|
|
92
|
+
Check / generate page view id
|
|
93
|
+
Should be generated dureing first call to applyClientHints(),
|
|
94
|
+
and re-generated if pathname has changed
|
|
95
|
+
*/
|
|
96
|
+
if (!pageView.id || location.pathname !== pageView.path) {
|
|
97
|
+
pageView.path = location.pathname;
|
|
98
|
+
pageView.id = Math.floor(1E20 * Math.random());
|
|
99
|
+
}
|
|
100
|
+
|
|
88
101
|
Object.keys(hints).forEach(key => {
|
|
89
102
|
const hint = hints[key];
|
|
90
103
|
|
|
@@ -100,6 +113,14 @@ const applyClientHints = ortbRequest => {
|
|
|
100
113
|
id: '12',
|
|
101
114
|
name: 'NetInfo',
|
|
102
115
|
segment: segments,
|
|
116
|
+
}, {
|
|
117
|
+
id: '7',
|
|
118
|
+
name: 'pvid',
|
|
119
|
+
segment: [
|
|
120
|
+
{
|
|
121
|
+
value: `${pageView.id}`
|
|
122
|
+
}
|
|
123
|
+
]
|
|
103
124
|
}];
|
|
104
125
|
|
|
105
126
|
ortbRequest.user = Object.assign(ortbRequest.user, { data });
|
|
@@ -129,6 +150,7 @@ const setOnAny = (collection, key) => collection.reduce((prev, next) => prev ||
|
|
|
129
150
|
*/
|
|
130
151
|
const sendNotification = payload => {
|
|
131
152
|
ajax(NOTIFY_URL, null, JSON.stringify(payload), {
|
|
153
|
+
contentType: 'application/json',
|
|
132
154
|
withCredentials: false,
|
|
133
155
|
method: 'POST',
|
|
134
156
|
crossOrigin: true
|
|
@@ -267,8 +289,14 @@ const mapImpression = slot => {
|
|
|
267
289
|
send this info as ext.pbsize
|
|
268
290
|
*/
|
|
269
291
|
const slotSize = slot.sizes.length ? slot.sizes.reduce((prev, next) => prev[0] * prev[1] <= next[0] * next[1] ? next : prev).join('x') : '1x1';
|
|
270
|
-
|
|
271
|
-
|
|
292
|
+
|
|
293
|
+
if (!adUnitsCalled[adUnitCode]) {
|
|
294
|
+
// this is a new adunit - assign & save pbsize
|
|
295
|
+
adSizesCalled[slotSize] = adSizesCalled[slotSize] ? adSizesCalled[slotSize] += 1 : 1;
|
|
296
|
+
adUnitsCalled[adUnitCode] = `${slotSize}_${adSizesCalled[slotSize]}`
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
ext.data = Object.assign({ pbsize: adUnitsCalled[adUnitCode] }, ext.data);
|
|
272
300
|
|
|
273
301
|
const imp = {
|
|
274
302
|
id: id && siteId ? id : 'bidid-' + bidId,
|
|
@@ -325,6 +353,9 @@ const parseNative = nativeData => {
|
|
|
325
353
|
case 0:
|
|
326
354
|
result.title = asset.title.text;
|
|
327
355
|
break;
|
|
356
|
+
case 1:
|
|
357
|
+
result.cta = asset.data.value;
|
|
358
|
+
break;
|
|
328
359
|
case 2:
|
|
329
360
|
result.icon = {
|
|
330
361
|
url: asset.img.url,
|
|
@@ -7,9 +7,10 @@ import { config } from '../src/config.js';
|
|
|
7
7
|
import { Renderer } from '../src/Renderer.js';
|
|
8
8
|
|
|
9
9
|
const BIDDER_CODE = 'tappx';
|
|
10
|
+
const GVLID_CODE = 628;
|
|
10
11
|
const TTL = 360;
|
|
11
12
|
const CUR = 'USD';
|
|
12
|
-
const TAPPX_BIDDER_VERSION = '0.1.
|
|
13
|
+
const TAPPX_BIDDER_VERSION = '0.1.1005';
|
|
13
14
|
const TYPE_CNN = 'prebidjs';
|
|
14
15
|
const LOG_PREFIX = '[TAPPX]: ';
|
|
15
16
|
const VIDEO_SUPPORT = ['instream', 'outstream'];
|
|
@@ -42,6 +43,7 @@ var hostDomain;
|
|
|
42
43
|
|
|
43
44
|
export const spec = {
|
|
44
45
|
code: BIDDER_CODE,
|
|
46
|
+
gvlid: GVLID_CODE,
|
|
45
47
|
supportedMediaTypes: [BANNER, VIDEO],
|
|
46
48
|
|
|
47
49
|
/**
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import find from 'core-js-pure/features/array/find.js';
|
|
2
|
+
import { getBidRequest } from '../src/utils.js';
|
|
3
|
+
import { BANNER, VIDEO } from '../src/mediaTypes.js';
|
|
4
|
+
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
5
|
+
|
|
6
|
+
const SOURCE = 'pbjs';
|
|
7
|
+
const BIDDER_CODE = 'targetVideo';
|
|
8
|
+
const ENDPOINT_URL = 'https://ib.adnxs.com/ut/v3/prebid';
|
|
9
|
+
const MARGIN = 1.35;
|
|
10
|
+
|
|
11
|
+
export const spec = {
|
|
12
|
+
|
|
13
|
+
code: BIDDER_CODE,
|
|
14
|
+
supportedMediaTypes: [BANNER],
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Determines whether or not the given bid request is valid.
|
|
18
|
+
*
|
|
19
|
+
* @param {object} bid The bid to validate.
|
|
20
|
+
* @return boolean True if this is a valid bid, and false otherwise.
|
|
21
|
+
*/
|
|
22
|
+
isBidRequestValid: function(bid) {
|
|
23
|
+
return !!(bid && bid.params && bid.params.placementId);
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Make a server request from the list of BidRequests.
|
|
28
|
+
*
|
|
29
|
+
* @param {BidRequest[]} bidRequests A non-empty list of bid requests which should be sent to the Server.
|
|
30
|
+
* @return ServerRequest Info describing the request to the server.
|
|
31
|
+
*/
|
|
32
|
+
buildRequests: function(bidRequests, bidderRequest) {
|
|
33
|
+
const tags = bidRequests.map(createVideoTag);
|
|
34
|
+
const schain = bidRequests[0].schain;
|
|
35
|
+
const payload = {
|
|
36
|
+
tags: tags,
|
|
37
|
+
sdk: {
|
|
38
|
+
source: SOURCE,
|
|
39
|
+
version: '$prebid.version$'
|
|
40
|
+
},
|
|
41
|
+
schain: schain
|
|
42
|
+
};
|
|
43
|
+
return formatRequest(payload, bidderRequest);
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Unpack the response from the server into a list of bids.
|
|
48
|
+
*
|
|
49
|
+
* @param {*} serverResponse A successful response from the server.
|
|
50
|
+
* @return {Bid[]} An array of bids which were nested inside the server.
|
|
51
|
+
*/
|
|
52
|
+
interpretResponse: function(serverResponse, { bidderRequest }) {
|
|
53
|
+
serverResponse = serverResponse.body;
|
|
54
|
+
const bids = [];
|
|
55
|
+
|
|
56
|
+
if (serverResponse.tags) {
|
|
57
|
+
serverResponse.tags.forEach(serverBid => {
|
|
58
|
+
const rtbBid = getRtbBid(serverBid);
|
|
59
|
+
if (rtbBid && rtbBid.cpm !== 0 && rtbBid.ad_type == VIDEO) {
|
|
60
|
+
bids.push(newBid(serverBid, rtbBid, bidderRequest));
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return bids;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function getSizes(request) {
|
|
71
|
+
let sizes = request.sizes;
|
|
72
|
+
if (!sizes && request.mediaTypes && request.mediaTypes.banner && request.mediaTypes.banner.sizes) {
|
|
73
|
+
sizes = request.mediaTypes.banner.sizes;
|
|
74
|
+
}
|
|
75
|
+
if (Array.isArray(sizes) && !Array.isArray(sizes[0])) {
|
|
76
|
+
sizes = [sizes[0], sizes[1]];
|
|
77
|
+
}
|
|
78
|
+
if (!Array.isArray(sizes) || !Array.isArray(sizes[0])) {
|
|
79
|
+
sizes = [[0, 0]];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return sizes;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function formatRequest(payload, bidderRequest) {
|
|
86
|
+
const options = {
|
|
87
|
+
withCredentials: true
|
|
88
|
+
};
|
|
89
|
+
const request = {
|
|
90
|
+
method: 'POST',
|
|
91
|
+
url: ENDPOINT_URL,
|
|
92
|
+
data: JSON.stringify(payload),
|
|
93
|
+
bidderRequest,
|
|
94
|
+
options
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
return request;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Create video auction.
|
|
102
|
+
*
|
|
103
|
+
* @param {*} serverResponse A successful response from the server.
|
|
104
|
+
* @return {Bid[]} An array of bids which were nested inside the server.
|
|
105
|
+
*/
|
|
106
|
+
function createVideoTag(bid) {
|
|
107
|
+
const tag = {};
|
|
108
|
+
tag.id = parseInt(bid.params.placementId, 10);
|
|
109
|
+
tag.gpid = 'targetVideo';
|
|
110
|
+
tag.sizes = getSizes(bid);
|
|
111
|
+
tag.primary_size = tag.sizes[0];
|
|
112
|
+
tag.ad_types = [VIDEO];
|
|
113
|
+
tag.uuid = bid.bidId;
|
|
114
|
+
tag.allow_smaller_sizes = false;
|
|
115
|
+
tag.use_pmt_rule = false
|
|
116
|
+
tag.prebid = true;
|
|
117
|
+
tag.disable_psa = true;
|
|
118
|
+
tag.hb_source = 1;
|
|
119
|
+
tag.require_asset_url = true;
|
|
120
|
+
tag.video = {
|
|
121
|
+
playback_method: 2,
|
|
122
|
+
skippable: true
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
return tag;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Unpack the Server's Bid into a Prebid-compatible one.
|
|
130
|
+
* @param serverBid
|
|
131
|
+
* @param rtbBid
|
|
132
|
+
* @param bidderRequest
|
|
133
|
+
* @return Bid
|
|
134
|
+
*/
|
|
135
|
+
function newBid(serverBid, rtbBid, bidderRequest) {
|
|
136
|
+
const bidRequest = getBidRequest(serverBid.uuid, [bidderRequest]);
|
|
137
|
+
const sizes = getSizes(bidRequest);
|
|
138
|
+
const bid = {
|
|
139
|
+
requestId: serverBid.uuid,
|
|
140
|
+
cpm: rtbBid.cpm * MARGIN,
|
|
141
|
+
creativeId: rtbBid.creative_id,
|
|
142
|
+
dealId: rtbBid.deal_id,
|
|
143
|
+
currency: 'USD',
|
|
144
|
+
netRevenue: true,
|
|
145
|
+
width: sizes[0][0],
|
|
146
|
+
height: sizes[0][1],
|
|
147
|
+
ttl: 300,
|
|
148
|
+
adUnitCode: bidRequest.adUnitCode,
|
|
149
|
+
appnexus: {
|
|
150
|
+
buyerMemberId: rtbBid.buyer_member_id,
|
|
151
|
+
dealPriority: rtbBid.deal_priority,
|
|
152
|
+
dealCode: rtbBid.deal_code
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
if (rtbBid.rtb.video) {
|
|
157
|
+
Object.assign(bid, {
|
|
158
|
+
vastImpUrl: rtbBid.notify_url,
|
|
159
|
+
ad: getBannerHtml(rtbBid.notify_url + '&redir=' + encodeURIComponent(rtbBid.rtb.video.asset_url)),
|
|
160
|
+
ttl: 3600
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return bid;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function getRtbBid(tag) {
|
|
168
|
+
return tag && tag.ads && tag.ads.length && find(tag.ads, ad => ad.rtb);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function getBannerHtml(vastUrl) {
|
|
172
|
+
return `<!DOCTYPE html>
|
|
173
|
+
<html lang="en">
|
|
174
|
+
<head>
|
|
175
|
+
<meta charset="UTF-8">
|
|
176
|
+
<title></title>
|
|
177
|
+
<style>html, body {width: 100%; height: 100%; margin: 0;}</style>
|
|
178
|
+
</head>
|
|
179
|
+
<body>
|
|
180
|
+
<div id="targetVideoPlayer"></div>
|
|
181
|
+
<script src="https://player.target-video.com/custom/targetvideo-banner.js"></script>
|
|
182
|
+
<script>initPlayer("${vastUrl}");</script>
|
|
183
|
+
</body>
|
|
184
|
+
</html>`;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
registerBidder(spec);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
Module Name: Target Video Bid Adapter
|
|
5
|
+
Module Type: Bidder Adapter
|
|
6
|
+
Maintainer: grajzer@gmail.com
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
# Description
|
|
10
|
+
|
|
11
|
+
Connects to Appnexus exchange for bids.
|
|
12
|
+
|
|
13
|
+
TargetVideo bid adapter supports Banner.
|
|
14
|
+
|
|
15
|
+
# Test Parameters
|
|
16
|
+
```
|
|
17
|
+
var adUnits = [
|
|
18
|
+
// Banner adUnit
|
|
19
|
+
{
|
|
20
|
+
code: 'banner-div',
|
|
21
|
+
mediaTypes: {
|
|
22
|
+
banner: {
|
|
23
|
+
sizes: [[640, 480], [300, 250]],
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
bids: [{
|
|
27
|
+
bidder: 'targetVideo',
|
|
28
|
+
params: {
|
|
29
|
+
placementId: 13232361
|
|
30
|
+
}
|
|
31
|
+
}]
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
```
|
|
@@ -76,7 +76,7 @@ export const spec = {
|
|
|
76
76
|
if (!userIdAsEids) {
|
|
77
77
|
userIdAsEids = bid.userIdAsEids;
|
|
78
78
|
}
|
|
79
|
-
const {params: {uid, keywords}, mediaTypes, bidId, adUnitCode, rtd} = bid;
|
|
79
|
+
const {params: {uid, keywords}, mediaTypes, bidId, adUnitCode, rtd, ortb2Imp} = bid;
|
|
80
80
|
bidsMap[bidId] = bid;
|
|
81
81
|
const bidFloor = _getFloor(mediaTypes || {}, bid);
|
|
82
82
|
if (rtd) {
|
|
@@ -102,6 +102,15 @@ export const spec = {
|
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
+
if (ortb2Imp && ortb2Imp.ext && ortb2Imp.ext.data) {
|
|
106
|
+
impObj.ext.data = ortb2Imp.ext.data;
|
|
107
|
+
if (impObj.ext.data.adserver && impObj.ext.data.adserver.adslot) {
|
|
108
|
+
impObj.ext.gpid = impObj.ext.data.adserver.adslot.toString();
|
|
109
|
+
} else {
|
|
110
|
+
impObj.ext.gpid = ortb2Imp.ext.data.pbadslot && ortb2Imp.ext.data.pbadslot.toString();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
105
114
|
if (!isEmpty(keywords)) {
|
|
106
115
|
if (!pageKeywords) {
|
|
107
116
|
pageKeywords = keywords;
|
|
@@ -98,9 +98,16 @@ export const spec = {
|
|
|
98
98
|
'commons': commons
|
|
99
99
|
};
|
|
100
100
|
const referer = bidderRequest.refererInfo.referer;
|
|
101
|
+
const canonicalUrl = getCanonicalUrl();
|
|
102
|
+
if (referer) {
|
|
103
|
+
commons.referrer = referer;
|
|
104
|
+
}
|
|
105
|
+
if (canonicalUrl) {
|
|
106
|
+
commons.canonicalUrl = canonicalUrl;
|
|
107
|
+
}
|
|
101
108
|
const hostname = parseUrl(referer).hostname;
|
|
102
109
|
let domain = extractDomainFromHost(hostname);
|
|
103
|
-
const pageUrl =
|
|
110
|
+
const pageUrl = canonicalUrl || referer;
|
|
104
111
|
|
|
105
112
|
const pubid = validBidRequests[0].params.publisherId;
|
|
106
113
|
let reqUrl = `${URL}?pid=${pubid}&domain=${domain}`;
|
package/modules/userId/index.js
CHANGED
|
@@ -141,7 +141,7 @@ import { createEidsArray, buildEidPermissions } from './eids.js';
|
|
|
141
141
|
import { getCoreStorageManager } from '../../src/storageManager.js';
|
|
142
142
|
import {
|
|
143
143
|
getPrebidInternal, isPlainObject, logError, isArray, cyrb53Hash, deepAccess, timestamp, delayExecution, logInfo, isFn,
|
|
144
|
-
logWarn, isEmptyStr, isNumber
|
|
144
|
+
logWarn, isEmptyStr, isNumber, isGptPubadsDefined
|
|
145
145
|
} from '../../src/utils.js';
|
|
146
146
|
import includes from 'core-js-pure/features/array/includes.js';
|
|
147
147
|
|
|
@@ -184,6 +184,9 @@ export let syncDelay;
|
|
|
184
184
|
/** @type {(number|undefined)} */
|
|
185
185
|
export let auctionDelay;
|
|
186
186
|
|
|
187
|
+
/** @type {(string|undefined)} */
|
|
188
|
+
let ppidSource;
|
|
189
|
+
|
|
187
190
|
/** @param {Submodule[]} submodules */
|
|
188
191
|
export function setSubmoduleRegistry(submodules) {
|
|
189
192
|
submoduleRegistry = submodules;
|
|
@@ -557,6 +560,26 @@ export function requestBidsHook(fn, reqBidsConfigObj) {
|
|
|
557
560
|
initializeSubmodulesAndExecuteCallbacks(function () {
|
|
558
561
|
// pass available user id data to bid adapters
|
|
559
562
|
addIdDataToAdUnitBids(reqBidsConfigObj.adUnits || getGlobal().adUnits, initializedSubmodules);
|
|
563
|
+
|
|
564
|
+
// userSync.ppid should be one of the 'source' values in getUserIdsAsEids() eg pubcid.org or id5-sync.com
|
|
565
|
+
const matchingUserId = ppidSource && (getUserIdsAsEids() || []).find(userID => userID.source === ppidSource);
|
|
566
|
+
if (matchingUserId && typeof deepAccess(matchingUserId, 'uids.0.id') === 'string') {
|
|
567
|
+
const ppidValue = matchingUserId.uids[0].id.replace(/[\W_]/g, '');
|
|
568
|
+
if (ppidValue.length >= 32 && ppidValue.length <= 150) {
|
|
569
|
+
if (isGptPubadsDefined()) {
|
|
570
|
+
window.googletag.pubads().setPublisherProvidedId(ppidValue);
|
|
571
|
+
} else {
|
|
572
|
+
window.googletag = window.googletag || {};
|
|
573
|
+
window.googletag.cmd = window.googletag.cmd || [];
|
|
574
|
+
window.googletag.cmd.push(function() {
|
|
575
|
+
window.googletag.pubads().setPublisherProvidedId(ppidValue);
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
} else {
|
|
579
|
+
logWarn(`User ID - Googletag Publisher Provided ID for ${ppidSource} is not between 32 and 150 characters - ${ppidValue}`);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
560
583
|
// calling fn allows prebid to continue processing
|
|
561
584
|
fn.call(this, reqBidsConfigObj);
|
|
562
585
|
});
|
|
@@ -817,6 +840,7 @@ export function attachIdSystem(submodule) {
|
|
|
817
840
|
* @param {{getConfig:function}} config
|
|
818
841
|
*/
|
|
819
842
|
export function init(config) {
|
|
843
|
+
ppidSource = undefined;
|
|
820
844
|
submodules = [];
|
|
821
845
|
configRegistry = [];
|
|
822
846
|
addedUserIdHook = false;
|
|
@@ -839,9 +863,10 @@ export function init(config) {
|
|
|
839
863
|
}
|
|
840
864
|
|
|
841
865
|
// listen for config userSyncs to be set
|
|
842
|
-
config.getConfig(conf => {
|
|
866
|
+
config.getConfig('userSync', conf => {
|
|
843
867
|
// Note: support for 'usersync' was dropped as part of Prebid.js 4.0
|
|
844
868
|
const userSync = conf.userSync;
|
|
869
|
+
ppidSource = userSync.ppid;
|
|
845
870
|
if (userSync && userSync.userIds) {
|
|
846
871
|
configRegistry = userSync.userIds;
|
|
847
872
|
syncDelay = isNumber(userSync.syncDelay) ? userSync.syncDelay : DEFAULT_SYNC_DELAY;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: bidder
|
|
3
|
+
title: ventes
|
|
4
|
+
description: Prebid ventes Bidder Adapter
|
|
5
|
+
pbjs: false
|
|
6
|
+
biddercode: ventes
|
|
7
|
+
gdpr_supported: false
|
|
8
|
+
usp_supported: false
|
|
9
|
+
media_types: banner
|
|
10
|
+
coppa_supported: false
|
|
11
|
+
schain_supported: false
|
|
12
|
+
dchain_supported: false
|
|
13
|
+
prebid_member: false
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
### BidParams
|
|
17
|
+
{: .table .table-bordered .table-striped }
|
|
18
|
+
| Name | Scope | Description | Example | Type |
|
|
19
|
+
|-----------------|----------|-----------------------------------------------------------|----------------------------------------------|---------------|
|
|
20
|
+
| `placementId` | required | Placement ID from Ventes Avenues | `'VA-062-0013-0183'` | `string` |
|
|
21
|
+
| `publisherId` | required | Publisher ID from Ventes Avenues | `'VA-062'` | `string` |
|
|
22
|
+
| `user` | optional | Object that specifies information about an external user. | `user: { age: 25, gender: 0, dnt: true}` | `object` |
|
|
23
|
+
| `app` | optional | Object containing mobile app parameters. | `app : { id: 'app-id'}` | `object` |
|
|
24
|
+
|
|
25
|
+
#### User Object
|
|
26
|
+
|
|
27
|
+
{: .table .table-bordered .table-striped }
|
|
28
|
+
| Name | Description | Example | Type |
|
|
29
|
+
|-------------------|-------------------------------------------------------------------------------------------|-----------------------|-----------------------|
|
|
30
|
+
| `age` | The age of the user. | `35` | `integer` |
|
|
31
|
+
| `externalUid` | Specifies a string that corresponds to an external user ID for this user. | `'1234567890abcdefg'` | `string` |
|
|
32
|
+
| `segments` | Specifies the segments to which the user belongs. | `[1, 2]` | `Array<integer>` |
|
|
33
|
+
| `gender` | Specifies the gender of the user. Allowed values: Unknown: `0`; Male: `1`; Female: `2` | `1` | `integer` |
|
|
34
|
+
| `dnt` | Do not track flag. Indicates if tracking cookies should be disabled for this auction | `true` | `boolean` |
|
|
35
|
+
| `language` | Two-letter ANSI code for this user's language. | `EN` | `string` |
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Ad Unit Setup for Banner
|
|
39
|
+
```javascript
|
|
40
|
+
var adUnits = [
|
|
41
|
+
{
|
|
42
|
+
code: 'test-hb-ad-11111-1',
|
|
43
|
+
mediaTypes: {
|
|
44
|
+
banner: {
|
|
45
|
+
sizes: [
|
|
46
|
+
[300, 250]
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
bids: [{
|
|
51
|
+
bidder: 'ventes',
|
|
52
|
+
params: {
|
|
53
|
+
placementId: 'VA-062-0013-0183',
|
|
54
|
+
publisherId: '5cebea3c9eea646c7b623d5e',
|
|
55
|
+
IABCategories: "['IAB1', 'IAB5']",
|
|
56
|
+
device:{
|
|
57
|
+
ip: '123.145.167.189',
|
|
58
|
+
ifa:"AEBE52E7-03EE-455A-B3C4-E57283966239",
|
|
59
|
+
},
|
|
60
|
+
app: {
|
|
61
|
+
id: "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfIUDA",
|
|
62
|
+
name: "Yahoo Weather",
|
|
63
|
+
bundle: 'com.kiloo.subwaysurf',
|
|
64
|
+
storeurl: 'https://play.google.com/store/apps/details?id=com.kiloo.subwaysurf&hl=en',
|
|
65
|
+
domain: 'somoaudience.com',
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}]
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
```
|