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
|
@@ -34,31 +34,34 @@ Module that connects to an Adxcg.com zone to fetch bids.
|
|
|
34
34
|
code: 'native-ad-div',
|
|
35
35
|
mediaTypes: {
|
|
36
36
|
native: {
|
|
37
|
-
|
|
37
|
+
image: {
|
|
38
38
|
sendId: false,
|
|
39
|
-
required:
|
|
40
|
-
sizes: [
|
|
39
|
+
required: false,
|
|
40
|
+
sizes: [127, 83]
|
|
41
41
|
},
|
|
42
42
|
icon: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
brand: {
|
|
43
|
+
sizes: [80, 80],
|
|
44
|
+
required: false,
|
|
46
45
|
sendId: true,
|
|
47
46
|
},
|
|
48
47
|
title: {
|
|
49
48
|
sendId: false,
|
|
50
|
-
required:
|
|
49
|
+
required: false,
|
|
51
50
|
len: 75
|
|
52
51
|
},
|
|
53
52
|
body: {
|
|
54
53
|
sendId: false,
|
|
55
|
-
required:
|
|
54
|
+
required: false,
|
|
56
55
|
len: 200
|
|
57
56
|
},
|
|
58
|
-
|
|
57
|
+
cta: {
|
|
59
58
|
sendId: false,
|
|
60
59
|
required: false,
|
|
61
|
-
len:
|
|
60
|
+
len: 75
|
|
61
|
+
},
|
|
62
|
+
sponsoredBy: {
|
|
63
|
+
sendId: false,
|
|
64
|
+
required: false
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
},
|
|
@@ -73,21 +76,19 @@ Module that connects to an Adxcg.com zone to fetch bids.
|
|
|
73
76
|
code: 'video-div',
|
|
74
77
|
mediaTypes: {
|
|
75
78
|
video: {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
playerSize: [640, 480],
|
|
80
|
+
context: 'instream',
|
|
81
|
+
mimes: ['video/mp4'],
|
|
82
|
+
protocols: [2, 3, 5, 6, 8],
|
|
83
|
+
playback_method: ['auto_play_sound_off'],
|
|
84
|
+
maxduration: 100,
|
|
85
|
+
skip: 1
|
|
86
|
+
}
|
|
82
87
|
},
|
|
83
88
|
bids: [{
|
|
84
89
|
bidder: 'adxcg',
|
|
85
90
|
params: {
|
|
86
|
-
adzoneid: '20'
|
|
87
|
-
video: {
|
|
88
|
-
maxduration: 100,
|
|
89
|
-
skippable: true
|
|
90
|
-
}
|
|
91
|
+
adzoneid: '20'
|
|
91
92
|
}
|
|
92
93
|
}]
|
|
93
94
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { deepAccess, buildUrl, parseSizesInput } from '../src/utils.js';
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
3
|
import { config } from '../src/config.js';
|
|
4
|
+
import { createEidsArray } from './userId/eids.js';
|
|
4
5
|
import find from 'core-js-pure/features/array/find.js';
|
|
5
6
|
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
|
|
6
7
|
|
|
@@ -97,17 +98,21 @@ export const spec = {
|
|
|
97
98
|
PageRefreshed: getPageRefreshed()
|
|
98
99
|
};
|
|
99
100
|
|
|
100
|
-
if (bidderRequest
|
|
101
|
+
if (bidderRequest.gdprConsent) {
|
|
101
102
|
payload.gdprConsent = {
|
|
102
103
|
consentString: bidderRequest.gdprConsent.consentString,
|
|
103
104
|
consentRequired: (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') ? bidderRequest.gdprConsent.gdprApplies : null
|
|
104
105
|
};
|
|
105
106
|
}
|
|
106
107
|
|
|
107
|
-
if (bidderRequest
|
|
108
|
+
if (bidderRequest.uspConsent) {
|
|
108
109
|
payload.uspConsent = bidderRequest.uspConsent;
|
|
109
110
|
}
|
|
110
111
|
|
|
112
|
+
if (deepAccess(bidderRequest, 'userId')) {
|
|
113
|
+
payload.userId = createEidsArray(bidderRequest.userId);
|
|
114
|
+
}
|
|
115
|
+
|
|
111
116
|
const data = JSON.stringify(payload);
|
|
112
117
|
const options = {
|
|
113
118
|
withCredentials: true
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { convertCamelToUnderscore, isArray, isNumber, isPlainObject, logError, logInfo, deepAccess, logMessage, convertTypes, isStr, getParameterByName, deepClone, chunk, logWarn, getBidRequest, createTrackPixelHtml, isEmpty, transformBidderParamKeywords, getMaxValueFromArray, fill, getMinValueFromArray, isArrayOfNums, isFn } from '../src/utils.js';
|
|
1
|
+
import { convertCamelToUnderscore, isArray, isNumber, isPlainObject, logError, logInfo, deepAccess, logMessage, convertTypes, isStr, getParameterByName, deepClone, chunk, logWarn, getBidRequest, createTrackPixelHtml, isEmpty, transformBidderParamKeywords, getMaxValueFromArray, fill, getMinValueFromArray, isArrayOfNums, isFn, isAllowZeroCpmBidsEnabled } from '../src/utils.js';
|
|
2
2
|
import { Renderer } from '../src/Renderer.js';
|
|
3
3
|
import { config } from '../src/config.js';
|
|
4
4
|
import { registerBidder, getIabSubCategory } from '../src/adapters/bidderFactory.js';
|
|
@@ -78,7 +78,6 @@ export const spec = {
|
|
|
78
78
|
{ code: 'districtm', gvlid: 144 },
|
|
79
79
|
{ code: 'adasta' },
|
|
80
80
|
{ code: 'beintoo', gvlid: 618 },
|
|
81
|
-
{ code: 'targetVideo' },
|
|
82
81
|
],
|
|
83
82
|
supportedMediaTypes: [BANNER, VIDEO, NATIVE],
|
|
84
83
|
|
|
@@ -293,7 +292,8 @@ export const spec = {
|
|
|
293
292
|
serverResponse.tags.forEach(serverBid => {
|
|
294
293
|
const rtbBid = getRtbBid(serverBid);
|
|
295
294
|
if (rtbBid) {
|
|
296
|
-
|
|
295
|
+
const cpmCheck = (isAllowZeroCpmBidsEnabled(bidderRequest.bidderCode)) ? rtbBid.cpm >= 0 : rtbBid.cpm > 0;
|
|
296
|
+
if (cpmCheck && includes(this.supportedMediaTypes, rtbBid.ad_type)) {
|
|
297
297
|
const bid = newBid(serverBid, rtbBid, bidderRequest);
|
|
298
298
|
bid.mediaType = parseMediaType(rtbBid);
|
|
299
299
|
bids.push(bid);
|
|
@@ -598,6 +598,26 @@ function newBid(serverBid, rtbBid, bidderRequest) {
|
|
|
598
598
|
bid.meta = Object.assign({}, bid.meta, { advertiserId: rtbBid.advertiser_id });
|
|
599
599
|
}
|
|
600
600
|
|
|
601
|
+
// temporary function; may remove at later date if/when adserver fully supports dchain
|
|
602
|
+
function setupDChain(rtbBid) {
|
|
603
|
+
let dchain = {
|
|
604
|
+
ver: '1.0',
|
|
605
|
+
complete: 0,
|
|
606
|
+
nodes: [{
|
|
607
|
+
bsid: rtbBid.buyer_member_id.toString()
|
|
608
|
+
}],
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
return dchain;
|
|
612
|
+
}
|
|
613
|
+
if (rtbBid.buyer_member_id) {
|
|
614
|
+
bid.meta = Object.assign({}, bid.meta, {dchain: setupDChain(rtbBid)});
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
if (rtbBid.brand_id) {
|
|
618
|
+
bid.meta = Object.assign({}, bid.meta, { brandId: rtbBid.brand_id });
|
|
619
|
+
}
|
|
620
|
+
|
|
601
621
|
if (rtbBid.rtb.video) {
|
|
602
622
|
// shared video properties used for all 3 contexts
|
|
603
623
|
Object.assign(bid, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logWarn, deepAccess, isArray, parseSizesInput, isFn, parseUrl, getUniqueIdentifierStr } from '../src/utils.js';
|
|
1
|
+
import { logWarn, deepAccess, deepSetValue, deepClone, isArray, parseSizesInput, isFn, parseUrl, getUniqueIdentifierStr } from '../src/utils.js';
|
|
2
2
|
import { config } from '../src/config.js';
|
|
3
3
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
4
4
|
import { Renderer } from '../src/Renderer.js';
|
|
@@ -6,7 +6,7 @@ import { VIDEO, BANNER } from '../src/mediaTypes.js';
|
|
|
6
6
|
import find from 'core-js-pure/features/array/find.js';
|
|
7
7
|
import includes from 'core-js-pure/features/array/includes.js';
|
|
8
8
|
|
|
9
|
-
const ADAPTER_VERSION = '1.
|
|
9
|
+
const ADAPTER_VERSION = '1.19';
|
|
10
10
|
const ADAPTER_NAME = 'BFIO_PREBID';
|
|
11
11
|
const OUTSTREAM = 'outstream';
|
|
12
12
|
const CURRENCY = 'USD';
|
|
@@ -360,6 +360,7 @@ function createVideoRequestData(bid, bidderRequest) {
|
|
|
360
360
|
let tagid = getVideoBidParam(bid, 'tagid');
|
|
361
361
|
let topLocation = getTopWindowLocation(bidderRequest);
|
|
362
362
|
let eids = getEids(bid);
|
|
363
|
+
let ortb2 = deepClone(config.getConfig('ortb2'));
|
|
363
364
|
let payload = {
|
|
364
365
|
isPrebid: true,
|
|
365
366
|
appId: appId,
|
|
@@ -378,6 +379,7 @@ function createVideoRequestData(bid, bidderRequest) {
|
|
|
378
379
|
displaymanagerver: ADAPTER_VERSION
|
|
379
380
|
}],
|
|
380
381
|
site: {
|
|
382
|
+
...deepAccess(ortb2, 'site', {}),
|
|
381
383
|
page: topLocation.href,
|
|
382
384
|
domain: topLocation.hostname
|
|
383
385
|
},
|
|
@@ -389,39 +391,32 @@ function createVideoRequestData(bid, bidderRequest) {
|
|
|
389
391
|
js: 1,
|
|
390
392
|
geo: {}
|
|
391
393
|
},
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
},
|
|
395
|
-
source: {
|
|
396
|
-
ext: {}
|
|
397
|
-
},
|
|
398
|
-
user: {
|
|
399
|
-
ext: {}
|
|
400
|
-
},
|
|
394
|
+
app: deepAccess(ortb2, 'app'),
|
|
395
|
+
user: deepAccess(ortb2, 'user'),
|
|
401
396
|
cur: [CURRENCY]
|
|
402
397
|
};
|
|
403
398
|
|
|
404
399
|
if (bidderRequest && bidderRequest.uspConsent) {
|
|
405
|
-
payload
|
|
400
|
+
deepSetValue(payload, 'regs.ext.us_privacy', bidderRequest.uspConsent);
|
|
406
401
|
}
|
|
407
402
|
|
|
408
403
|
if (bidderRequest && bidderRequest.gdprConsent) {
|
|
409
404
|
let { gdprApplies, consentString } = bidderRequest.gdprConsent;
|
|
410
|
-
payload
|
|
411
|
-
payload
|
|
405
|
+
deepSetValue(payload, 'regs.ext.gdpr', gdprApplies ? 1 : 0);
|
|
406
|
+
deepSetValue(payload, 'user.ext.consent', consentString);
|
|
412
407
|
}
|
|
413
408
|
|
|
414
409
|
if (bid.schain) {
|
|
415
|
-
payload
|
|
410
|
+
deepSetValue(payload, 'source.ext.schain', bid.schain);
|
|
416
411
|
}
|
|
417
412
|
|
|
418
413
|
if (eids.length > 0) {
|
|
419
|
-
payload
|
|
414
|
+
deepSetValue(payload, 'user.ext.eids', eids);
|
|
420
415
|
}
|
|
421
416
|
|
|
422
417
|
let connection = navigator.connection || navigator.webkitConnection;
|
|
423
418
|
if (connection && connection.effectiveType) {
|
|
424
|
-
payload
|
|
419
|
+
deepSetValue(payload, 'device.connectiontype', connection.effectiveType);
|
|
425
420
|
}
|
|
426
421
|
|
|
427
422
|
return payload;
|
|
@@ -439,8 +434,10 @@ function createBannerRequestData(bids, bidderRequest) {
|
|
|
439
434
|
sizes: getBannerSizes(bid)
|
|
440
435
|
};
|
|
441
436
|
});
|
|
437
|
+
let ortb2 = deepClone(config.getConfig('ortb2'));
|
|
442
438
|
let payload = {
|
|
443
439
|
slots: slots,
|
|
440
|
+
ortb2: ortb2,
|
|
444
441
|
page: topLocation.href,
|
|
445
442
|
domain: topLocation.hostname,
|
|
446
443
|
search: topLocation.search,
|
|
@@ -99,16 +99,18 @@ export const spec = {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
function buildTrackingParams(data, info, value) {
|
|
102
|
+
const accountId = data.params.accountId;
|
|
102
103
|
return {
|
|
103
|
-
pid: data.
|
|
104
|
+
pid: accountId === undefined ? data.ad.match(/account: \“([a-f\d]{24})\“/)[1] : accountId,
|
|
104
105
|
nid: data.params.networkId,
|
|
105
106
|
nptnid: data.params.networkPartnerId,
|
|
106
|
-
bid: data.bidId,
|
|
107
|
+
bid: data.bidId || data.requestId,
|
|
107
108
|
sl_n: data.adUnitCode,
|
|
108
109
|
aid: data.auctionId,
|
|
109
110
|
se_ca: 'bid',
|
|
110
111
|
se_ac: info,
|
|
111
|
-
se_va: value
|
|
112
|
+
se_va: value,
|
|
113
|
+
url: window.location.href
|
|
112
114
|
};
|
|
113
115
|
}
|
|
114
116
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { deepAccess, isArray } from '../src/utils.js';
|
|
2
|
-
import { config } from '../src/config.js';
|
|
3
2
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
4
3
|
import { BANNER } from '../src/mediaTypes.js';
|
|
5
4
|
const BIDDER_CODE = 'codefuel';
|
|
@@ -34,8 +33,7 @@ export const spec = {
|
|
|
34
33
|
const devicetype = getDeviceType()
|
|
35
34
|
const publisher = setOnAny(validBidRequests, 'params.publisher');
|
|
36
35
|
const cur = CURRENCY;
|
|
37
|
-
|
|
38
|
-
const endpointUrl = config.getConfig('codefuel.bidderUrl');
|
|
36
|
+
const endpointUrl = 'https://ai-p-codefuel-ds-rtb-us-east-1-k8s.seccint.com/prebid'
|
|
39
37
|
const timeout = bidderRequest.timeout;
|
|
40
38
|
|
|
41
39
|
validBidRequests.forEach(bid => bid.netRevenue = 'net');
|
|
@@ -21,7 +21,7 @@ You will receive the URLs when contacting us.
|
|
|
21
21
|
```
|
|
22
22
|
pbjs.setConfig({
|
|
23
23
|
codefuel: {
|
|
24
|
-
bidderUrl: 'https://ai-
|
|
24
|
+
bidderUrl: 'https://ai-p-codefuel-ds-rtb-us-east-1-k8s.seccint.com/prebid',
|
|
25
25
|
usersyncUrl: 'https://usersync-url.com'
|
|
26
26
|
}
|
|
27
27
|
});
|
|
@@ -74,7 +74,7 @@ pbjs.setConfig({
|
|
|
74
74
|
|
|
75
75
|
pbjs.setConfig({
|
|
76
76
|
codefuel: {
|
|
77
|
-
bidderUrl: 'https://
|
|
77
|
+
bidderUrl: 'https://ai-p-codefuel-ds-rtb-us-east-1-k8s.seccint.com/prebid'
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
```
|
|
@@ -105,7 +105,7 @@ pbjs.setConfig({
|
|
|
105
105
|
|
|
106
106
|
pbjs.setConfig({
|
|
107
107
|
codefuel: {
|
|
108
|
-
bidderUrl: 'https://
|
|
108
|
+
bidderUrl: 'https://ai-p-codefuel-ds-rtb-us-east-1-k8s.seccint.com/prebid'
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
111
|
```
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getWindowTop, deepAccess, logMessage } from '../src/utils.js';
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
3
|
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
4
|
+
import { ajax } from '../src/ajax.js';
|
|
4
5
|
|
|
5
6
|
const BIDDER_CODE = 'colossusssp';
|
|
6
7
|
const G_URL = 'https://colossusssp.com/?c=o&m=multi';
|
|
@@ -175,6 +176,12 @@ export const spec = {
|
|
|
175
176
|
type: 'image',
|
|
176
177
|
url: G_URL_SYNC
|
|
177
178
|
}];
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
onBidWon: (bid) => {
|
|
182
|
+
if (bid.nurl) {
|
|
183
|
+
ajax(bid.nurl, null);
|
|
184
|
+
}
|
|
178
185
|
}
|
|
179
186
|
};
|
|
180
187
|
|
|
@@ -5,6 +5,7 @@ import { auctionManager } from '../src/auctionManager.js';
|
|
|
5
5
|
import find from 'core-js-pure/features/array/find.js';
|
|
6
6
|
import includes from 'core-js-pure/features/array/includes.js';
|
|
7
7
|
import { getStorageManager } from '../src/storageManager.js';
|
|
8
|
+
import {ajax} from '../src/ajax.js';
|
|
8
9
|
|
|
9
10
|
const BIDDER_CODE = 'craft';
|
|
10
11
|
const URL_BASE = 'https://gacraft.jp/prebid-v3';
|
|
@@ -110,9 +111,10 @@ export const spec = {
|
|
|
110
111
|
},
|
|
111
112
|
|
|
112
113
|
onBidWon: function(bid) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
ajax(bid._prebidWon, null, null, {
|
|
115
|
+
method: 'POST',
|
|
116
|
+
contentType: 'application/json'
|
|
117
|
+
});
|
|
116
118
|
}
|
|
117
119
|
};
|
|
118
120
|
|
|
@@ -24,7 +24,7 @@ const LOG_PREFIX = 'Criteo: ';
|
|
|
24
24
|
Unminified source code can be found in the privately shared repo: https://github.com/Prebid-org/prebid-js-external-js-criteo/blob/master/dist/prod.js
|
|
25
25
|
*/
|
|
26
26
|
const FAST_BID_VERSION_PLACEHOLDER = '%FAST_BID_VERSION%';
|
|
27
|
-
export const FAST_BID_VERSION_CURRENT =
|
|
27
|
+
export const FAST_BID_VERSION_CURRENT = 116;
|
|
28
28
|
const FAST_BID_VERSION_LATEST = 'latest';
|
|
29
29
|
const FAST_BID_VERSION_NONE = 'none';
|
|
30
30
|
const PUBLISHER_TAG_URL_TEMPLATE = 'https://static.criteo.net/js/ld/publishertag.prebid' + FAST_BID_VERSION_PLACEHOLDER + '.js';
|
|
@@ -26,6 +26,7 @@ export const RENDERER_URL = 'https://cdn.cwi.re/prebid/renderer/LATEST/renderer.
|
|
|
26
26
|
export const CW_PAGE_VIEW_ID = generateUUID();
|
|
27
27
|
const LS_CWID_KEY = 'cw_cwid';
|
|
28
28
|
const CW_GROUPS_QUERY = 'cwgroups';
|
|
29
|
+
const CW_CREATIVE_QUERY = 'cwcreative';
|
|
29
30
|
|
|
30
31
|
const storage = getStorageManager();
|
|
31
32
|
|
|
@@ -161,6 +162,7 @@ export const spec = {
|
|
|
161
162
|
|
|
162
163
|
let refgroups = [];
|
|
163
164
|
|
|
165
|
+
const cwCreativeId = getQueryVariable(CW_CREATIVE_QUERY);
|
|
164
166
|
const rgQuery = getQueryVariable(CW_GROUPS_QUERY);
|
|
165
167
|
if (rgQuery !== null) {
|
|
166
168
|
refgroups = rgQuery.split(',');
|
|
@@ -171,6 +173,7 @@ export const spec = {
|
|
|
171
173
|
const payload = {
|
|
172
174
|
cwid: localStorageCWID,
|
|
173
175
|
refgroups,
|
|
176
|
+
cwcreative: cwCreativeId,
|
|
174
177
|
slots: slots,
|
|
175
178
|
httpRef: referer || '',
|
|
176
179
|
pageViewId: CW_PAGE_VIEW_ID,
|
|
@@ -94,7 +94,7 @@ export const spec = {
|
|
|
94
94
|
code: 'datablocks',
|
|
95
95
|
|
|
96
96
|
// DATABLOCKS SCOPED OBJECT
|
|
97
|
-
db_obj: {metrics_host: 'prebid.
|
|
97
|
+
db_obj: {metrics_host: 'prebid.dblks.net', metrics: [], metrics_timer: null, metrics_queue_time: 1000, vis_optout: false, source_id: 0},
|
|
98
98
|
|
|
99
99
|
// STORE THE DATABLOCKS BUYERID IN STORAGE
|
|
100
100
|
store_dbid: function(dbid) {
|
|
@@ -388,12 +388,12 @@ export const spec = {
|
|
|
388
388
|
};
|
|
389
389
|
|
|
390
390
|
let sourceId = validRequests[0].params.source_id || 0;
|
|
391
|
-
let host = validRequests[0].params.host || 'prebid.
|
|
391
|
+
let host = validRequests[0].params.host || 'prebid.dblks.net';
|
|
392
392
|
|
|
393
393
|
// RETURN WITH THE REQUEST AND PAYLOAD
|
|
394
394
|
return {
|
|
395
395
|
method: 'POST',
|
|
396
|
-
url: `https://${
|
|
396
|
+
url: `https://${host}/openrtb/?sid=${sourceId}`,
|
|
397
397
|
data: {
|
|
398
398
|
id: bidderRequest.auctionId,
|
|
399
399
|
imp: imps,
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import includes from 'core-js-pure/features/array/includes.js';
|
|
2
|
+
import { config } from '../src/config.js';
|
|
3
|
+
import { getHook } from '../src/hook.js';
|
|
4
|
+
import { _each, isStr, isArray, isPlainObject, hasOwn, deepClone, deepAccess, logWarn, logError } from '../src/utils.js';
|
|
5
|
+
|
|
6
|
+
const shouldBeAString = ' should be a string';
|
|
7
|
+
const shouldBeAnObject = ' should be an object';
|
|
8
|
+
const shouldBeAnArray = ' should be an Array';
|
|
9
|
+
const shouldBeValid = ' is not a valid dchain property';
|
|
10
|
+
const MODE = {
|
|
11
|
+
STRICT: 'strict',
|
|
12
|
+
RELAXED: 'relaxed',
|
|
13
|
+
OFF: 'off'
|
|
14
|
+
};
|
|
15
|
+
const MODES = []; // an array of modes
|
|
16
|
+
_each(MODE, mode => MODES.push(mode));
|
|
17
|
+
|
|
18
|
+
export function checkDchainSyntax(bid, mode) {
|
|
19
|
+
let dchainObj = deepClone(bid.meta.dchain);
|
|
20
|
+
let failPrefix = 'Detected something wrong in bid.meta.dchain object for bid:';
|
|
21
|
+
let failMsg = '';
|
|
22
|
+
const dchainPropList = ['ver', 'complete', 'nodes', 'ext'];
|
|
23
|
+
|
|
24
|
+
function appendFailMsg(msg) {
|
|
25
|
+
failMsg += '\n' + msg;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function printFailMsg() {
|
|
29
|
+
if (mode === MODE.STRICT) {
|
|
30
|
+
logError(failPrefix, bid, '\n', dchainObj, failMsg);
|
|
31
|
+
} else {
|
|
32
|
+
logWarn(failPrefix, bid, `\n`, dchainObj, failMsg);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let dchainProps = Object.keys(dchainObj);
|
|
37
|
+
dchainProps.forEach(prop => {
|
|
38
|
+
if (!includes(dchainPropList, prop)) {
|
|
39
|
+
appendFailMsg(`dchain.${prop}` + shouldBeValid);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
if (dchainObj.complete !== 0 && dchainObj.complete !== 1) {
|
|
44
|
+
appendFailMsg(`dchain.complete should be 0 or 1`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (!isStr(dchainObj.ver)) {
|
|
48
|
+
appendFailMsg(`dchain.ver` + shouldBeAString);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (hasOwn(dchainObj, 'ext')) {
|
|
52
|
+
if (!isPlainObject(dchainObj.ext)) {
|
|
53
|
+
appendFailMsg(`dchain.ext` + shouldBeAnObject);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (!isArray(dchainObj.nodes)) {
|
|
58
|
+
appendFailMsg(`dchain.nodes` + shouldBeAnArray);
|
|
59
|
+
printFailMsg();
|
|
60
|
+
if (mode === MODE.STRICT) return false;
|
|
61
|
+
} else {
|
|
62
|
+
const nodesPropList = ['asi', 'bsid', 'rid', 'name', 'domain', 'ext'];
|
|
63
|
+
dchainObj.nodes.forEach((node, index) => {
|
|
64
|
+
if (!isPlainObject(node)) {
|
|
65
|
+
appendFailMsg(`dchain.nodes[${index}]` + shouldBeAnObject);
|
|
66
|
+
} else {
|
|
67
|
+
let nodeProps = Object.keys(node);
|
|
68
|
+
nodeProps.forEach(prop => {
|
|
69
|
+
if (!includes(nodesPropList, prop)) {
|
|
70
|
+
appendFailMsg(`dchain.nodes[${index}].${prop}` + shouldBeValid);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (prop === 'ext') {
|
|
74
|
+
if (!isPlainObject(node.ext)) {
|
|
75
|
+
appendFailMsg(`dchain.nodes[${index}].ext` + shouldBeAnObject);
|
|
76
|
+
}
|
|
77
|
+
} else {
|
|
78
|
+
if (!isStr(node[prop])) {
|
|
79
|
+
appendFailMsg(`dchain.nodes[${index}].${prop}` + shouldBeAString);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (failMsg.length > 0) {
|
|
88
|
+
printFailMsg();
|
|
89
|
+
if (mode === MODE.STRICT) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function isValidDchain(bid) {
|
|
97
|
+
let mode = MODE.STRICT;
|
|
98
|
+
const dchainConfig = config.getConfig('dchain');
|
|
99
|
+
|
|
100
|
+
if (dchainConfig && isStr(dchainConfig.validation) && MODES.indexOf(dchainConfig.validation) != -1) {
|
|
101
|
+
mode = dchainConfig.validation;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (mode === MODE.OFF) {
|
|
105
|
+
return true;
|
|
106
|
+
} else {
|
|
107
|
+
return checkDchainSyntax(bid, mode);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function addBidResponseHook(fn, adUnitCode, bid) {
|
|
112
|
+
const basicDchain = {
|
|
113
|
+
ver: '1.0',
|
|
114
|
+
complete: 0,
|
|
115
|
+
nodes: []
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
if (deepAccess(bid, 'meta.networkId') && deepAccess(bid, 'meta.networkName')) {
|
|
119
|
+
basicDchain.nodes.push({ name: bid.meta.networkName, bsid: bid.meta.networkId.toString() });
|
|
120
|
+
}
|
|
121
|
+
basicDchain.nodes.push({ name: bid.bidderCode });
|
|
122
|
+
|
|
123
|
+
let bidDchain = deepAccess(bid, 'meta.dchain');
|
|
124
|
+
if (bidDchain && isPlainObject(bidDchain)) {
|
|
125
|
+
let result = isValidDchain(bid);
|
|
126
|
+
|
|
127
|
+
if (result) {
|
|
128
|
+
// extra check in-case mode is OFF and there is a setup issue
|
|
129
|
+
if (isArray(bidDchain.nodes)) {
|
|
130
|
+
bid.meta.dchain.nodes.push({ asi: bid.bidderCode });
|
|
131
|
+
} else {
|
|
132
|
+
logWarn('bid.meta.dchain.nodes did not exist or was not an array; did not append prebid dchain.', bid);
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
// remove invalid dchain
|
|
136
|
+
delete bid.meta.dchain;
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
bid.meta.dchain = basicDchain;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
fn(adUnitCode, bid);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function init() {
|
|
146
|
+
getHook('addBidResponse').before(addBidResponseHook, 35);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
init();
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# dchain module
|
|
2
|
+
|
|
3
|
+
Refer:
|
|
4
|
+
- https://iabtechlab.com/buyers-json-demand-chain/
|
|
5
|
+
|
|
6
|
+
## Sample code for dchain setConfig and dchain object
|
|
7
|
+
```
|
|
8
|
+
pbjs.setConfig({
|
|
9
|
+
"dchain": {
|
|
10
|
+
"validation": "strict"
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
bid.meta.dchain: {
|
|
17
|
+
"complete": 0,
|
|
18
|
+
"ver": "1.0",
|
|
19
|
+
"ext": {...},
|
|
20
|
+
"nodes": [{
|
|
21
|
+
"asi": "abc",
|
|
22
|
+
"bsid": "123",
|
|
23
|
+
"rid": "d4e5f6",
|
|
24
|
+
"name": "xyz",
|
|
25
|
+
"domain": "mno",
|
|
26
|
+
"ext": {...}
|
|
27
|
+
}, ...]
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Workflow
|
|
32
|
+
The dchain module is not enabled by default as it may not be necessary for all publishers.
|
|
33
|
+
If required, dchain module can be included as following
|
|
34
|
+
```
|
|
35
|
+
$ gulp build --modules=dchain,pubmaticBidAdapter,openxBidAdapter,rubiconBidAdapter,sovrnBidAdapter
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The dchain module will validate a bidder's dchain object (if it was defined). Bidders should assign their dchain object into `bid.meta` field. If the dchain object is valid, it will remain in the bid object for later use.
|
|
39
|
+
|
|
40
|
+
If it was not defined, the dchain will create a default dchain object for prebid.
|
|
41
|
+
|
|
42
|
+
## Validation modes
|
|
43
|
+
- ```strict```: It is the default validation mode. In this mode, dchain object will not be accpeted from adapters if it is invalid. Errors are thrown for invalid dchain object.
|
|
44
|
+
- ```relaxed```: In this mode, errors are thrown for an invalid dchain object but the invalid dchain object is still accepted from adapters.
|
|
45
|
+
- ```off```: In this mode, no validations are performed and dchain object is accepted as is from adapters.
|
|
@@ -162,7 +162,7 @@ function buildImpression(bid) {
|
|
|
162
162
|
impression = {
|
|
163
163
|
id: bid.bidId,
|
|
164
164
|
tagid: bid.params.tagId || '',
|
|
165
|
-
secure: window.location.protocol === 'https' ? 1 : 0,
|
|
165
|
+
secure: window.location.protocol === 'https:' ? 1 : 0,
|
|
166
166
|
displaymanager: 'di_prebid',
|
|
167
167
|
displaymanagerver: DI_M_V,
|
|
168
168
|
ext: buildCustomParams(bid)
|
|
@@ -257,10 +257,18 @@ export const spec = {
|
|
|
257
257
|
tagid,
|
|
258
258
|
secure
|
|
259
259
|
};
|
|
260
|
+
|
|
261
|
+
// adding gpid support
|
|
262
|
+
let gpid = deepAccess(bid, 'ortb2Imp.ext.data.adserver.adslot');
|
|
263
|
+
if (!gpid) {
|
|
264
|
+
gpid = deepAccess(bid, 'ortb2Imp.ext.data.pbadslot');
|
|
265
|
+
}
|
|
266
|
+
if (gpid) {
|
|
267
|
+
data.ext = {gpid: gpid.toString()};
|
|
268
|
+
}
|
|
260
269
|
let typeSpecifics = isVideo ? { video: emxAdapter.buildVideo(bid) } : { banner: emxAdapter.buildBanner(bid) };
|
|
261
270
|
let bidfloorObj = bidfloor > 0 ? { bidfloor, bidfloorcur: DEFAULT_CUR } : {};
|
|
262
271
|
let emxBid = Object.assign(data, typeSpecifics, bidfloorObj);
|
|
263
|
-
|
|
264
272
|
emxImps.push(emxBid);
|
|
265
273
|
});
|
|
266
274
|
|