prebid.js 5.16.0 → 5.20.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/.devcontainer/Dockerfile +11 -0
- package/.devcontainer/devcontainer.json +27 -0
- package/.devcontainer/postCreate.sh +6 -0
- package/browsers.json +1 -0
- package/integrationExamples/gpt/akamaidap_segments_example.html +132 -0
- package/modules/.submodules.json +1 -0
- package/modules/adfBidAdapter.js +21 -16
- package/modules/adgenerationBidAdapter.js +28 -4
- package/modules/adkernelBidAdapter.js +3 -1
- package/modules/admixerBidAdapter.js +11 -0
- package/modules/adnuntiusBidAdapter.js +1 -0
- package/modules/adtelligentBidAdapter.js +2 -1
- package/modules/airgridRtdProvider.js +1 -1
- package/modules/akamaiDapRtdProvider.js +474 -0
- package/modules/akamaiDapRtdProvider.md +47 -0
- package/modules/aolBidAdapter.js +2 -1
- package/modules/appnexusBidAdapter.js +5 -3
- package/modules/atsAnalyticsAdapter.js +89 -63
- package/modules/atsAnalyticsAdapter.md +1 -0
- package/modules/betweenBidAdapter.js +20 -3
- package/modules/bliinkBidAdapter.js +58 -32
- package/modules/bliinkBidAdapter.md +29 -6
- package/modules/browsiRtdProvider.js +106 -18
- package/modules/cleanioRtdProvider.js +192 -0
- package/modules/cleanioRtdProvider.md +59 -0
- package/modules/codefuelBidAdapter.js +183 -0
- package/modules/codefuelBidAdapter.md +111 -0
- package/modules/connectIdSystem.js +104 -0
- package/modules/connectIdSystem.md +33 -0
- package/modules/cwireBidAdapter.js +272 -0
- package/modules/cwireBidAdapter.md +43 -0
- package/modules/deepintentBidAdapter.js +106 -9
- package/modules/deepintentBidAdapter.md +36 -1
- package/modules/deltaprojectsBidAdapter.js +252 -0
- package/modules/deltaprojectsBidAdapter.md +32 -0
- package/modules/dgkeywordRtdProvider.js +0 -1
- package/modules/engageyaBidAdapter.js +157 -0
- package/modules/glimpseBidAdapter.js +160 -48
- package/modules/glimpseBidAdapter.md +11 -74
- package/modules/gridBidAdapter.js +1 -0
- package/modules/gridNMBidAdapter.js +7 -6
- package/modules/gumgumBidAdapter.js +16 -2
- package/modules/iasRtdProvider.js +83 -67
- package/modules/inskinBidAdapter.js +7 -3
- package/modules/ixBidAdapter.js +8 -1
- package/modules/jixieBidAdapter.js +8 -2
- package/modules/justpremiumBidAdapter.js +6 -1
- package/modules/kargoBidAdapter.js +14 -7
- package/modules/kargoBidAdapter.md +20 -0
- package/modules/limelightDigitalBidAdapter.js +22 -2
- package/modules/livewrappedAnalyticsAdapter.js +53 -3
- package/modules/mediakeysBidAdapter.js +405 -14
- package/modules/mediakeysBidAdapter.md +108 -0
- package/modules/multibid/index.js +3 -3
- package/modules/mytargetBidAdapter.js +112 -0
- package/modules/nativoBidAdapter.js +48 -29
- package/modules/nativoBidAdapter.md +0 -1
- package/modules/nextMillenniumBidAdapter.js +12 -3
- package/modules/nextrollBidAdapter.js +375 -0
- package/modules/nobidBidAdapter.js +2 -1
- package/modules/oguryBidAdapter.js +36 -7
- package/modules/openxBidAdapter.js +34 -22
- package/modules/operaadsBidAdapter.js +21 -1
- package/modules/otmBidAdapter.js +146 -0
- package/modules/otmBidAdapter.md +27 -26
- package/modules/outbrainBidAdapter.js +5 -0
- package/modules/pixfutureBidAdapter.js +24 -4
- package/modules/pixfutureBidAdapter.md +127 -0
- package/modules/playwireBidAdapter.md +61 -0
- package/modules/prebidServerBidAdapter/index.js +1 -1
- package/modules/proxistoreBidAdapter.js +4 -6
- package/modules/publinkIdSystem.js +17 -7
- package/modules/publinkIdSystem.md +7 -2
- package/modules/pubmaticBidAdapter.js +22 -6
- package/modules/pubmaticBidAdapter.md +1 -1
- package/modules/relaidoBidAdapter.js +8 -2
- package/modules/rtdModule/index.js +2 -2
- package/modules/sharethroughBidAdapter.js +12 -19
- package/modules/slimcutBidAdapter.js +121 -0
- package/modules/sonobiBidAdapter.js +7 -0
- package/modules/sortableBidAdapter.js +1 -0
- package/modules/spotxBidAdapter.js +15 -1
- package/modules/sspBCBidAdapter.js +207 -12
- package/modules/sspBCBidAdapter.md +1 -1
- package/modules/talkadsBidAdapter.js +129 -0
- package/modules/talkadsBidAdapter.md +60 -0
- package/modules/tappxBidAdapter.js +6 -5
- package/modules/teadsBidAdapter.js +3 -0
- package/modules/tripleliftBidAdapter.js +22 -5
- package/modules/trustxBidAdapter.js +17 -11
- package/modules/undertoneBidAdapter.js +9 -5
- package/modules/undertoneBidAdapter.md +5 -1
- package/modules/unicornBidAdapter.js +3 -3
- package/modules/userId/eids.js +18 -0
- package/modules/userId/eids.md +7 -0
- package/modules/userId/userId.md +12 -0
- package/modules/ventesBidAdapter.js +370 -0
- package/modules/ventesBidAdapter.md +94 -0
- package/modules/videobyteBidAdapter.js +13 -6
- package/modules/videobyteBidAdapter.md +49 -0
- package/modules/vidoomyBidAdapter.js +20 -12
- package/modules/visxBidAdapter.js +15 -22
- package/modules/yahoosspBidAdapter.js +637 -0
- package/modules/yahoosspBidAdapter.md +795 -0
- package/modules/yieldlabBidAdapter.js +48 -3
- package/modules/yieldlabBidAdapter.md +16 -1
- package/modules/yieldmoBidAdapter.js +20 -6
- package/modules/yieldmoSyntheticInventoryModule.js +46 -0
- package/modules/yieldmoSyntheticInventoryModule.md +68 -0
- package/package.json +1 -1
- package/src/adapterManager.js +5 -0
- package/src/adapters/bidderFactory.js +4 -3
- package/src/auction.js +11 -11
- package/src/constants.json +1 -0
- package/src/secureCreatives.js +6 -7
- package/src/targeting.js +11 -9
- package/test/.eslintrc.js +2 -1
- package/test/spec/modules/adfBidAdapter_spec.js +83 -29
- package/test/spec/modules/adgenerationBidAdapter_spec.js +121 -50
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +68 -0
- package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
- package/test/spec/modules/akamaiDapRtdProvider_spec.js +246 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +2 -1
- package/test/spec/modules/atsAnalyticsAdapter_spec.js +77 -9
- package/test/spec/modules/betweenBidAdapter_spec.js +41 -0
- package/test/spec/modules/bliinkBidAdapter_spec.js +87 -36
- package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
- package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
- package/test/spec/modules/codefuelBidAdapter_spec.js +316 -0
- package/test/spec/modules/connectIdSystem_spec.js +189 -0
- package/test/spec/modules/cwireBidAdapter_spec.js +246 -0
- package/test/spec/modules/deepintentBidAdapter_spec.js +153 -3
- package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
- package/test/spec/modules/engageyaBidAdapter_spec.js +286 -0
- package/test/spec/modules/glimpseBidAdapter_spec.js +302 -204
- package/test/spec/modules/gridNMBidAdapter_spec.js +40 -1
- package/test/spec/modules/gumgumBidAdapter_spec.js +23 -6
- package/test/spec/modules/iasRtdProvider_spec.js +71 -6
- package/test/spec/modules/ixBidAdapter_spec.js +13 -3
- package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
- package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +155 -1
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +67 -12
- package/test/spec/modules/mediakeysBidAdapter_spec.js +406 -51
- package/test/spec/modules/multibid_spec.js +31 -31
- package/test/spec/modules/mytargetBidAdapter_spec.js +199 -0
- package/test/spec/modules/nativoBidAdapter_spec.js +50 -3
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +13 -1
- package/test/spec/modules/nextrollBidAdapter_spec.js +290 -0
- package/test/spec/modules/nobidBidAdapter_spec.js +65 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +125 -37
- package/test/spec/modules/openxBidAdapter_spec.js +85 -13
- package/test/spec/modules/operaadsBidAdapter_spec.js +38 -6
- package/test/spec/modules/otmBidAdapter_spec.js +67 -0
- package/test/spec/modules/outbrainBidAdapter_spec.js +18 -0
- package/test/spec/modules/publinkIdSystem_spec.js +34 -15
- package/test/spec/modules/pubmaticBidAdapter_spec.js +217 -1
- package/test/spec/modules/relaidoBidAdapter_spec.js +21 -20
- package/test/spec/modules/sharethroughBidAdapter_spec.js +156 -136
- package/test/spec/modules/slimcutBidAdapter_spec.js +200 -0
- package/test/spec/modules/sonobiBidAdapter_spec.js +34 -1
- package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
- package/test/spec/modules/spotxBidAdapter_spec.js +36 -0
- package/test/spec/modules/sspBCBidAdapter_spec.js +210 -62
- package/test/spec/modules/talkadsBidAdapter_spec.js +231 -0
- package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
- package/test/spec/modules/tripleliftBidAdapter_spec.js +128 -0
- package/test/spec/modules/trustxBidAdapter_spec.js +38 -5
- package/test/spec/modules/undertoneBidAdapter_spec.js +52 -0
- package/test/spec/modules/unicornBidAdapter_spec.js +4 -4
- package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
- package/test/spec/modules/videobyteBidAdapter_spec.js +2 -2
- package/test/spec/modules/visxBidAdapter_spec.js +48 -4
- package/test/spec/modules/yahoosspBidAdapter_spec.js +1332 -0
- package/test/spec/modules/yieldlabBidAdapter_spec.js +65 -1
- package/test/spec/modules/yieldmoBidAdapter_spec.js +30 -9
- package/test/spec/modules/yieldmoSyntheticInventoryModule_spec.js +89 -0
- package/test/spec/unit/core/adapterManager_spec.js +32 -0
- package/test/spec/unit/core/bidderFactory_spec.js +61 -1
- package/test/spec/unit/pbjs_api_spec.js +37 -2
- package/test/spec/unit/secureCreatives_spec.js +54 -25
- package/modules/turktelekomBidAdapter.md +0 -49
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { isEmpty } from '../src/utils.js'
|
|
2
|
-
import { registerBidder } from '../src/adapters/bidderFactory.js'
|
|
3
|
-
import { BANNER } from '../src/mediaTypes.js'
|
|
1
|
+
import { deepAccess, isEmpty } from '../src/utils.js'
|
|
2
|
+
import { registerBidder } from '../src/adapters/bidderFactory.js'
|
|
3
|
+
import { BANNER } from '../src/mediaTypes.js'
|
|
4
4
|
// import { config } from 'src/config'
|
|
5
5
|
|
|
6
|
-
const BIDDER_CODE = 'nativo'
|
|
7
|
-
const BIDDER_ENDPOINT = 'https://exchange.postrelease.com/prebid'
|
|
6
|
+
const BIDDER_CODE = 'nativo'
|
|
7
|
+
const BIDDER_ENDPOINT = 'https://exchange.postrelease.com/prebid'
|
|
8
8
|
|
|
9
|
-
const GVLID = 263
|
|
9
|
+
const GVLID = 263
|
|
10
10
|
|
|
11
|
-
const TIME_TO_LIVE = 360
|
|
11
|
+
const TIME_TO_LIVE = 360
|
|
12
12
|
|
|
13
|
-
const SUPPORTED_AD_TYPES = [BANNER]
|
|
13
|
+
const SUPPORTED_AD_TYPES = [BANNER]
|
|
14
14
|
|
|
15
|
-
const bidRequestMap = {}
|
|
16
|
-
const adUnitsRequested = {}
|
|
15
|
+
const bidRequestMap = {}
|
|
16
|
+
const adUnitsRequested = {}
|
|
17
17
|
|
|
18
18
|
// Prebid adapter referrence doc: https://docs.prebid.org/dev-docs/bidder-adaptor.html
|
|
19
19
|
|
|
@@ -30,7 +30,7 @@ export const spec = {
|
|
|
30
30
|
* @return boolean True if this is a valid bid, and false otherwise.
|
|
31
31
|
*/
|
|
32
32
|
isBidRequestValid: function (bid) {
|
|
33
|
-
return
|
|
33
|
+
return true
|
|
34
34
|
},
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -42,27 +42,37 @@ export const spec = {
|
|
|
42
42
|
* @return ServerRequest Info describing the request to the server.
|
|
43
43
|
*/
|
|
44
44
|
buildRequests: function (validBidRequests, bidderRequest) {
|
|
45
|
-
const placementIds =
|
|
45
|
+
const placementIds = new Set()
|
|
46
46
|
const placmentBidIdMap = {}
|
|
47
47
|
let placementId, pageUrl
|
|
48
48
|
validBidRequests.forEach((request) => {
|
|
49
|
-
pageUrl =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
pageUrl = deepAccess(
|
|
50
|
+
request,
|
|
51
|
+
'params.url',
|
|
52
|
+
bidderRequest.refererInfo.referer
|
|
53
|
+
)
|
|
54
|
+
placementId = deepAccess(request, 'params.placementId')
|
|
55
|
+
|
|
56
|
+
if (placementId) {
|
|
57
|
+
placementIds.add(placementId)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
var key = placementId || request.adUnitCode
|
|
61
|
+
placmentBidIdMap[key] = {
|
|
53
62
|
bidId: request.bidId,
|
|
54
63
|
size: getLargestSize(request.sizes),
|
|
55
64
|
}
|
|
56
65
|
})
|
|
57
66
|
bidRequestMap[bidderRequest.bidderRequestId] = placmentBidIdMap
|
|
58
67
|
|
|
59
|
-
if (!pageUrl) pageUrl = bidderRequest.refererInfo.referer
|
|
60
|
-
|
|
61
68
|
// Build adUnit data
|
|
62
69
|
const adUnitData = {
|
|
63
70
|
adUnits: validBidRequests.map((adUnit) => {
|
|
64
71
|
// Track if we've already requested for this ad unit code
|
|
65
|
-
adUnitsRequested[adUnit.adUnitCode] =
|
|
72
|
+
adUnitsRequested[adUnit.adUnitCode] =
|
|
73
|
+
adUnitsRequested[adUnit.adUnitCode] !== undefined
|
|
74
|
+
? adUnitsRequested[adUnit.adUnitCode] + 1
|
|
75
|
+
: 0
|
|
66
76
|
return {
|
|
67
77
|
adUnitCode: adUnit.adUnitCode,
|
|
68
78
|
mediaTypes: adUnit.mediaTypes,
|
|
@@ -72,7 +82,6 @@ export const spec = {
|
|
|
72
82
|
|
|
73
83
|
// Build QS Params
|
|
74
84
|
let params = [
|
|
75
|
-
{ key: 'ntv_ptd', value: placementIds.toString() },
|
|
76
85
|
{ key: 'ntv_pb_rid', value: bidderRequest.bidderRequestId },
|
|
77
86
|
{
|
|
78
87
|
key: 'ntv_ppc',
|
|
@@ -80,14 +89,22 @@ export const spec = {
|
|
|
80
89
|
},
|
|
81
90
|
{
|
|
82
91
|
key: 'ntv_dbr',
|
|
83
|
-
value: btoa(JSON.stringify(adUnitsRequested))
|
|
92
|
+
value: btoa(JSON.stringify(adUnitsRequested)),
|
|
84
93
|
},
|
|
85
94
|
{
|
|
86
95
|
key: 'ntv_url',
|
|
87
96
|
value: encodeURIComponent(pageUrl),
|
|
88
|
-
}
|
|
97
|
+
},
|
|
89
98
|
]
|
|
90
99
|
|
|
100
|
+
if (placementIds.size > 0) {
|
|
101
|
+
// Convert Set to Array (IE 11 Safe)
|
|
102
|
+
const placements = []
|
|
103
|
+
placementIds.forEach((value) => placements.push(value))
|
|
104
|
+
// Append to query string paramters
|
|
105
|
+
params.unshift({ key: 'ntv_ptd', value: placements.join(',') })
|
|
106
|
+
}
|
|
107
|
+
|
|
91
108
|
if (bidderRequest.gdprConsent) {
|
|
92
109
|
// Put on the beginning of the qs param array
|
|
93
110
|
params.unshift({
|
|
@@ -135,7 +152,7 @@ export const spec = {
|
|
|
135
152
|
let bidResponse, adUnit
|
|
136
153
|
seatbids.forEach((seatbid) => {
|
|
137
154
|
seatbid.bid.forEach((bid) => {
|
|
138
|
-
adUnit = this.
|
|
155
|
+
adUnit = this.getAdUnitData(body.id, bid)
|
|
139
156
|
bidResponse = {
|
|
140
157
|
requestId: adUnit.bidId,
|
|
141
158
|
cpm: bid.price,
|
|
@@ -268,14 +285,16 @@ export const spec = {
|
|
|
268
285
|
/**
|
|
269
286
|
* Maps Prebid's bidId to Nativo's placementId values per unique bidderRequestId
|
|
270
287
|
* @param {String} bidderRequestId - The unique ID value associated with the bidderRequest
|
|
271
|
-
* @param {
|
|
288
|
+
* @param {Object} bid - The placement ID value from Nativo
|
|
272
289
|
* @returns {String} - The bidId value associated with the corresponding placementId
|
|
273
290
|
*/
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
291
|
+
getAdUnitData: function (bidderRequestId, bid) {
|
|
292
|
+
var data = deepAccess(bidRequestMap, `${bidderRequestId}.${bid.impid}`)
|
|
293
|
+
|
|
294
|
+
if (data) return data
|
|
295
|
+
|
|
296
|
+
var unitCode = deepAccess(bid, 'ext.ad_unit_id')
|
|
297
|
+
return deepAccess(bidRequestMap, `${bidderRequestId}.${unitCode}`)
|
|
279
298
|
},
|
|
280
299
|
}
|
|
281
300
|
registerBidder(spec)
|
|
@@ -30,14 +30,23 @@ export const spec = {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
+
|
|
33
34
|
const gdprConsent = bidderRequest && bidderRequest.gdprConsent;
|
|
35
|
+
const uspConsent = bidderRequest && bidderRequest.uspConsent
|
|
36
|
+
|
|
37
|
+
if (gdprConsent || uspConsent) {
|
|
38
|
+
postBody.regs = { ext: {} }
|
|
34
39
|
|
|
35
|
-
|
|
40
|
+
if (uspConsent) {
|
|
41
|
+
postBody.regs.ext.us_privacy = uspConsent;
|
|
42
|
+
}
|
|
36
43
|
if (typeof gdprConsent.gdprApplies !== 'undefined') {
|
|
37
|
-
postBody.
|
|
44
|
+
postBody.regs.ext.gdpr = gdprConsent.gdprApplies ? 1 : 0;
|
|
38
45
|
}
|
|
39
46
|
if (typeof gdprConsent.consentString !== 'undefined') {
|
|
40
|
-
postBody.
|
|
47
|
+
postBody.user = {
|
|
48
|
+
ext: { consent: gdprConsent.consentString }
|
|
49
|
+
}
|
|
41
50
|
}
|
|
42
51
|
}
|
|
43
52
|
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import {
|
|
2
|
+
deepAccess,
|
|
3
|
+
parseUrl,
|
|
4
|
+
isNumber,
|
|
5
|
+
getBidIdParameter,
|
|
6
|
+
isPlainObject,
|
|
7
|
+
isFn,
|
|
8
|
+
isStr,
|
|
9
|
+
replaceAuctionPrice,
|
|
10
|
+
isArray,
|
|
11
|
+
} from '../src/utils.js';
|
|
12
|
+
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
13
|
+
import { BANNER, NATIVE } from '../src/mediaTypes.js';
|
|
14
|
+
|
|
15
|
+
import find from 'core-js-pure/features/array/find.js';
|
|
16
|
+
|
|
17
|
+
const BIDDER_CODE = 'nextroll';
|
|
18
|
+
const BIDDER_ENDPOINT = 'https://d.adroll.com/bid/prebid/';
|
|
19
|
+
const ADAPTER_VERSION = 5;
|
|
20
|
+
|
|
21
|
+
export const spec = {
|
|
22
|
+
code: BIDDER_CODE,
|
|
23
|
+
supportedMediaTypes: [BANNER, NATIVE],
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Determines whether or not the given bid request is valid.
|
|
27
|
+
*
|
|
28
|
+
* @param {BidRequest} bid The bid params to validate.
|
|
29
|
+
* @return boolean True if this is a valid bid, and false otherwise.
|
|
30
|
+
*/
|
|
31
|
+
isBidRequestValid: function (bidRequest) {
|
|
32
|
+
return bidRequest !== undefined && !!bidRequest.params && !!bidRequest.bidId;
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Make a server request from the list of BidRequests.
|
|
37
|
+
*
|
|
38
|
+
* @param {validBidRequests[]} - an array of bids
|
|
39
|
+
* @return ServerRequest Info describing the request to the server.
|
|
40
|
+
*/
|
|
41
|
+
buildRequests: function (validBidRequests, bidderRequest) {
|
|
42
|
+
let topLocation = parseUrl(deepAccess(bidderRequest, 'refererInfo.referer'));
|
|
43
|
+
|
|
44
|
+
return validBidRequests.map((bidRequest) => {
|
|
45
|
+
return {
|
|
46
|
+
method: 'POST',
|
|
47
|
+
options: {
|
|
48
|
+
withCredentials: true,
|
|
49
|
+
},
|
|
50
|
+
url: BIDDER_ENDPOINT,
|
|
51
|
+
data: {
|
|
52
|
+
id: bidRequest.bidId,
|
|
53
|
+
imp: {
|
|
54
|
+
id: bidRequest.bidId,
|
|
55
|
+
bidfloor: _getFloor(bidRequest),
|
|
56
|
+
banner: _getBanner(bidRequest),
|
|
57
|
+
native: _getNative(deepAccess(bidRequest, 'mediaTypes.native')),
|
|
58
|
+
ext: {
|
|
59
|
+
zone: {
|
|
60
|
+
id: getBidIdParameter('zoneId', bidRequest.params)
|
|
61
|
+
},
|
|
62
|
+
nextroll: {
|
|
63
|
+
adapter_version: ADAPTER_VERSION
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
user: _getUser(validBidRequests),
|
|
69
|
+
site: _getSite(bidRequest, topLocation),
|
|
70
|
+
seller: _getSeller(bidRequest),
|
|
71
|
+
device: _getDevice(bidRequest),
|
|
72
|
+
regs: _getRegs(bidderRequest)
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Unpack the response from the server into a list of bids.
|
|
80
|
+
*
|
|
81
|
+
* @param {ServerResponse} serverResponse A successful response from the server.
|
|
82
|
+
* @return {Bid[]} An array of bids which were nested inside the server.
|
|
83
|
+
*/
|
|
84
|
+
interpretResponse: function (serverResponse, bidRequest) {
|
|
85
|
+
if (!serverResponse.body) {
|
|
86
|
+
return [];
|
|
87
|
+
} else {
|
|
88
|
+
let response = serverResponse.body
|
|
89
|
+
let bids = response.seatbid.reduce((acc, seatbid) => acc.concat(seatbid.bid), []);
|
|
90
|
+
return bids.map((bid) => _buildResponse(response, bid));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function _getBanner(bidRequest) {
|
|
96
|
+
let sizes = _getSizes(bidRequest);
|
|
97
|
+
if (sizes === undefined) return undefined;
|
|
98
|
+
return {format: sizes};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function _getNative(mediaTypeNative) {
|
|
102
|
+
if (mediaTypeNative === undefined) return undefined;
|
|
103
|
+
let assets = _getNativeAssets(mediaTypeNative);
|
|
104
|
+
if (assets === undefined || assets.length == 0) return undefined;
|
|
105
|
+
return {
|
|
106
|
+
request: {
|
|
107
|
+
native: {
|
|
108
|
+
assets: assets
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
id: Unique numeric id for the asset
|
|
116
|
+
kind: OpenRTB kind of asset. Supported: title, img and data.
|
|
117
|
+
key: Name of property that comes in the mediaType.native object.
|
|
118
|
+
type: OpenRTB type for that spefic kind of asset.
|
|
119
|
+
required: Overrides the asset required field configured, only overrides when is true.
|
|
120
|
+
*/
|
|
121
|
+
const NATIVE_ASSET_MAP = [
|
|
122
|
+
{id: 1, kind: 'title', key: 'title', required: true},
|
|
123
|
+
{id: 2, kind: 'img', key: 'image', type: 3, required: true},
|
|
124
|
+
{id: 3, kind: 'img', key: 'icon', type: 1},
|
|
125
|
+
{id: 4, kind: 'img', key: 'logo', type: 2},
|
|
126
|
+
{id: 5, kind: 'data', key: 'sponsoredBy', type: 1},
|
|
127
|
+
{id: 6, kind: 'data', key: 'body', type: 2}
|
|
128
|
+
];
|
|
129
|
+
|
|
130
|
+
const ASSET_KIND_MAP = {
|
|
131
|
+
title: _getTitleAsset,
|
|
132
|
+
img: _getImageAsset,
|
|
133
|
+
data: _getDataAsset,
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
function _getAsset(mediaTypeNative, assetMap) {
|
|
137
|
+
const asset = mediaTypeNative[assetMap.key];
|
|
138
|
+
if (asset === undefined) return undefined;
|
|
139
|
+
const assetFunc = ASSET_KIND_MAP[assetMap.kind];
|
|
140
|
+
return {
|
|
141
|
+
id: assetMap.id,
|
|
142
|
+
required: (assetMap.required || !!asset.required) ? 1 : 0,
|
|
143
|
+
[assetMap.kind]: assetFunc(asset, assetMap)
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function _getTitleAsset(title, _assetMap) {
|
|
148
|
+
return {len: title.len || 0};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function _getMinAspectRatio(aspectRatio, property) {
|
|
152
|
+
if (!isPlainObject(aspectRatio)) return 1;
|
|
153
|
+
|
|
154
|
+
const ratio = aspectRatio['ratio_' + property];
|
|
155
|
+
const min = aspectRatio['min_' + property];
|
|
156
|
+
|
|
157
|
+
if (isNumber(ratio)) return ratio;
|
|
158
|
+
if (isNumber(min)) return min;
|
|
159
|
+
|
|
160
|
+
return 1;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function _getImageAsset(image, assetMap) {
|
|
164
|
+
const sizes = image.sizes;
|
|
165
|
+
const aspectRatio = image.aspect_ratios ? image.aspect_ratios[0] : undefined;
|
|
166
|
+
|
|
167
|
+
return {
|
|
168
|
+
type: assetMap.type,
|
|
169
|
+
w: (sizes ? sizes[0] : undefined),
|
|
170
|
+
h: (sizes ? sizes[1] : undefined),
|
|
171
|
+
wmin: _getMinAspectRatio(aspectRatio, 'width'),
|
|
172
|
+
hmin: _getMinAspectRatio(aspectRatio, 'height'),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function _getDataAsset(data, assetMap) {
|
|
177
|
+
return {
|
|
178
|
+
type: assetMap.type,
|
|
179
|
+
len: data.len || 0
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function _getNativeAssets(mediaTypeNative) {
|
|
184
|
+
return NATIVE_ASSET_MAP
|
|
185
|
+
.map(assetMap => _getAsset(mediaTypeNative, assetMap))
|
|
186
|
+
.filter(asset => asset !== undefined);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function _getUser(requests) {
|
|
190
|
+
const id = deepAccess(requests, '0.userId.nextrollId');
|
|
191
|
+
if (id === undefined) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return {
|
|
196
|
+
ext: {
|
|
197
|
+
eid: [{
|
|
198
|
+
'source': 'nextroll',
|
|
199
|
+
id
|
|
200
|
+
}]
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function _getFloor(bidRequest) {
|
|
206
|
+
if (!isFn(bidRequest.getFloor)) {
|
|
207
|
+
return (bidRequest.params.bidfloor) ? bidRequest.params.bidfloor : null;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
let floor = bidRequest.getFloor({
|
|
211
|
+
currency: 'USD',
|
|
212
|
+
mediaType: '*',
|
|
213
|
+
size: '*'
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
if (isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') {
|
|
217
|
+
return floor.floor;
|
|
218
|
+
}
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function _buildResponse(bidResponse, bid) {
|
|
223
|
+
let response = {
|
|
224
|
+
requestId: bidResponse.id,
|
|
225
|
+
cpm: bid.price,
|
|
226
|
+
width: bid.w,
|
|
227
|
+
height: bid.h,
|
|
228
|
+
creativeId: bid.crid,
|
|
229
|
+
dealId: bidResponse.dealId,
|
|
230
|
+
currency: 'USD',
|
|
231
|
+
netRevenue: true,
|
|
232
|
+
ttl: 300,
|
|
233
|
+
meta: {
|
|
234
|
+
advertiserDomains: bidResponse.adomain || []
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
if (isStr(bid.adm)) {
|
|
238
|
+
response.mediaType = BANNER;
|
|
239
|
+
response.ad = replaceAuctionPrice(bid.adm, bid.price);
|
|
240
|
+
} else {
|
|
241
|
+
response.mediaType = NATIVE;
|
|
242
|
+
response.native = _getNativeResponse(bid.adm, bid.price);
|
|
243
|
+
}
|
|
244
|
+
return response;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const privacyLink = 'https://info.evidon.com/pub_info/573';
|
|
248
|
+
const privacyIcon = 'https://c.betrad.com/pub/icon1.png';
|
|
249
|
+
|
|
250
|
+
function _getNativeResponse(adm, price) {
|
|
251
|
+
let baseResponse = {
|
|
252
|
+
clickTrackers: (adm.link && adm.link.clicktrackers) || [],
|
|
253
|
+
jstracker: adm.jstracker || [],
|
|
254
|
+
clickUrl: replaceAuctionPrice(adm.link.url, price),
|
|
255
|
+
impressionTrackers: adm.imptrackers.map(impTracker => replaceAuctionPrice(impTracker, price)),
|
|
256
|
+
privacyLink: privacyLink,
|
|
257
|
+
privacyIcon: privacyIcon
|
|
258
|
+
};
|
|
259
|
+
return adm.assets.reduce((accResponse, asset) => {
|
|
260
|
+
const assetMaps = NATIVE_ASSET_MAP.filter(assetMap => assetMap.id === asset.id && asset[assetMap.kind] !== undefined);
|
|
261
|
+
if (assetMaps.length === 0) return accResponse;
|
|
262
|
+
const assetMap = assetMaps[0];
|
|
263
|
+
accResponse[assetMap.key] = _getAssetResponse(asset, assetMap);
|
|
264
|
+
return accResponse;
|
|
265
|
+
}, baseResponse);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function _getAssetResponse(asset, assetMap) {
|
|
269
|
+
switch (assetMap.kind) {
|
|
270
|
+
case 'title':
|
|
271
|
+
return asset.title.text;
|
|
272
|
+
|
|
273
|
+
case 'img':
|
|
274
|
+
return {
|
|
275
|
+
url: asset.img.url,
|
|
276
|
+
width: asset.img.w,
|
|
277
|
+
height: asset.img.h
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
case 'data':
|
|
281
|
+
return asset.data.value;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
function _getSite(bidRequest, topLocation) {
|
|
286
|
+
return {
|
|
287
|
+
page: topLocation.href,
|
|
288
|
+
domain: topLocation.hostname,
|
|
289
|
+
publisher: {
|
|
290
|
+
id: getBidIdParameter('publisherId', bidRequest.params)
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function _getSeller(bidRequest) {
|
|
296
|
+
return {
|
|
297
|
+
id: getBidIdParameter('sellerId', bidRequest.params)
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function _getSizes(bidRequest) {
|
|
302
|
+
if (!isArray(bidRequest.sizes)) {
|
|
303
|
+
return undefined;
|
|
304
|
+
}
|
|
305
|
+
return bidRequest.sizes.filter(_isValidSize).map(size => {
|
|
306
|
+
return {
|
|
307
|
+
w: size[0],
|
|
308
|
+
h: size[1]
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
function _isValidSize(size) {
|
|
314
|
+
const isNumber = x => typeof x === 'number';
|
|
315
|
+
return (size.length === 2 && isNumber(size[0]) && isNumber(size[1]));
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function _getDevice(_bidRequest) {
|
|
319
|
+
return {
|
|
320
|
+
ua: navigator.userAgent,
|
|
321
|
+
language: navigator['language'],
|
|
322
|
+
os: _getOs(navigator.userAgent.toLowerCase()),
|
|
323
|
+
osv: _getOsVersion(navigator.userAgent)
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function _getRegs(bidderRequest) {
|
|
328
|
+
if (!bidderRequest || !bidderRequest.uspConsent) {
|
|
329
|
+
return undefined;
|
|
330
|
+
}
|
|
331
|
+
return {
|
|
332
|
+
ext: {
|
|
333
|
+
us_privacy: bidderRequest.uspConsent
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function _getOs(userAgent) {
|
|
339
|
+
const osTable = {
|
|
340
|
+
'android': /android/i,
|
|
341
|
+
'ios': /iphone|ipad/i,
|
|
342
|
+
'mac': /mac/i,
|
|
343
|
+
'linux': /linux/i,
|
|
344
|
+
'windows': /windows/i
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
return find(Object.keys(osTable), os => {
|
|
348
|
+
if (userAgent.match(osTable[os])) {
|
|
349
|
+
return os;
|
|
350
|
+
}
|
|
351
|
+
}) || 'etc';
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function _getOsVersion(userAgent) {
|
|
355
|
+
const clientStrings = [
|
|
356
|
+
{ s: 'Android', r: /Android/ },
|
|
357
|
+
{ s: 'iOS', r: /(iPhone|iPad|iPod)/ },
|
|
358
|
+
{ s: 'Mac OS X', r: /Mac OS X/ },
|
|
359
|
+
{ s: 'Mac OS', r: /(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/ },
|
|
360
|
+
{ s: 'Linux', r: /(Linux|X11)/ },
|
|
361
|
+
{ s: 'Windows 10', r: /(Windows 10.0|Windows NT 10.0)/ },
|
|
362
|
+
{ s: 'Windows 8.1', r: /(Windows 8.1|Windows NT 6.3)/ },
|
|
363
|
+
{ s: 'Windows 8', r: /(Windows 8|Windows NT 6.2)/ },
|
|
364
|
+
{ s: 'Windows 7', r: /(Windows 7|Windows NT 6.1)/ },
|
|
365
|
+
{ s: 'Windows Vista', r: /Windows NT 6.0/ },
|
|
366
|
+
{ s: 'Windows Server 2003', r: /Windows NT 5.2/ },
|
|
367
|
+
{ s: 'Windows XP', r: /(Windows NT 5.1|Windows XP)/ },
|
|
368
|
+
{ s: 'UNIX', r: /UNIX/ },
|
|
369
|
+
{ s: 'Search Bot', r: /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/ }
|
|
370
|
+
];
|
|
371
|
+
let cs = find(clientStrings, cs => cs.r.test(userAgent));
|
|
372
|
+
return cs ? cs.s : 'unknown';
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
registerBidder(spec);
|
|
@@ -7,7 +7,7 @@ import { getStorageManager } from '../src/storageManager.js';
|
|
|
7
7
|
const GVLID = 816;
|
|
8
8
|
const BIDDER_CODE = 'nobid';
|
|
9
9
|
const storage = getStorageManager(GVLID, BIDDER_CODE);
|
|
10
|
-
window.nobidVersion = '1.3.
|
|
10
|
+
window.nobidVersion = '1.3.2';
|
|
11
11
|
window.nobid = window.nobid || {};
|
|
12
12
|
window.nobid.bidResponses = window.nobid.bidResponses || {};
|
|
13
13
|
window.nobid.timeoutTotal = 0;
|
|
@@ -152,6 +152,7 @@ function nobidBuildRequests(bids, bidderRequest) {
|
|
|
152
152
|
if (cop) state['coppa'] = cop;
|
|
153
153
|
const eids = getEIDs(deepAccess(bids, '0.userIdAsEids'));
|
|
154
154
|
if (eids && eids.length > 0) state['eids'] = eids;
|
|
155
|
+
if (config && config.getConfig('ortb2')) state['ortb2'] = config.getConfig('ortb2');
|
|
155
156
|
return state;
|
|
156
157
|
}
|
|
157
158
|
function newAdunit(adunitObject, adunits) {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
import { BANNER } from '../src/mediaTypes.js';
|
|
4
|
-
import { getAdUnitSizes, logWarn, isFn } from '../src/utils.js';
|
|
4
|
+
import { getAdUnitSizes, logWarn, isFn, getWindowTop, getWindowSelf } from '../src/utils.js';
|
|
5
5
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
6
6
|
import { ajax } from '../src/ajax.js'
|
|
7
7
|
|
|
8
8
|
const BIDDER_CODE = 'ogury';
|
|
9
9
|
const DEFAULT_TIMEOUT = 1000;
|
|
10
10
|
const BID_HOST = 'https://mweb-hb.presage.io/api/header-bidding-request';
|
|
11
|
+
const TIMEOUT_MONITORING_HOST = 'https://ms-ads-monitoring-events.presage.io';
|
|
11
12
|
const MS_COOKIE_SYNC_DOMAIN = 'https://ms-cookie-sync.presage.io';
|
|
12
13
|
|
|
13
14
|
function isBidRequestValid(bid) {
|
|
@@ -23,10 +24,16 @@ function isBidRequestValid(bid) {
|
|
|
23
24
|
function getUserSyncs(syncOptions, serverResponses, gdprConsent, uspConsent) {
|
|
24
25
|
if (!syncOptions.pixelEnabled) return [];
|
|
25
26
|
|
|
26
|
-
return [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
return [
|
|
28
|
+
{
|
|
29
|
+
type: 'image',
|
|
30
|
+
url: `${MS_COOKIE_SYNC_DOMAIN}/v1/init-sync/bid-switch?iab_string=${(gdprConsent && gdprConsent.consentString) || ''}&source=prebid`
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: 'image',
|
|
34
|
+
url: `${MS_COOKIE_SYNC_DOMAIN}/ttd/init-sync?iab_string=${(gdprConsent && gdprConsent.consentString) || ''}&source=prebid`
|
|
35
|
+
}
|
|
36
|
+
]
|
|
30
37
|
}
|
|
31
38
|
|
|
32
39
|
function buildRequests(validBidRequests, bidderRequest) {
|
|
@@ -40,7 +47,8 @@ function buildRequests(validBidRequests, bidderRequest) {
|
|
|
40
47
|
},
|
|
41
48
|
},
|
|
42
49
|
site: {
|
|
43
|
-
domain: location.hostname
|
|
50
|
+
domain: location.hostname,
|
|
51
|
+
page: location.href
|
|
44
52
|
},
|
|
45
53
|
user: {
|
|
46
54
|
ext: {
|
|
@@ -137,10 +145,29 @@ function getFloor(bid) {
|
|
|
137
145
|
return floorResult.currency === 'USD' ? floorResult.floor : 0;
|
|
138
146
|
}
|
|
139
147
|
|
|
148
|
+
function getWindowContext() {
|
|
149
|
+
try {
|
|
150
|
+
return getWindowTop()
|
|
151
|
+
} catch (e) {
|
|
152
|
+
return getWindowSelf()
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
140
156
|
function onBidWon(bid) {
|
|
157
|
+
const w = getWindowContext()
|
|
158
|
+
w.OG_PREBID_BID_OBJECT = {
|
|
159
|
+
...(bid && { ...bid }),
|
|
160
|
+
}
|
|
141
161
|
if (bid && bid.hasOwnProperty('nurl') && bid.nurl.length > 0) ajax(bid['nurl'], null);
|
|
142
162
|
}
|
|
143
163
|
|
|
164
|
+
function onTimeout(timeoutData) {
|
|
165
|
+
ajax(`${TIMEOUT_MONITORING_HOST}/bid_timeout`, null, JSON.stringify(timeoutData[0]), {
|
|
166
|
+
method: 'POST',
|
|
167
|
+
contentType: 'application/json'
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
144
171
|
export const spec = {
|
|
145
172
|
code: BIDDER_CODE,
|
|
146
173
|
supportedMediaTypes: [BANNER],
|
|
@@ -149,7 +176,9 @@ export const spec = {
|
|
|
149
176
|
buildRequests,
|
|
150
177
|
interpretResponse,
|
|
151
178
|
getFloor,
|
|
152
|
-
onBidWon
|
|
179
|
+
onBidWon,
|
|
180
|
+
getWindowContext,
|
|
181
|
+
onTimeout
|
|
153
182
|
}
|
|
154
183
|
|
|
155
184
|
registerBidder(spec);
|