prebid.js 8.5.0 → 8.7.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/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adsinteractiveBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/alkimiBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/automatadAnalyticsAdapter.js +1 -0
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connatixBidAdapter.js +1 -0
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dependencies.json +6 -0
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freepassBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/growthCodeAnalyticsAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/kulturemediaBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/medianetBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/mspa.js +1 -1
- package/dist/newspassidBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +140 -136
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/pubCircleBidAdapter.js +1 -0
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/relevadRtdProvider.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/ssmasBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/tappxBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/topicsFpdModule.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/viantOrtbBidAdapter.js +1 -0
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/videojsVideoProvider.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/videoModule/jwplayer/bidMarkedAsUsed.html +1 -1
- package/integrationExamples/videoModule/jwplayer/bidRequestScheduling.html +1 -1
- package/integrationExamples/videoModule/jwplayer/bidsBackHandlerOverride.html +137 -0
- package/integrationExamples/videoModule/jwplayer/eventListeners.html +1 -1
- package/integrationExamples/videoModule/jwplayer/eventsUI.html +1 -1
- package/integrationExamples/videoModule/jwplayer/gamAdServerMediation.html +1 -1
- package/integrationExamples/videoModule/jwplayer/mediaMetadata.html +1 -1
- package/integrationExamples/videoModule/jwplayer/playlist.html +1 -1
- package/integrationExamples/videoModule/videojs/bidsBackHandlerOverride.html +164 -0
- package/libraries/mspa/activityControls.js +51 -32
- package/modules/adagioBidAdapter.js +15 -1
- package/modules/adgenerationBidAdapter.js +5 -4
- package/modules/adsinteractiveBidAdapter.js +4 -2
- package/modules/alkimiBidAdapter.js +19 -7
- package/modules/appnexusBidAdapter.js +1 -1
- package/modules/automatadAnalyticsAdapter.js +325 -0
- package/modules/automatadAnalyticsAdapter.md +23 -0
- package/modules/connatixBidAdapter.js +185 -0
- package/modules/connatixBidAdapter.md +37 -0
- package/modules/criteoBidAdapter.js +18 -0
- package/modules/cwireBidAdapter.js +19 -0
- package/modules/freepassBidAdapter.js +20 -1
- package/modules/freepassBidAdapter.md +4 -1
- package/modules/gridBidAdapter.js +1 -8
- package/modules/growthCodeAnalyticsAdapter.js +7 -2
- package/modules/medianetBidAdapter.js +7 -4
- package/modules/mediasquareBidAdapter.js +3 -0
- package/modules/newspassid.md +76 -0
- package/modules/newspassidBidAdapter.js +44 -18
- package/modules/optidigitalBidAdapter.js +25 -16
- package/modules/pubCircleBidAdapter.js +231 -0
- package/modules/pubCircleBidAdapter.md +79 -0
- package/modules/relevadRtdProvider.js +6 -7
- package/modules/ssmasBidAdapter.js +2 -2
- package/modules/tappxBidAdapter.js +27 -15
- package/modules/tappxBidAdapter.md +17 -0
- package/modules/topicsFpdModule.js +21 -48
- package/modules/undertoneBidAdapter.md +1 -1
- package/modules/userId/eids.md +7 -0
- package/modules/viantOrtbBidAdapter.js +113 -0
- package/modules/viantOrtbBidAdapter.md +54 -0
- package/modules/vidazooBidAdapter.js +9 -2
- package/modules/videojsVideoProvider.js +9 -2
- package/package.json +1 -1
- package/test/spec/libraries/mspa/activityControls_spec.js +145 -212
- package/test/spec/modules/adagioBidAdapter_spec.js +89 -0
- package/test/spec/modules/adgenerationBidAdapter_spec.js +6 -6
- package/test/spec/modules/alkimiBidAdapter_spec.js +3 -9
- package/test/spec/modules/appnexusBidAdapter_spec.js +12 -1
- package/test/spec/modules/automatadAnalyticsAdapter_spec.js +533 -0
- package/test/spec/modules/connatixBidAdapter_spec.js +366 -0
- package/test/spec/modules/criteoBidAdapter_spec.js +52 -3
- package/test/spec/modules/cwireBidAdapter_spec.js +47 -0
- package/test/spec/modules/freepassBidAdapter_spec.js +44 -0
- package/test/spec/modules/gridBidAdapter_spec.js +68 -0
- package/test/spec/modules/medianetBidAdapter_spec.js +18 -18
- package/test/spec/modules/mediasquareBidAdapter_spec.js +5 -0
- package/test/spec/modules/newspassidBidAdapter_spec.js +6 -0
- package/test/spec/modules/optidigitalBidAdapter_spec.js +9 -2
- package/test/spec/modules/pubCircleBidAdapter_spec.js +399 -0
- package/test/spec/modules/tappxBidAdapter_spec.js +19 -0
- package/test/spec/modules/topicsFpdModule_spec.js +343 -365
- package/test/spec/modules/viantOrtbBidAdapter_spec.js +432 -0
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import {logError, logWarn, mergeDeep,
|
|
1
|
+
import {isEmpty, logError, logWarn, mergeDeep, safeJSONParse} from '../src/utils.js';
|
|
2
2
|
import {getRefererInfo} from '../src/refererDetection.js';
|
|
3
3
|
import {submodule} from '../src/hook.js';
|
|
4
4
|
import {GreedyPromise} from '../src/utils/promise.js';
|
|
5
5
|
import {config} from '../src/config.js';
|
|
6
6
|
import {getCoreStorageManager} from '../src/storageManager.js';
|
|
7
7
|
import {includes} from '../src/polyfill.js';
|
|
8
|
-
import {
|
|
8
|
+
import {isActivityAllowed} from '../src/activities/rules.js';
|
|
9
|
+
import {ACTIVITY_ENRICH_UFPD} from '../src/activities/activities.js';
|
|
10
|
+
import {activityParams} from '../src/activities/activityParams.js';
|
|
11
|
+
import {MODULE_TYPE_BIDDER} from '../src/activities/modules.js';
|
|
9
12
|
|
|
10
13
|
const MODULE_NAME = 'topicsFpd';
|
|
11
14
|
const DEFAULT_EXPIRATION_DAYS = 21;
|
|
12
|
-
const TCF_REQUIRED_PURPOSES = ['1', '2', '3', '4'];
|
|
13
|
-
let HAS_GDPR_CONSENT = true;
|
|
14
15
|
let LOAD_TOPICS_INITIALISE = false;
|
|
15
|
-
|
|
16
|
+
|
|
17
|
+
export function reset() {
|
|
18
|
+
LOAD_TOPICS_INITIALISE = false;
|
|
19
|
+
}
|
|
16
20
|
|
|
17
21
|
const bidderIframeList = {
|
|
18
22
|
maxTopicCaller: 2,
|
|
@@ -86,10 +90,14 @@ export function getTopicsData(name, topics, taxonomies = TAXONOMIES) {
|
|
|
86
90
|
);
|
|
87
91
|
}
|
|
88
92
|
|
|
93
|
+
function isTopicsSupported(doc = document) {
|
|
94
|
+
return 'browsingTopics' in doc && doc.featurePolicy.allowsFeature('browsing-topics')
|
|
95
|
+
}
|
|
96
|
+
|
|
89
97
|
export function getTopics(doc = document) {
|
|
90
98
|
let topics = null;
|
|
91
99
|
try {
|
|
92
|
-
if (
|
|
100
|
+
if (isTopicsSupported(doc)) {
|
|
93
101
|
topics = GreedyPromise.resolve(doc.browsingTopics());
|
|
94
102
|
}
|
|
95
103
|
} catch (e) {
|
|
@@ -126,19 +134,16 @@ export function processFpd(config, {global}, {data = topicsData} = {}) {
|
|
|
126
134
|
*/
|
|
127
135
|
export function getCachedTopics() {
|
|
128
136
|
let cachedTopicData = [];
|
|
129
|
-
if (!HAS_GDPR_CONSENT || !HAS_DEVICE_ACCESS) {
|
|
130
|
-
return cachedTopicData;
|
|
131
|
-
}
|
|
132
137
|
const topics = config.getConfig('userSync.topics') || bidderIframeList;
|
|
133
138
|
const bidderList = topics.bidders || [];
|
|
134
139
|
let storedSegments = new Map(safeJSONParse(coreStorage.getDataFromLocalStorage(topicStorageName)));
|
|
135
140
|
storedSegments && storedSegments.forEach((value, cachedBidder) => {
|
|
136
141
|
// Check bidder exist in config for cached bidder data and then only retrieve the cached data
|
|
137
|
-
let bidderConfigObj = bidderList.find(({bidder}) => cachedBidder
|
|
138
|
-
if (bidderConfigObj) {
|
|
142
|
+
let bidderConfigObj = bidderList.find(({bidder}) => cachedBidder === bidder)
|
|
143
|
+
if (bidderConfigObj && isActivityAllowed(ACTIVITY_ENRICH_UFPD, activityParams(MODULE_TYPE_BIDDER, cachedBidder))) {
|
|
139
144
|
if (!isCachedDataExpired(value[lastUpdated], bidderConfigObj?.expiry || DEFAULT_EXPIRATION_DAYS)) {
|
|
140
145
|
Object.keys(value).forEach((segData) => {
|
|
141
|
-
segData
|
|
146
|
+
segData !== lastUpdated && cachedTopicData.push(value[segData]);
|
|
142
147
|
})
|
|
143
148
|
} else {
|
|
144
149
|
// delete the specific bidder map from the store and store the updated maps
|
|
@@ -204,55 +209,23 @@ function listenMessagesFromTopicIframe() {
|
|
|
204
209
|
window.addEventListener('message', receiveMessage, false);
|
|
205
210
|
}
|
|
206
211
|
|
|
207
|
-
function checkTCFv2(vendorData, requiredPurposes = TCF_REQUIRED_PURPOSES) {
|
|
208
|
-
const {gdprApplies, purpose} = vendorData;
|
|
209
|
-
if (!gdprApplies || !purpose) {
|
|
210
|
-
return true;
|
|
211
|
-
}
|
|
212
|
-
return requiredPurposes.map((purposeNo) => {
|
|
213
|
-
const purposeConsent = purpose.consents ? purpose.consents[purposeNo] : false;
|
|
214
|
-
if (purposeConsent) {
|
|
215
|
-
return true;
|
|
216
|
-
}
|
|
217
|
-
return false;
|
|
218
|
-
}).reduce((a, b) => a && b, true);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export function hasGDPRConsent() {
|
|
222
|
-
// Check for GDPR consent for purpose 1,2,3,4 and return false if consent has not been given
|
|
223
|
-
const gdprConsent = gdprDataHandler.getConsentData();
|
|
224
|
-
const hasGdpr = (gdprConsent && typeof gdprConsent.gdprApplies === 'boolean' && gdprConsent.gdprApplies) ? 1 : 0;
|
|
225
|
-
const gdprConsentString = hasGdpr ? gdprConsent.consentString : '';
|
|
226
|
-
if (hasGdpr) {
|
|
227
|
-
if ((!gdprConsentString || gdprConsentString === '') || !gdprConsent.vendorData) {
|
|
228
|
-
return false;
|
|
229
|
-
}
|
|
230
|
-
return checkTCFv2(gdprConsent.vendorData);
|
|
231
|
-
}
|
|
232
|
-
return true;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
212
|
/**
|
|
236
213
|
* function to load the iframes of the bidder to load the topics data
|
|
237
214
|
*/
|
|
238
|
-
function loadTopicsForBidders() {
|
|
239
|
-
|
|
240
|
-
if (!HAS_GDPR_CONSENT || !HAS_DEVICE_ACCESS) {
|
|
241
|
-
logInfo('Topics Module : Consent string is required to fetch the topics from third party domains.');
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
215
|
+
export function loadTopicsForBidders(doc = document) {
|
|
216
|
+
if (!isTopicsSupported(doc)) return;
|
|
244
217
|
const topics = config.getConfig('userSync.topics') || bidderIframeList;
|
|
245
218
|
if (topics) {
|
|
246
219
|
listenMessagesFromTopicIframe();
|
|
247
220
|
const randomBidders = getRandomBidders(topics.bidders || [], topics.maxTopicCaller || 1)
|
|
248
221
|
randomBidders && randomBidders.forEach(({ bidder, iframeURL }) => {
|
|
249
222
|
if (bidder && iframeURL) {
|
|
250
|
-
let ifrm =
|
|
223
|
+
let ifrm = doc.createElement('iframe');
|
|
251
224
|
ifrm.name = 'ifrm_'.concat(bidder);
|
|
252
225
|
ifrm.src = ''.concat(iframeURL, '?bidder=').concat(bidder);
|
|
253
226
|
ifrm.style.display = 'none';
|
|
254
227
|
setLoadedIframeURL(new URL(iframeURL).origin);
|
|
255
|
-
iframeURL &&
|
|
228
|
+
iframeURL && doc.documentElement.appendChild(ifrm);
|
|
256
229
|
}
|
|
257
230
|
})
|
|
258
231
|
} else {
|
package/modules/userId/eids.md
CHANGED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
2
|
+
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
|
|
3
|
+
import * as utils from '../src/utils.js';
|
|
4
|
+
import {ortbConverter} from '../libraries/ortbConverter/converter.js'
|
|
5
|
+
import {deepAccess, getBidIdParameter, logError} from '../src/utils.js';
|
|
6
|
+
|
|
7
|
+
const BIDDER_CODE = 'viant';
|
|
8
|
+
const ENDPOINT = 'https://bidders-us-east-1.adelphic.net/d/rtb/v25/prebid/bidder_test'
|
|
9
|
+
|
|
10
|
+
const DEFAULT_BID_TTL = 300;
|
|
11
|
+
const DEFAULT_CURRENCY = 'USD';
|
|
12
|
+
const DEFAULT_NET_REVENUE = true;
|
|
13
|
+
|
|
14
|
+
export const spec = {
|
|
15
|
+
code: BIDDER_CODE,
|
|
16
|
+
supportedMediaTypes: [BANNER, VIDEO, NATIVE],
|
|
17
|
+
|
|
18
|
+
isBidRequestValid: function (bid) {
|
|
19
|
+
if (bid && typeof bid.params !== 'object') {
|
|
20
|
+
logError(BIDDER_CODE + ': params is not defined or is incorrect in the bidder settings.');
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
if (!getBidIdParameter('publisherId', bid.params)) {
|
|
24
|
+
logError(BIDDER_CODE + ': publisherId is not present in bidder params.');
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
const mediaTypesBanner = deepAccess(bid, 'mediaTypes.banner');
|
|
28
|
+
const mediaTypesVideo = deepAccess(bid, 'mediaTypes.video');
|
|
29
|
+
const mediaTypesNative = deepAccess(bid, 'mediaTypes.native');
|
|
30
|
+
if (!mediaTypesBanner && !mediaTypesVideo && !mediaTypesNative) {
|
|
31
|
+
utils.logWarn(BIDDER_CODE + ': one of mediaTypes.banner or mediaTypes.video or mediaTypes.native must be passed');
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return true;
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
buildRequests,
|
|
38
|
+
|
|
39
|
+
interpretResponse(response, request) {
|
|
40
|
+
if (!response.body) {
|
|
41
|
+
response.body = {nbr: 0};
|
|
42
|
+
}
|
|
43
|
+
const bids = converter.fromORTB({request: request.data, response: response.body}).bids;
|
|
44
|
+
return bids;
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Register bidder specific code, which will execute if a bid from this bidder won the auction
|
|
49
|
+
* @param {Bid} bid The bid that won the auction
|
|
50
|
+
*/
|
|
51
|
+
onBidWon: function (bid) {
|
|
52
|
+
if (bid.burl) {
|
|
53
|
+
utils.triggerPixel(bid.burl);
|
|
54
|
+
} else if (bid.nurl) {
|
|
55
|
+
utils.triggerPixel(bid.nurl);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function buildRequests(bids, bidderRequest) {
|
|
61
|
+
let videoBids = bids.filter(bid => isVideoBid(bid));
|
|
62
|
+
let bannerBids = bids.filter(bid => isBannerBid(bid));
|
|
63
|
+
let nativeBids = bids.filter(bid => isNativeBid(bid));
|
|
64
|
+
let requests = bannerBids.length ? [createRequest(bannerBids, bidderRequest, BANNER)] : [];
|
|
65
|
+
videoBids.forEach(bid => {
|
|
66
|
+
requests.push(createRequest([bid], bidderRequest, VIDEO));
|
|
67
|
+
});
|
|
68
|
+
nativeBids.forEach(bid => {
|
|
69
|
+
requests.push(createRequest([bid], bidderRequest, NATIVE));
|
|
70
|
+
});
|
|
71
|
+
return requests;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function createRequest(bidRequests, bidderRequest, mediaType) {
|
|
75
|
+
const data = converter.toORTB({bidRequests, bidderRequest, context: {mediaType}});
|
|
76
|
+
if (bidderRequest.gdprConsent && typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') {
|
|
77
|
+
if (!data.regs) data.regs = {};
|
|
78
|
+
if (!data.regs.ext) data.regs.ext = {};
|
|
79
|
+
data.regs.ext.gdpr = bidderRequest.gdprConsent.gdprApplies ? 1 : 0;
|
|
80
|
+
}
|
|
81
|
+
if (bidderRequest.uspConsent) {
|
|
82
|
+
if (!data.regs) data.regs = {};
|
|
83
|
+
if (!data.regs.ext) data.regs.ext = {};
|
|
84
|
+
data.regs.ext.us_privacy = bidderRequest.uspConsent;
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
method: 'POST',
|
|
88
|
+
url: ENDPOINT,
|
|
89
|
+
data: data
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function isVideoBid(bid) {
|
|
94
|
+
return deepAccess(bid, 'mediaTypes.video');
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function isBannerBid(bid) {
|
|
98
|
+
return deepAccess(bid, 'mediaTypes.banner');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function isNativeBid(bid) {
|
|
102
|
+
return deepAccess(bid, 'mediaTypes.native');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const converter = ortbConverter({
|
|
106
|
+
context: {
|
|
107
|
+
netRevenue: DEFAULT_NET_REVENUE,
|
|
108
|
+
ttl: DEFAULT_BID_TTL,
|
|
109
|
+
currency: DEFAULT_CURRENCY
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
registerBidder(spec);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
Module Name: VIANT Bidder Adapter
|
|
4
|
+
Module Type: Bidder Adapter
|
|
5
|
+
Maintainer: dist-runtime@viantinc.com
|
|
6
|
+
|
|
7
|
+
# Description
|
|
8
|
+
|
|
9
|
+
An adapter to get a bid from VIANT DSP.
|
|
10
|
+
|
|
11
|
+
# Test Parameters
|
|
12
|
+
```javascript
|
|
13
|
+
var adUnits = [ // Banner adUnit with only required parameters
|
|
14
|
+
{
|
|
15
|
+
code: 'test-div-minimal',
|
|
16
|
+
mediaTypes: {
|
|
17
|
+
banner: {
|
|
18
|
+
sizes: [[728, 90]]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
bids: [
|
|
22
|
+
{
|
|
23
|
+
bidder: 'viant',
|
|
24
|
+
params: {
|
|
25
|
+
supplySourceId: 'supplier',
|
|
26
|
+
publisherId: '464'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
code: 'test-div-minimal-video',
|
|
33
|
+
mediaTypes: {
|
|
34
|
+
video: {
|
|
35
|
+
playerSize: [640, 480],
|
|
36
|
+
context: 'outstream'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
bids: [
|
|
40
|
+
{
|
|
41
|
+
bidder: 'viant',
|
|
42
|
+
params: {
|
|
43
|
+
supplySourceId: 'supplier',
|
|
44
|
+
publisherId: '464' // required
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
];
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Where:
|
|
53
|
+
|
|
54
|
+
* placementId - Placement ID of the ad unit (required)
|
|
@@ -320,13 +320,20 @@ function interpretResponse(serverResponse, request) {
|
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
function getUserSyncs(syncOptions, responses, gdprConsent = {}, uspConsent = '') {
|
|
323
|
+
function getUserSyncs(syncOptions, responses, gdprConsent = {}, uspConsent = '', gppConsent = {}) {
|
|
324
324
|
let syncs = [];
|
|
325
325
|
const {iframeEnabled, pixelEnabled} = syncOptions;
|
|
326
326
|
const {gdprApplies, consentString = ''} = gdprConsent;
|
|
327
|
+
const {gppString, applicableSections} = gppConsent;
|
|
327
328
|
|
|
328
329
|
const cidArr = responses.filter(resp => deepAccess(resp, 'body.cid')).map(resp => resp.body.cid).filter(uniques);
|
|
329
|
-
|
|
330
|
+
let params = `?cid=${encodeURIComponent(cidArr.join(','))}&gdpr=${gdprApplies ? 1 : 0}&gdpr_consent=${encodeURIComponent(consentString || '')}&us_privacy=${encodeURIComponent(uspConsent || '')}`;
|
|
331
|
+
|
|
332
|
+
if (gppString && applicableSections?.length) {
|
|
333
|
+
params += '&gpp=' + encodeURIComponent(gppString);
|
|
334
|
+
params += '&gpp_sid=' + encodeURIComponent(applicableSections.join(','));
|
|
335
|
+
}
|
|
336
|
+
|
|
330
337
|
if (iframeEnabled) {
|
|
331
338
|
syncs.push({
|
|
332
339
|
type: 'iframe',
|
|
@@ -201,8 +201,15 @@ export function VideojsProvider(providerConfig, vjs_, adState_, timeState_, call
|
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
|
|
205
|
-
|
|
204
|
+
// The VideoJS IMA plugin version 1.11.0 will throw when the ad is empty.
|
|
205
|
+
try {
|
|
206
|
+
player.ima.changeAdTag(adTagUrl);
|
|
207
|
+
player.ima.requestAds();
|
|
208
|
+
} catch (e) {
|
|
209
|
+
/*
|
|
210
|
+
Handling is not required; ad errors are emitted automatically by video.js
|
|
211
|
+
*/
|
|
212
|
+
}
|
|
206
213
|
}
|
|
207
214
|
|
|
208
215
|
function onEvent(type, callback, payload) {
|