prebid.js 6.2.0 → 6.6.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/.circleci/config.yml +1 -1
- package/gulpfile.js +87 -82
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +23 -14
- package/karma.conf.maker.js +1 -1
- package/modules/.submodules.json +2 -1
- package/modules/33acrossBidAdapter.js +189 -102
- package/modules/adagioBidAdapter.js +1 -1
- package/modules/addefendBidAdapter.js +1 -0
- package/modules/adkernelBidAdapter.js +148 -62
- package/modules/adlooxAdServerVideo.js +2 -2
- package/modules/adlooxAnalyticsAdapter.js +4 -4
- package/modules/admanBidAdapter.js +11 -4
- package/modules/admixerBidAdapter.js +1 -1
- package/modules/adnuntiusBidAdapter.js +3 -1
- package/modules/adomikAnalyticsAdapter.js +27 -9
- package/modules/adqueryIdSystem.js +103 -0
- package/modules/adqueryIdSystem.md +35 -0
- package/modules/adxcgBidAdapter.js +311 -359
- package/modules/adxcgBidAdapter.md +22 -21
- package/modules/adyoulikeBidAdapter.js +13 -9
- package/modules/aniviewBidAdapter.js +1 -1
- package/modules/appnexusBidAdapter.js +0 -1
- package/modules/beopBidAdapter.js +6 -4
- package/modules/bidViewability.js +3 -3
- package/modules/bidViewabilityIO.js +3 -3
- package/modules/bliinkBidAdapter.js +3 -2
- package/modules/colossussspBidAdapter.js +7 -0
- package/modules/compassBidAdapter.js +208 -0
- package/modules/compassBidAdapter.md +79 -0
- package/modules/consentManagement.js +7 -1
- package/modules/criteoBidAdapter.js +1 -1
- package/modules/criteoIdSystem.js +29 -7
- package/modules/currency.js +2 -2
- package/modules/cwireBidAdapter.js +3 -0
- package/modules/dailyhuntBidAdapter.js +435 -0
- package/modules/dailyhuntBidAdapter.md +4 -0
- package/modules/docereeBidAdapter.js +10 -1
- package/modules/docereeBidAdapter.md +2 -0
- package/modules/dspxBidAdapter.js +1 -1
- package/modules/engageyaBidAdapter.js +1 -1
- package/modules/feedadBidAdapter.js +2 -2
- package/modules/feedadBidAdapter.md +4 -2
- package/modules/futureads.md +48 -0
- package/modules/glimpseBidAdapter.js +82 -47
- package/modules/gptPreAuction.js +55 -7
- package/modules/gridBidAdapter.js +4 -3
- package/modules/gumgumBidAdapter.js +2 -2
- package/modules/idImportLibrary.js +45 -8
- package/modules/idImportLibrary.md +4 -0
- package/modules/improvedigitalBidAdapter.js +42 -4
- package/modules/instreamTracking.js +4 -4
- package/modules/invibesBidAdapter.js +49 -5
- package/modules/invibesBidAdapter.md +2 -1
- package/modules/ixBidAdapter.js +53 -18
- package/modules/kinessoIdSystem.js +1 -1
- package/modules/limelightDigitalBidAdapter.js +2 -1
- package/modules/livewrappedAnalyticsAdapter.js +3 -1
- package/modules/livewrappedBidAdapter.js +8 -2
- package/modules/loglyliftBidAdapter.js +79 -0
- package/modules/loglyliftBidAdapter.md +55 -0
- package/modules/lotamePanoramaIdSystem.js +80 -8
- package/modules/mediasquareBidAdapter.js +1 -9
- package/modules/nextMillenniumBidAdapter.js +39 -7
- package/modules/oguryBidAdapter.js +9 -2
- package/modules/onetagBidAdapter.js +4 -2
- package/modules/optimeraRtdProvider.js +8 -1
- package/modules/ozoneBidAdapter.js +21 -64
- package/modules/prebidServerBidAdapter/index.js +16 -12
- package/modules/proxistoreBidAdapter.js +0 -2
- package/modules/pubgeniusBidAdapter.js +1 -1
- package/modules/pubmaticAnalyticsAdapter.js +16 -0
- package/modules/pubxaiAnalyticsAdapter.js +17 -0
- package/modules/richaudienceBidAdapter.js +4 -4
- package/modules/riseBidAdapter.js +1 -1
- package/modules/rtbhouseBidAdapter.js +14 -4
- package/modules/rtdModule/index.js +49 -18
- package/modules/rubiconBidAdapter.js +31 -19
- package/modules/sharedIdSystem.js +27 -1
- package/modules/showheroes-bsBidAdapter.js +13 -2
- package/modules/tappxBidAdapter.js +8 -5
- package/modules/targetVideoBidAdapter.js +187 -0
- package/modules/targetVideoBidAdapter.md +34 -0
- package/modules/teadsBidAdapter.js +1 -2
- package/modules/telariaBidAdapter.js +2 -2
- package/modules/trustxBidAdapter.js +8 -16
- package/modules/userId/eids.js +7 -1
- package/modules/userId/userId.md +8 -0
- package/modules/vidoomyBidAdapter.js +16 -10
- package/modules/weboramaRtdProvider.js +288 -73
- package/modules/weboramaRtdProvider.md +27 -10
- package/modules/welectBidAdapter.js +106 -0
- package/modules/yahoosspBidAdapter.js +5 -1
- package/modules/yieldmoBidAdapter.js +23 -5
- package/modules/zetaSspBidAdapter.md +33 -1
- package/modules/zeta_global_sspAnalyticsAdapter.js +97 -0
- package/modules/zeta_global_sspAnalyticsAdapter.md +24 -0
- package/modules/zeta_global_sspBidAdapter.js +22 -1
- package/package.json +1 -1
- package/plugins/pbjsGlobals.js +28 -1
- package/src/auction.js +2 -2
- package/src/config.js +27 -3
- package/src/hook.js +5 -1
- package/src/prebid.js +21 -6
- package/src/targeting.js +22 -1
- package/src/utils.js +46 -8
- package/test/helpers/prebidGlobal.js +1 -0
- package/test/spec/config_spec.js +279 -0
- package/test/spec/modules/33acrossBidAdapter_spec.js +300 -78
- package/test/spec/modules/adlooxAnalyticsAdapter_spec.js +6 -6
- package/test/spec/modules/admanBidAdapter_spec.js +2 -2
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +17 -0
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +9 -1
- package/test/spec/modules/adqueryIdSystem_spec.js +74 -0
- package/test/spec/modules/adxcgBidAdapter_spec.js +820 -571
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +49 -0
- package/test/spec/modules/beopBidAdapter_spec.js +1 -1
- package/test/spec/modules/bidViewabilityIO_spec.js +2 -2
- package/test/spec/modules/bidViewability_spec.js +4 -4
- package/test/spec/modules/bliinkBidAdapter_spec.js +2 -0
- package/test/spec/modules/colossussspBidAdapter_spec.js +9 -0
- package/test/spec/modules/compassBidAdapter_spec.js +398 -0
- package/test/spec/modules/consentManagement_spec.js +20 -0
- package/test/spec/modules/criteoIdSystem_spec.js +6 -3
- package/test/spec/modules/cwireBidAdapter_spec.js +10 -8
- package/test/spec/modules/dailyhuntBidAdapter_spec.js +404 -0
- package/test/spec/modules/docereeBidAdapter_spec.js +9 -1
- package/test/spec/modules/eids_spec.js +15 -0
- package/test/spec/modules/feedadBidAdapter_spec.js +15 -0
- package/test/spec/modules/glimpseBidAdapter_spec.js +0 -18
- package/test/spec/modules/gptPreAuction_spec.js +177 -2
- package/test/spec/modules/idImportLibrary_spec.js +197 -10
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +45 -1
- package/test/spec/modules/invibesBidAdapter_spec.js +119 -0
- package/test/spec/modules/ixBidAdapter_spec.js +112 -62
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +75 -17
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +22 -0
- package/test/spec/modules/livewrappedBidAdapter_spec.js +31 -0
- package/test/spec/modules/loglyliftBidAdapter_spec.js +172 -0
- package/test/spec/modules/lotamePanoramaIdSystem_spec.js +227 -0
- package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -4
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +26 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +10 -2
- package/test/spec/modules/optimeraRtdProvider_spec.js +14 -1
- package/test/spec/modules/ozoneBidAdapter_spec.js +43 -31
- package/test/spec/modules/prebidServerBidAdapter_spec.js +43 -0
- package/test/spec/modules/pubgeniusBidAdapter_spec.js +3 -3
- package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +13 -1
- package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +11 -0
- package/test/spec/modules/realTimeDataModule_spec.js +147 -48
- package/test/spec/modules/richaudienceBidAdapter_spec.js +42 -2
- package/test/spec/modules/riseBidAdapter_spec.js +1 -1
- package/test/spec/modules/rtbhouseBidAdapter_spec.js +20 -0
- package/test/spec/modules/rubiconBidAdapter_spec.js +65 -9
- package/test/spec/modules/sharedIdSystem_spec.js +52 -6
- package/test/spec/modules/showheroes-bsBidAdapter_spec.js +2 -0
- package/test/spec/modules/tappxBidAdapter_spec.js +0 -19
- package/test/spec/modules/targetVideoBidAdapter_spec.js +96 -0
- package/test/spec/modules/teadsBidAdapter_spec.js +14 -59
- package/test/spec/modules/userId_spec.js +68 -19
- package/test/spec/modules/weboramaRtdProvider_spec.js +408 -214
- package/test/spec/modules/welectBidAdapter_spec.js +211 -0
- package/test/spec/modules/yahoosspBidAdapter_spec.js +28 -1
- package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +427 -0
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +33 -1
- package/test/spec/unit/core/targeting_spec.js +72 -0
- package/test/spec/unit/pbjs_api_spec.js +3 -1
- package/test/spec/utils_spec.js +38 -0
- package/test/test_deps.js +3 -0
- package/test/test_index.js +1 -3
|
@@ -165,16 +165,26 @@ function mapBanner(slot) {
|
|
|
165
165
|
* @returns {object} Site by OpenRTB 2.5 §3.2.13
|
|
166
166
|
*/
|
|
167
167
|
function mapSite(slot, bidderRequest) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
let pubId = 'unknown';
|
|
169
|
+
let channel = null;
|
|
170
|
+
if (slot && slot.length > 0) {
|
|
171
|
+
pubId = slot[0].params.publisherId;
|
|
172
|
+
channel = slot[0].params.channel &&
|
|
173
|
+
slot[0].params.channel
|
|
174
|
+
.toString()
|
|
175
|
+
.slice(0, 50);
|
|
176
|
+
}
|
|
177
|
+
let siteData = {
|
|
172
178
|
publisher: {
|
|
173
179
|
id: pubId.toString(),
|
|
174
180
|
},
|
|
175
181
|
page: bidderRequest.refererInfo.referer,
|
|
176
182
|
name: getOrigin()
|
|
183
|
+
};
|
|
184
|
+
if (channel) {
|
|
185
|
+
siteData.channel = channel;
|
|
177
186
|
}
|
|
187
|
+
return siteData;
|
|
178
188
|
}
|
|
179
189
|
|
|
180
190
|
/**
|
|
@@ -98,6 +98,15 @@
|
|
|
98
98
|
* @param {UserConsentData} userConsent
|
|
99
99
|
*/
|
|
100
100
|
|
|
101
|
+
/**
|
|
102
|
+
* @function?
|
|
103
|
+
* @summary on bid requested event
|
|
104
|
+
* @name RtdSubmodule#onBidRequestEvent
|
|
105
|
+
* @param {Object} data
|
|
106
|
+
* @param {SubmoduleConfig} config
|
|
107
|
+
* @param {UserConsentData} userConsent
|
|
108
|
+
*/
|
|
109
|
+
|
|
101
110
|
/**
|
|
102
111
|
* @interface ModuleConfig
|
|
103
112
|
*/
|
|
@@ -143,7 +152,7 @@
|
|
|
143
152
|
|
|
144
153
|
import {config} from '../../src/config.js';
|
|
145
154
|
import {module} from '../../src/hook.js';
|
|
146
|
-
import {
|
|
155
|
+
import {logError, logWarn} from '../../src/utils.js';
|
|
147
156
|
import events from '../../src/events.js';
|
|
148
157
|
import CONSTANTS from '../../src/constants.json';
|
|
149
158
|
import {gdprDataHandler, uspDataHandler} from '../../src/adapterManager.js';
|
|
@@ -164,13 +173,51 @@ let _dataProviders = [];
|
|
|
164
173
|
let _userConsent;
|
|
165
174
|
|
|
166
175
|
/**
|
|
167
|
-
*
|
|
176
|
+
* Register a RTD submodule.
|
|
177
|
+
*
|
|
168
178
|
* @param {RtdSubmodule} submodule
|
|
179
|
+
* @returns {function()} a de-registration function that will unregister the module when called.
|
|
169
180
|
*/
|
|
170
181
|
export function attachRealTimeDataProvider(submodule) {
|
|
171
182
|
registeredSubModules.push(submodule);
|
|
183
|
+
return function detach() {
|
|
184
|
+
const idx = registeredSubModules.indexOf(submodule)
|
|
185
|
+
if (idx >= 0) {
|
|
186
|
+
registeredSubModules.splice(idx, 1);
|
|
187
|
+
initSubModules();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
172
190
|
}
|
|
173
191
|
|
|
192
|
+
/**
|
|
193
|
+
* call each sub module event function by config order
|
|
194
|
+
*/
|
|
195
|
+
const setEventsListeners = (function () {
|
|
196
|
+
let registered = false;
|
|
197
|
+
return function setEventsListeners() {
|
|
198
|
+
if (!registered) {
|
|
199
|
+
Object.entries({
|
|
200
|
+
[CONSTANTS.EVENTS.AUCTION_INIT]: ['onAuctionInitEvent'],
|
|
201
|
+
[CONSTANTS.EVENTS.AUCTION_END]: ['onAuctionEndEvent', getAdUnitTargeting],
|
|
202
|
+
[CONSTANTS.EVENTS.BID_RESPONSE]: ['onBidResponseEvent'],
|
|
203
|
+
[CONSTANTS.EVENTS.BID_REQUESTED]: ['onBidRequestEvent']
|
|
204
|
+
}).forEach(([ev, [handler, preprocess]]) => {
|
|
205
|
+
events.on(ev, (args) => {
|
|
206
|
+
preprocess && preprocess(args);
|
|
207
|
+
subModules.forEach(sm => {
|
|
208
|
+
try {
|
|
209
|
+
sm[handler] && sm[handler](args, sm.config, _userConsent)
|
|
210
|
+
} catch (e) {
|
|
211
|
+
logError(`RTD provider '${sm.name}': error in '${handler}':`, e);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
})
|
|
215
|
+
});
|
|
216
|
+
registered = true;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
})();
|
|
220
|
+
|
|
174
221
|
export function init(config) {
|
|
175
222
|
const confListener = config.getConfig(MODULE_NAME, ({realTimeData}) => {
|
|
176
223
|
if (!realTimeData.dataProviders) {
|
|
@@ -211,22 +258,6 @@ function initSubModules() {
|
|
|
211
258
|
subModules = subModulesByOrder;
|
|
212
259
|
}
|
|
213
260
|
|
|
214
|
-
/**
|
|
215
|
-
* call each sub module event function by config order
|
|
216
|
-
*/
|
|
217
|
-
function setEventsListeners() {
|
|
218
|
-
events.on(CONSTANTS.EVENTS.AUCTION_INIT, (args) => {
|
|
219
|
-
subModules.forEach(sm => { sm.onAuctionInitEvent && sm.onAuctionInitEvent(args, sm.config, _userConsent) })
|
|
220
|
-
});
|
|
221
|
-
events.on(CONSTANTS.EVENTS.AUCTION_END, (args) => {
|
|
222
|
-
getAdUnitTargeting(args);
|
|
223
|
-
subModules.forEach(sm => { sm.onAuctionEndEvent && sm.onAuctionEndEvent(args, sm.config, _userConsent) })
|
|
224
|
-
});
|
|
225
|
-
events.on(CONSTANTS.EVENTS.BID_RESPONSE, (args) => {
|
|
226
|
-
subModules.forEach(sm => { sm.onBidResponseEvent && sm.onBidResponseEvent(args, sm.config, _userConsent) })
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
|
|
230
261
|
/**
|
|
231
262
|
* loop through configured data providers If the data provider has registered getBidRequestData,
|
|
232
263
|
* call it, providing reqBidsConfigObj, consent data and module params
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mergeDeep, _each, logError, deepAccess, deepSetValue, isStr, isNumber, logWarn, convertTypes, isArray, parseSizesInput, logMessage } from '../src/utils.js';
|
|
1
|
+
import { mergeDeep, _each, logError, deepAccess, deepSetValue, isStr, isNumber, logWarn, convertTypes, isArray, parseSizesInput, logMessage, formatQS } from '../src/utils.js';
|
|
2
2
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
3
3
|
import {config} from '../src/config.js';
|
|
4
4
|
import {BANNER, VIDEO} from '../src/mediaTypes.js';
|
|
@@ -765,21 +765,23 @@ export const spec = {
|
|
|
765
765
|
getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent) {
|
|
766
766
|
if (!hasSynced && syncOptions.iframeEnabled) {
|
|
767
767
|
// data is only assigned if params are available to pass to syncEndpoint
|
|
768
|
-
let params =
|
|
768
|
+
let params = {};
|
|
769
769
|
|
|
770
|
-
if (gdprConsent
|
|
771
|
-
// add 'gdpr' only if 'gdprApplies' is defined
|
|
770
|
+
if (gdprConsent) {
|
|
772
771
|
if (typeof gdprConsent.gdprApplies === 'boolean') {
|
|
773
|
-
params
|
|
774
|
-
}
|
|
775
|
-
|
|
772
|
+
params['gdpr'] = Number(gdprConsent.gdprApplies);
|
|
773
|
+
}
|
|
774
|
+
if (typeof gdprConsent.consentString === 'string') {
|
|
775
|
+
params['gdpr_consent'] = gdprConsent.consentString;
|
|
776
776
|
}
|
|
777
777
|
}
|
|
778
778
|
|
|
779
779
|
if (uspConsent) {
|
|
780
|
-
params
|
|
780
|
+
params['us_privacy'] = encodeURIComponent(uspConsent);
|
|
781
781
|
}
|
|
782
782
|
|
|
783
|
+
params = Object.keys(params).length ? `?${formatQS(params)}` : '';
|
|
784
|
+
|
|
783
785
|
hasSynced = true;
|
|
784
786
|
return {
|
|
785
787
|
type: 'iframe',
|
|
@@ -992,6 +994,8 @@ function applyFPD(bidRequest, mediaType, data) {
|
|
|
992
994
|
|
|
993
995
|
let fpd = mergeDeep({}, config.getConfig('ortb2') || {}, BID_FPD);
|
|
994
996
|
let impData = deepAccess(bidRequest.ortb2Imp, 'ext.data') || {};
|
|
997
|
+
|
|
998
|
+
const gpid = deepAccess(bidRequest, 'ortb2Imp.ext.gpid');
|
|
995
999
|
const SEGTAX = {user: [4], site: [1, 2, 5, 6]};
|
|
996
1000
|
const MAP = {user: 'tg_v.', site: 'tg_i.', adserver: 'tg_i.dfp_ad_unit_code', pbadslot: 'tg_i.pbadslot', keywords: 'kw'};
|
|
997
1001
|
const validate = function(prop, key, parentName) {
|
|
@@ -1020,16 +1024,6 @@ function applyFPD(bidRequest, mediaType, data) {
|
|
|
1020
1024
|
data[loc] = (data[loc]) ? data[loc].concat(',', val) : val;
|
|
1021
1025
|
}
|
|
1022
1026
|
|
|
1023
|
-
Object.keys(impData).forEach((key) => {
|
|
1024
|
-
if (key === 'adserver') {
|
|
1025
|
-
['name', 'adslot'].forEach(prop => {
|
|
1026
|
-
if (impData[key][prop]) impData[key][prop] = impData[key][prop].toString().replace(/^\/+/, '');
|
|
1027
|
-
});
|
|
1028
|
-
} else if (key === 'pbadslot') {
|
|
1029
|
-
impData[key] = impData[key].toString().replace(/^\/+/, '');
|
|
1030
|
-
}
|
|
1031
|
-
});
|
|
1032
|
-
|
|
1033
1027
|
if (mediaType === BANNER) {
|
|
1034
1028
|
['site', 'user'].forEach(name => {
|
|
1035
1029
|
Object.keys(fpd[name]).forEach((key) => {
|
|
@@ -1045,12 +1039,30 @@ function applyFPD(bidRequest, mediaType, data) {
|
|
|
1045
1039
|
});
|
|
1046
1040
|
});
|
|
1047
1041
|
Object.keys(impData).forEach((key) => {
|
|
1048
|
-
(key
|
|
1042
|
+
if (key !== 'adserver') {
|
|
1043
|
+
addBannerData(impData[key], 'site', key);
|
|
1044
|
+
} else if (impData[key].name === 'gam') {
|
|
1045
|
+
addBannerData(impData[key].adslot, name, key)
|
|
1046
|
+
}
|
|
1049
1047
|
});
|
|
1048
|
+
|
|
1049
|
+
// add in gpid
|
|
1050
|
+
if (gpid) {
|
|
1051
|
+
data['p_gpid'] = gpid;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
// only send one of pbadslot or dfp adunit code (prefer pbadslot)
|
|
1055
|
+
if (data['tg_i.pbadslot']) {
|
|
1056
|
+
delete data['tg_i.dfp_ad_unit_code'];
|
|
1057
|
+
}
|
|
1050
1058
|
} else {
|
|
1051
1059
|
if (Object.keys(impData).length) {
|
|
1052
1060
|
mergeDeep(data.imp[0].ext, {data: impData});
|
|
1053
1061
|
}
|
|
1062
|
+
// add in gpid
|
|
1063
|
+
if (gpid) {
|
|
1064
|
+
data.imp[0].ext.gpid = gpid;
|
|
1065
|
+
}
|
|
1054
1066
|
|
|
1055
1067
|
mergeDeep(data, fpd);
|
|
1056
1068
|
}
|
|
@@ -11,7 +11,7 @@ import { coppaDataHandler } from '../src/adapterManager.js';
|
|
|
11
11
|
import {getStorageManager} from '../src/storageManager.js';
|
|
12
12
|
|
|
13
13
|
const GVLID = 887;
|
|
14
|
-
const storage = getStorageManager(GVLID, 'pubCommonId');
|
|
14
|
+
export const storage = getStorageManager(GVLID, 'pubCommonId');
|
|
15
15
|
const COOKIE = 'cookie';
|
|
16
16
|
const LOCAL_STORAGE = 'html5';
|
|
17
17
|
const OPTOUT_NAME = '_pubcid_optout';
|
|
@@ -171,7 +171,33 @@ export const sharedIdSystemSubmodule = {
|
|
|
171
171
|
return {id: storedId};
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
domainOverride: function () {
|
|
177
|
+
const domainElements = document.domain.split('.');
|
|
178
|
+
const cookieName = `_gd${Date.now()}`;
|
|
179
|
+
for (let i = 0, topDomain, testCookie; i < domainElements.length; i++) {
|
|
180
|
+
const nextDomain = domainElements.slice(i).join('.');
|
|
181
|
+
|
|
182
|
+
// write test cookie
|
|
183
|
+
storage.setCookie(cookieName, '1', undefined, undefined, nextDomain);
|
|
184
|
+
|
|
185
|
+
// read test cookie to verify domain was valid
|
|
186
|
+
testCookie = storage.getCookie(cookieName);
|
|
187
|
+
|
|
188
|
+
// delete test cookie
|
|
189
|
+
storage.setCookie(cookieName, '', 'Thu, 01 Jan 1970 00:00:01 GMT', undefined, nextDomain);
|
|
190
|
+
|
|
191
|
+
if (testCookie === '1') {
|
|
192
|
+
// cookie was written successfully using test domain so the topDomain is updated
|
|
193
|
+
topDomain = nextDomain;
|
|
194
|
+
} else {
|
|
195
|
+
// cookie failed to write using test domain so exit by returning the topDomain
|
|
196
|
+
return topDomain;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
174
199
|
}
|
|
200
|
+
|
|
175
201
|
};
|
|
176
202
|
|
|
177
203
|
submodule('userId', sharedIdSystemSubmodule);
|
|
@@ -61,15 +61,24 @@ export const spec = {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
const consentData = bidderRequest.gdprConsent || {};
|
|
65
|
+
|
|
66
|
+
const gdprConsent = {
|
|
67
|
+
apiVersion: consentData.apiVersion || 2,
|
|
68
|
+
gdprApplies: consentData.gdprApplies || 0,
|
|
69
|
+
consentString: consentData.consentString || '',
|
|
70
|
+
}
|
|
71
|
+
|
|
64
72
|
return {
|
|
65
73
|
type: streamType,
|
|
74
|
+
adUnitCode: bid.adUnitCode,
|
|
66
75
|
bidId: bid.bidId,
|
|
67
76
|
mediaType: type,
|
|
68
77
|
context: context,
|
|
69
78
|
playerId: getBidIdParameter('playerId', bid.params),
|
|
70
79
|
auctionId: bidderRequest.auctionId,
|
|
71
80
|
bidderCode: BIDDER_CODE,
|
|
72
|
-
gdprConsent:
|
|
81
|
+
gdprConsent: gdprConsent,
|
|
73
82
|
start: +new Date(),
|
|
74
83
|
timeout: 3000,
|
|
75
84
|
size: {
|
|
@@ -159,6 +168,7 @@ function createBids(bidRes, reqData) {
|
|
|
159
168
|
let bidUnit = {};
|
|
160
169
|
bidUnit.cpm = bid.cpm;
|
|
161
170
|
bidUnit.requestId = bid.bidId;
|
|
171
|
+
bidUnit.adUnitCode = reqBid.adUnitCode;
|
|
162
172
|
bidUnit.currency = bid.currency;
|
|
163
173
|
bidUnit.mediaType = bid.mediaType || VIDEO;
|
|
164
174
|
bidUnit.ttl = TTL;
|
|
@@ -183,7 +193,8 @@ function createBids(bidRes, reqData) {
|
|
|
183
193
|
} else if (bid.context === 'outstream') {
|
|
184
194
|
const renderer = Renderer.install({
|
|
185
195
|
id: bid.bidId,
|
|
186
|
-
url: '
|
|
196
|
+
url: 'https://static.showheroes.com/renderer.js',
|
|
197
|
+
adUnitCode: reqBid.adUnitCode,
|
|
187
198
|
config: {
|
|
188
199
|
playerId: reqBid.playerId,
|
|
189
200
|
width: bid.size.width,
|
|
@@ -53,7 +53,14 @@ export const spec = {
|
|
|
53
53
|
* @return boolean True if this is a valid bid, and false otherwise.
|
|
54
54
|
*/
|
|
55
55
|
isBidRequestValid: function(bid) {
|
|
56
|
-
|
|
56
|
+
// bid.params.host
|
|
57
|
+
if ((new RegExp(`^(vz.*|zz.*)\\.*$`, 'i')).test(bid.params.host)) { // New endpoint
|
|
58
|
+
if ((new RegExp(`^(zz.*)\\.*$`, 'i')).test(bid.params.host)) return validBasic(bid)
|
|
59
|
+
else return validBasic(bid) && validMediaType(bid)
|
|
60
|
+
} else { // This is backward compatible feature. It will be remove in the future
|
|
61
|
+
if ((new RegExp(`^(ZZ.*)\\.*$`, 'i')).test(bid.params.endpoint)) return validBasic(bid)
|
|
62
|
+
else return validBasic(bid) && validMediaType(bid)
|
|
63
|
+
}
|
|
57
64
|
},
|
|
58
65
|
|
|
59
66
|
/**
|
|
@@ -169,10 +176,6 @@ function validMediaType(bid) {
|
|
|
169
176
|
logWarn(LOG_PREFIX, 'Please review the mandatory Tappx parameters for Video. Video context not supported.');
|
|
170
177
|
return false;
|
|
171
178
|
}
|
|
172
|
-
if (typeof video.mimes == 'undefined') {
|
|
173
|
-
logWarn(LOG_PREFIX, 'Please review the mandatory Tappx parameters for Video. Mimes param is mandatory.');
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
179
|
}
|
|
177
180
|
|
|
178
181
|
return true;
|
|
@@ -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
|
+
```
|
|
@@ -190,8 +190,7 @@ function buildRequestObject(bid) {
|
|
|
190
190
|
const reqObj = {};
|
|
191
191
|
let placementId = getValue(bid.params, 'placementId');
|
|
192
192
|
let pageId = getValue(bid.params, 'pageId');
|
|
193
|
-
const
|
|
194
|
-
const gpid = deepAccess(impressionData, 'pbadslot') || deepAccess(impressionData, 'adserver.adslot');
|
|
193
|
+
const gpid = deepAccess(bid, 'ortb2Imp.ext.gpid');
|
|
195
194
|
|
|
196
195
|
reqObj.sizes = getSizes(bid);
|
|
197
196
|
reqObj.bidId = getBidIdParameter('bidId', bid);
|
|
@@ -2,7 +2,7 @@ import { logError, isEmpty, deepAccess, triggerPixel, logWarn, isArray } from '.
|
|
|
2
2
|
import {createBid as createBidFactory} from '../src/bidfactory.js';
|
|
3
3
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
4
4
|
import {VIDEO} from '../src/mediaTypes.js';
|
|
5
|
-
import
|
|
5
|
+
import CONSTANTS from '../src/constants.json';
|
|
6
6
|
|
|
7
7
|
const BIDDER_CODE = 'telaria';
|
|
8
8
|
const DOMAIN = 'tremorhub.com';
|
|
@@ -86,7 +86,7 @@ export const spec = {
|
|
|
86
86
|
logError(errorMessage);
|
|
87
87
|
} else if (!isEmpty(bidResult.seatbid)) {
|
|
88
88
|
bidResult.seatbid[0].bid.forEach(tag => {
|
|
89
|
-
bids.push(createBid(STATUS.GOOD, bidderRequest, tag, width, height, BIDDER_CODE));
|
|
89
|
+
bids.push(createBid(CONSTANTS.STATUS.GOOD, bidderRequest, tag, width, height, BIDDER_CODE));
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -6,9 +6,8 @@ import { config } from '../src/config.js';
|
|
|
6
6
|
|
|
7
7
|
const BIDDER_CODE = 'trustx';
|
|
8
8
|
const ENDPOINT_URL = 'https://grid.bidswitch.net/hbjson?sp=trustx';
|
|
9
|
-
const ADDITIONAL_SYNC_URL = 'https://x.bidswitch.net/sync?ssp=themediagrid';
|
|
10
9
|
const TIME_TO_LIVE = 360;
|
|
11
|
-
const ADAPTER_SYNC_URL = 'https://
|
|
10
|
+
const ADAPTER_SYNC_URL = 'https://x.bidswitch.net/sync?ssp=themediagrid';
|
|
12
11
|
const RENDERER_URL = 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js';
|
|
13
12
|
|
|
14
13
|
const LOG_ERROR_MESS = {
|
|
@@ -281,12 +280,12 @@ export const spec = {
|
|
|
281
280
|
},
|
|
282
281
|
getUserSyncs: function(syncOptions, responses, gdprConsent, uspConsent) {
|
|
283
282
|
if (syncOptions.pixelEnabled) {
|
|
284
|
-
const syncsPerBidder = config.getConfig('userSync.syncsPerBidder');
|
|
285
283
|
let params = [];
|
|
286
|
-
if (gdprConsent
|
|
284
|
+
if (gdprConsent) {
|
|
287
285
|
if (typeof gdprConsent.gdprApplies === 'boolean') {
|
|
288
|
-
params.push(`gdpr=${Number(gdprConsent.gdprApplies)}
|
|
289
|
-
}
|
|
286
|
+
params.push(`gdpr=${Number(gdprConsent.gdprApplies)}`);
|
|
287
|
+
}
|
|
288
|
+
if (typeof gdprConsent.consentString === 'string') {
|
|
290
289
|
params.push(`gdpr_consent=${gdprConsent.consentString}`);
|
|
291
290
|
}
|
|
292
291
|
}
|
|
@@ -294,17 +293,10 @@ export const spec = {
|
|
|
294
293
|
params.push(`us_privacy=${uspConsent}`);
|
|
295
294
|
}
|
|
296
295
|
const stringParams = params.join('&');
|
|
297
|
-
|
|
296
|
+
return {
|
|
298
297
|
type: 'image',
|
|
299
|
-
url: ADAPTER_SYNC_URL +
|
|
300
|
-
}
|
|
301
|
-
if (syncsPerBidder > 1) {
|
|
302
|
-
syncs.push({
|
|
303
|
-
type: 'image',
|
|
304
|
-
url: ADDITIONAL_SYNC_URL + (stringParams ? `&${stringParams}` : '')
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
return syncs;
|
|
298
|
+
url: ADAPTER_SYNC_URL + stringParams
|
|
299
|
+
};
|
|
308
300
|
}
|
|
309
301
|
}
|
|
310
302
|
}
|
package/modules/userId/eids.js
CHANGED
|
@@ -257,7 +257,13 @@ const USER_IDS_CONFIG = {
|
|
|
257
257
|
'connectId': {
|
|
258
258
|
source: 'yahoo.com',
|
|
259
259
|
atype: 3
|
|
260
|
-
}
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
// Adquery ID
|
|
263
|
+
'qid': {
|
|
264
|
+
source: 'adquery.io',
|
|
265
|
+
atype: 1
|
|
266
|
+
},
|
|
261
267
|
};
|
|
262
268
|
|
|
263
269
|
// this function will create an eid object for the given UserId sub-module
|