prebid.js 6.6.0 → 6.10.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/.eslintrc.js +8 -1
- package/allowedModules.js +4 -7
- package/integrationExamples/gpt/amp/creative.html +11 -33
- package/integrationExamples/gpt/{haloRtdProvider_example.html → hadronRtdProvider_example.html} +9 -9
- package/integrationExamples/gpt/idImportLibrary_example.html +2 -2
- package/integrationExamples/gpt/userId_example.html +2 -2
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +154 -115
- package/integrationExamples/gpt/x-domain/creative.html +63 -29
- package/modules/.submodules.json +3 -0
- package/modules/adagioBidAdapter.js +1 -9
- package/modules/adagioBidAdapter.md +1 -1
- package/modules/adbookpspBidAdapter.js +29 -12
- package/modules/adhashBidAdapter.js +4 -4
- package/modules/adkernelBidAdapter.js +2 -2
- package/modules/adlooxAnalyticsAdapter.js +1 -1
- package/modules/adlooxRtdProvider.js +1 -1
- package/modules/adnowBidAdapter.js +1 -1
- package/modules/adnuntiusRtdProvider.js +96 -0
- package/modules/adnuntiusRtdProvider.md +41 -0
- package/modules/adomikAnalyticsAdapter.js +2 -2
- package/modules/adotBidAdapter.js +1 -1
- package/modules/adpod.js +14 -17
- package/modules/adrelevantisBidAdapter.js +2 -2
- package/modules/adtargetBidAdapter.js +1 -1
- package/modules/adtelligentBidAdapter.js +1 -1
- package/modules/advangelistsBidAdapter.js +2 -2
- package/modules/adxpremiumAnalyticsAdapter.js +1 -1
- package/modules/adyoulikeBidAdapter.js +1 -1
- package/modules/afpBidAdapter.js +1 -1
- package/modules/appnexusBidAdapter.js +16 -4
- package/modules/asealBidAdapter.js +58 -0
- package/modules/asealBidAdapter.md +52 -0
- package/modules/beachfrontBidAdapter.js +2 -2
- package/modules/betweenBidAdapter.js +1 -1
- package/modules/bidViewability.js +1 -1
- package/modules/bluebillywigBidAdapter.js +1 -1
- package/modules/brandmetricsRtdProvider.js +168 -0
- package/modules/brandmetricsRtdProvider.md +40 -0
- package/modules/bridgewellBidAdapter.js +1 -1
- package/modules/browsiRtdProvider.js +2 -2
- package/modules/cleanmedianetBidAdapter.js +1 -1
- package/modules/colossussspBidAdapter.js +12 -8
- package/modules/colossussspBidAdapter.md +15 -1
- package/modules/compassBidAdapter.js +1 -1
- package/modules/connectIdSystem.js +1 -1
- package/modules/consentManagement.js +2 -3
- package/modules/consumableBidAdapter.md +1 -1
- package/modules/conversantBidAdapter.js +7 -0
- package/modules/craftBidAdapter.js +2 -2
- package/modules/criteoBidAdapter.js +10 -1
- package/modules/currency.js +27 -5
- package/modules/cwireBidAdapter.js +1 -1
- package/modules/dailyhuntBidAdapter.js +1 -1
- package/modules/dchain.js +1 -1
- package/modules/displayioBidAdapter.js +157 -0
- package/modules/displayioBidAdapter.md +148 -0
- package/modules/dspxBidAdapter.js +69 -29
- package/modules/dspxBidAdapter.md +2 -1
- package/modules/e_volutionBidAdapter.js +158 -0
- package/modules/emx_digitalBidAdapter.js +2 -2
- package/modules/fluctBidAdapter.js +0 -1
- package/modules/gamoshiBidAdapter.js +1 -1
- package/modules/gdprEnforcement.js +2 -2
- package/modules/glomexBidAdapter.js +1 -1
- package/modules/gnetBidAdapter.js +3 -3
- package/modules/gnetBidAdapter.md +4 -4
- package/modules/goldbachBidAdapter.js +2 -2
- package/modules/gptPreAuction.js +1 -1
- package/modules/gridBidAdapter.js +15 -1
- package/modules/gumgumBidAdapter.js +57 -43
- package/modules/hadronIdSystem.js +96 -0
- package/modules/hadronIdSystem.md +35 -0
- package/modules/hadronRtdProvider.js +254 -0
- package/modules/hadronRtdProvider.md +126 -0
- package/modules/haloIdSystem.md +4 -35
- package/modules/haloRtdProvider.md +3 -126
- package/modules/hybridBidAdapter.js +1 -1
- package/modules/improvedigitalBidAdapter.js +6 -1
- package/modules/insticatorBidAdapter.js +1 -1
- package/modules/interactiveOffersBidAdapter.js +9 -6
- package/modules/intersectionRtdProvider.js +1 -1
- package/modules/ixBidAdapter.js +2 -2
- package/modules/jwplayerRtdProvider.js +72 -7
- package/modules/jwplayerRtdProvider.md +27 -11
- package/modules/kargoBidAdapter.js +2 -2
- package/modules/livewrappedBidAdapter.js +1 -1
- package/modules/lunamediahbBidAdapter.js +32 -4
- package/modules/malltvBidAdapter.js +7 -3
- package/modules/malltvBidAdapter.md +64 -51
- package/modules/mass.js +3 -5
- package/modules/mediakeysBidAdapter.js +2 -2
- package/modules/medianetAnalyticsAdapter.js +2 -2
- package/modules/medianetRtdProvider.js +1 -1
- package/modules/mediasquareBidAdapter.js +1 -0
- package/modules/nextMillenniumBidAdapter.js +1 -0
- package/modules/nextrollBidAdapter.js +1 -1
- package/modules/oguryBidAdapter.js +7 -14
- package/modules/onetagBidAdapter.js +1 -1
- package/modules/openwebBidAdapter.js +1 -1
- package/modules/openxAnalyticsAdapter.js +2 -2
- package/modules/openxBidAdapter.js +1 -1
- package/modules/parrableIdSystem.js +1 -1
- package/modules/permutiveRtdProvider.js +1 -1
- package/modules/pilotxBidAdapter.js +147 -0
- package/modules/pilotxBidAdapter.md +50 -0
- package/modules/pixfutureBidAdapter.js +2 -2
- package/modules/prebidServerBidAdapter/index.js +63 -41
- package/modules/priceFloors.js +15 -14
- package/modules/pubmaticBidAdapter.js +1 -1
- package/modules/quantcastBidAdapter.js +1 -1
- package/modules/reconciliationRtdProvider.js +1 -1
- package/modules/richaudienceBidAdapter.js +7 -2
- package/modules/riseBidAdapter.js +17 -6
- package/modules/roxotAnalyticsAdapter.js +1 -1
- package/modules/rtbhouseBidAdapter.js +1 -1
- package/modules/rtdModule/index.js +9 -11
- package/modules/rubiconAnalyticsAdapter.js +8 -2
- package/modules/rubiconBidAdapter.js +1 -1
- package/modules/saambaaBidAdapter.js +420 -420
- package/modules/seedingAllianceBidAdapter.js +3 -3
- package/modules/sharethroughBidAdapter.js +12 -17
- package/modules/sigmoidAnalyticsAdapter.js +1 -1
- package/modules/sirdataRtdProvider.js +1 -1
- package/modules/sizeMappingV2.js +2 -9
- package/modules/smarticoBidAdapter.js +1 -1
- package/modules/sortableAnalyticsAdapter.js +5 -4
- package/modules/sovrnAnalyticsAdapter.js +2 -2
- package/modules/sovrnBidAdapter.js +93 -18
- package/modules/sovrnBidAdapter.md +80 -2
- package/modules/sspBCBidAdapter.js +54 -21
- package/modules/synacormediaBidAdapter.js +32 -11
- package/modules/targetVideoBidAdapter.js +1 -1
- package/modules/telariaBidAdapter.js +22 -29
- package/modules/trustpidSystem.js +197 -0
- package/modules/trustpidSystem.md +45 -0
- package/modules/undertoneBidAdapter.js +17 -1
- package/modules/userId/eids.js +16 -1
- package/modules/userId/eids.md +10 -2
- package/modules/userId/index.js +2 -2
- package/modules/userId/userId.md +17 -2
- package/modules/ventesBidAdapter.js +1 -1
- package/modules/verizonMediaIdSystem.js +1 -1
- package/modules/vibrantmediaBidAdapter.js +220 -0
- package/modules/vibrantmediaBidAdapter.md +92 -0
- package/modules/viewability.js +177 -0
- package/modules/viewability.md +87 -0
- package/modules/viewdeosDXBidAdapter.js +1 -1
- package/modules/voxBidAdapter.js +1 -1
- package/modules/waardexBidAdapter.js +1 -1
- package/modules/weboramaRtdProvider.js +264 -34
- package/modules/weboramaRtdProvider.md +110 -40
- package/modules/widespaceBidAdapter.js +2 -2
- package/modules/winrBidAdapter.js +7 -7
- package/modules/yahoosspBidAdapter.js +3 -1
- package/modules/yieldlabBidAdapter.js +1 -1
- package/modules/yieldmoBidAdapter.js +2 -2
- package/modules/yieldoneBidAdapter.js +6 -0
- package/modules/yuktamediaAnalyticsAdapter.js +1 -1
- package/package.json +3 -1
- package/plugins/poly/arrayFrom.js +3 -0
- package/plugins/poly/find.js +3 -0
- package/plugins/poly/findIndex.js +3 -0
- package/plugins/poly/includes.js +3 -0
- package/plugins/poly/package.json +8 -0
- package/src/Renderer.js +1 -1
- package/src/adRendering.js +38 -0
- package/src/adapterManager.js +33 -28
- package/src/adapters/bidderFactory.js +13 -11
- package/src/adloader.js +3 -2
- package/src/auction.js +140 -117
- package/src/auctionIndex.js +85 -0
- package/src/auctionManager.js +4 -1
- package/src/bidderSettings.js +69 -0
- package/src/bidfactory.js +18 -6
- package/src/config.js +3 -4
- package/src/cpmBucketManager.js +1 -1
- package/src/native.js +30 -22
- package/src/prebid.js +4 -20
- package/src/secureCreatives.js +133 -49
- package/src/sizeMapping.js +1 -1
- package/src/storageManager.js +1 -1
- package/src/targeting.js +13 -4
- package/src/userSync.js +1 -1
- package/src/utils.js +16 -19
- package/src/video.js +11 -12
- package/src/videoCache.js +10 -9
- package/test/fixtures/fixtures.js +2 -1
- package/test/helpers/indexStub.js +28 -0
- package/test/helpers/syncPromise.js +71 -0
- package/test/spec/auctionmanager_spec.js +269 -90
- package/test/spec/config_spec.js +24 -1
- package/test/spec/e2e/longform/basic_w_bidderSettings.spec.js +1 -1
- package/test/spec/e2e/longform/basic_w_custom_adserver_translation.spec.js +1 -1
- package/test/spec/e2e/longform/basic_w_priceGran.spec.js +1 -1
- package/test/spec/e2e/longform/basic_w_requireExactDuration.spec.js +1 -1
- package/test/spec/e2e/longform/basic_wo_brandCategoryExclusion.spec.js +1 -1
- package/test/spec/e2e/longform/basic_wo_requireExactDuration.spec.js +1 -1
- package/test/spec/modules/adagioBidAdapter_spec.js +0 -10
- package/test/spec/modules/adbookpspBidAdapter_spec.js +17 -3
- package/test/spec/modules/adhashBidAdapter_spec.js +2 -2
- package/test/spec/modules/adnuntiusRtdProvider_spec.js +145 -0
- package/test/spec/modules/adpod_spec.js +91 -156
- package/test/spec/modules/afpBidAdapter_spec.js +1 -1
- package/test/spec/modules/appnexusBidAdapter_spec.js +27 -0
- package/test/spec/modules/asealBidAdapter_spec.js +144 -0
- package/test/spec/modules/brandmetricsRtdProvider_spec.js +191 -0
- package/test/spec/modules/colossussspBidAdapter_spec.js +5 -2
- package/test/spec/modules/conversantBidAdapter_spec.js +54 -2
- package/test/spec/modules/criteoBidAdapter_spec.js +21 -0
- package/test/spec/modules/currency_spec.js +36 -15
- package/test/spec/modules/deepintentDpesIdsystem_spec.js +1 -1
- package/test/spec/modules/displayioBidAdapter_spec.js +239 -0
- package/test/spec/modules/dspxBidAdapter_spec.js +20 -15
- package/test/spec/modules/e_volutionBidAdapter_spec.js +242 -0
- package/test/spec/modules/eids_spec.js +2 -2
- package/test/spec/modules/eplanningAnalyticsAdapter_spec.js +1 -1
- package/test/spec/modules/fintezaAnalyticsAdapter_spec.js +1 -1
- package/test/spec/modules/gnetBidAdapter_spec.js +6 -6
- package/test/spec/modules/gridBidAdapter_spec.js +18 -0
- package/test/spec/modules/gumgumBidAdapter_spec.js +49 -3
- package/test/spec/modules/hadronIdSystem_spec.js +57 -0
- package/test/spec/modules/hadronRtdProvider_spec.js +762 -0
- package/test/spec/modules/idxIdSystem_spec.js +1 -1
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +19 -0
- package/test/spec/modules/jwplayerRtdProvider_spec.js +195 -2
- package/test/spec/modules/kargoBidAdapter_spec.js +1 -1
- package/test/spec/modules/lunamediahbBidAdapter_spec.js +27 -1
- package/test/spec/modules/mass_spec.js +2 -14
- package/test/spec/modules/mediakeysBidAdapter_spec.js +1 -1
- package/test/spec/modules/multibid_spec.js +1 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +63 -5
- package/test/spec/modules/onetagBidAdapter_spec.js +1 -1
- package/test/spec/modules/openxAnalyticsAdapter_spec.js +1 -1
- package/test/spec/modules/parrableIdSystem_spec.js +1 -1
- package/test/spec/modules/pilotxBidAdapter_spec.js +244 -0
- package/test/spec/modules/prebidServerBidAdapter_spec.js +43 -6
- package/test/spec/modules/priceFloors_spec.js +37 -24
- package/test/spec/modules/pubmaticBidAdapter_spec.js +40 -0
- package/test/spec/modules/realTimeDataModule_spec.js +51 -2
- package/test/spec/modules/riseBidAdapter_spec.js +30 -4
- package/test/spec/modules/rubiconAnalyticsAdapter_spec.js +61 -1
- package/test/spec/modules/rubiconBidAdapter_spec.js +1 -1
- package/test/spec/modules/sharethroughBidAdapter_spec.js +91 -6
- package/test/spec/modules/sortableAnalyticsAdapter_spec.js +2 -3
- package/test/spec/modules/sovrnBidAdapter_spec.js +413 -333
- package/test/spec/modules/sspBCBidAdapter_spec.js +7 -7
- package/test/spec/modules/stroeerCoreBidAdapter_spec.js +1 -1
- package/test/spec/modules/synacormediaBidAdapter_spec.js +70 -0
- package/test/spec/modules/telariaBidAdapter_spec.js +1 -3
- package/test/spec/modules/trustpidSystem_spec.js +232 -0
- package/test/spec/modules/undertoneBidAdapter_spec.js +55 -2
- package/test/spec/modules/userId_spec.js +40 -40
- package/test/spec/modules/vibrantmediaBidAdapter_spec.js +1237 -0
- package/test/spec/modules/viewability_spec.js +280 -0
- package/test/spec/modules/weboramaRtdProvider_spec.js +536 -20
- package/test/spec/modules/widespaceBidAdapter_spec.js +1 -1
- package/test/spec/modules/yahoosspBidAdapter_spec.js +10 -0
- package/test/spec/modules/yieldoneBidAdapter_spec.js +33 -0
- package/test/spec/modules/zeotapIdPlusIdSystem_spec.js +1 -1
- package/test/spec/native_spec.js +62 -40
- package/test/spec/sizeMapping_spec.js +1 -1
- package/test/spec/unit/core/adapterManager_spec.js +24 -2
- package/test/spec/unit/core/auctionIndex_spec.js +129 -0
- package/test/spec/unit/core/bidderFactory_spec.js +65 -12
- package/test/spec/unit/core/bidderSettings_spec.js +123 -0
- package/test/spec/unit/core/targeting_spec.js +93 -0
- package/test/spec/unit/pbjs_api_spec.js +81 -43
- package/test/spec/unit/secureCreatives_spec.js +143 -24
- package/test/spec/videoCache_spec.js +18 -19
- package/test/spec/video_spec.js +51 -61
- package/webpack.conf.js +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import includes from '
|
|
2
|
-
import find from '
|
|
1
|
+
import includes from 'prebidjs-polyfill/includes.js';
|
|
2
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
3
3
|
import { config } from '../src/config.js';
|
|
4
4
|
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
5
5
|
import { getStorageManager } from '../src/storageManager.js';
|
|
@@ -363,7 +363,7 @@ function impBidsToPrebidBids(
|
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
const impToPrebidBid =
|
|
366
|
-
(bidderRequestBody, bidResponseCurrency, referrer, targetingMap) => (bid) => {
|
|
366
|
+
(bidderRequestBody, bidResponseCurrency, referrer, targetingMap) => (bid, bidIndex) => {
|
|
367
367
|
try {
|
|
368
368
|
const bidRequest = findBidRequest(bidderRequestBody, bid);
|
|
369
369
|
|
|
@@ -377,7 +377,7 @@ const impToPrebidBid =
|
|
|
377
377
|
let prebidBid = {
|
|
378
378
|
ad: bid.adm,
|
|
379
379
|
adId: bid.adid,
|
|
380
|
-
adserverTargeting: targetingMap[
|
|
380
|
+
adserverTargeting: targetingMap[bidIndex],
|
|
381
381
|
adUnitCode: bidRequest.tagid,
|
|
382
382
|
bidderRequestId: bidderRequestBody.id,
|
|
383
383
|
bidId: bid.id,
|
|
@@ -408,6 +408,9 @@ const impToPrebidBid =
|
|
|
408
408
|
};
|
|
409
409
|
}
|
|
410
410
|
|
|
411
|
+
if (deepAccess(bid, 'ext.pa_win') === true) {
|
|
412
|
+
prebidBid.auctionWinner = true;
|
|
413
|
+
}
|
|
411
414
|
return prebidBid;
|
|
412
415
|
} catch (error) {
|
|
413
416
|
logError(`${BIDDER_CODE}: Error while building bid`, error);
|
|
@@ -429,29 +432,43 @@ function buildTargetingMap(bids) {
|
|
|
429
432
|
const values = impIds.reduce((result, id) => {
|
|
430
433
|
result[id] = {
|
|
431
434
|
lineItemIds: [],
|
|
435
|
+
orderIds: [],
|
|
432
436
|
dealIds: [],
|
|
433
437
|
adIds: [],
|
|
438
|
+
adAndOrderIndexes: []
|
|
434
439
|
};
|
|
435
440
|
|
|
436
441
|
return result;
|
|
437
442
|
}, {});
|
|
438
443
|
|
|
439
|
-
bids.forEach((bid) => {
|
|
440
|
-
|
|
441
|
-
values[
|
|
442
|
-
values[
|
|
444
|
+
bids.forEach((bid, bidIndex) => {
|
|
445
|
+
let impId = bid.impid;
|
|
446
|
+
values[impId].lineItemIds.push(bid.ext.liid);
|
|
447
|
+
values[impId].dealIds.push(bid.dealid);
|
|
448
|
+
values[impId].adIds.push(bid.adid);
|
|
449
|
+
|
|
450
|
+
if (deepAccess(bid, 'ext.ordid')) {
|
|
451
|
+
values[impId].orderIds.push(bid.ext.ordid);
|
|
452
|
+
bid.ext.ordid.split(TARGETING_VALUE_SEPARATOR).forEach((ordid, ordIndex) => {
|
|
453
|
+
let adIdIndex = values[impId].adIds.indexOf(bid.adid);
|
|
454
|
+
values[impId].adAndOrderIndexes.push(adIdIndex + '_' + ordIndex)
|
|
455
|
+
})
|
|
456
|
+
}
|
|
443
457
|
});
|
|
444
458
|
|
|
445
459
|
const targetingMap = {};
|
|
446
460
|
|
|
447
|
-
|
|
448
|
-
|
|
461
|
+
bids.forEach((bid, bidIndex) => {
|
|
462
|
+
let id = bid.impid;
|
|
463
|
+
|
|
464
|
+
targetingMap[bidIndex] = {
|
|
449
465
|
hb_liid_adbookpsp: values[id].lineItemIds.join(TARGETING_VALUE_SEPARATOR),
|
|
450
466
|
hb_deal_adbookpsp: values[id].dealIds.join(TARGETING_VALUE_SEPARATOR),
|
|
467
|
+
hb_ad_ord_adbookpsp: values[id].adAndOrderIndexes.join(TARGETING_VALUE_SEPARATOR),
|
|
451
468
|
hb_adid_c_adbookpsp: values[id].adIds.join(TARGETING_VALUE_SEPARATOR),
|
|
469
|
+
hb_ordid_adbookpsp: values[id].orderIds.join(TARGETING_VALUE_SEPARATOR),
|
|
452
470
|
};
|
|
453
|
-
}
|
|
454
|
-
|
|
471
|
+
})
|
|
455
472
|
return targetingMap;
|
|
456
473
|
}
|
|
457
474
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
2
|
-
import includes from '
|
|
2
|
+
import includes from 'prebidjs-polyfill/includes.js';
|
|
3
3
|
import { BANNER } from '../src/mediaTypes.js';
|
|
4
4
|
|
|
5
5
|
const VERSION = '1.0';
|
|
6
6
|
|
|
7
7
|
export const spec = {
|
|
8
8
|
code: 'adhash',
|
|
9
|
-
url: 'https://bidder.adhash.
|
|
9
|
+
url: 'https://bidder.adhash.com/rtb?version=' + VERSION + '&prebid=true',
|
|
10
10
|
supportedMediaTypes: [ BANNER ],
|
|
11
11
|
|
|
12
12
|
isBidRequestValid: (bid) => {
|
|
@@ -37,7 +37,7 @@ export const spec = {
|
|
|
37
37
|
var size = validBidRequests[i].sizes[index].join('x');
|
|
38
38
|
bidRequests.push({
|
|
39
39
|
method: 'POST',
|
|
40
|
-
url: url,
|
|
40
|
+
url: url + '&publisher=' + validBidRequests[i].params.publisherId,
|
|
41
41
|
bidRequest: validBidRequests[i],
|
|
42
42
|
data: {
|
|
43
43
|
timezone: new Date().getTimezoneOffset() / 60,
|
|
@@ -87,7 +87,7 @@ export const spec = {
|
|
|
87
87
|
cpm: responseBody.creatives[0].costEUR,
|
|
88
88
|
ad:
|
|
89
89
|
`<div id="${oneTimeId}"></div>
|
|
90
|
-
<script src="https://bidder.adhash.
|
|
90
|
+
<script src="https://bidder.adhash.com/static/scripts/creative.min.js"></script>
|
|
91
91
|
<script>callAdvertiser(${bidderResponse},['${oneTimeId}'],${requestData},${publisherURL})</script>`,
|
|
92
92
|
width: request.bidRequest.sizes[0][0],
|
|
93
93
|
height: request.bidRequest.sizes[0][1],
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
} from '../src/utils.js';
|
|
5
5
|
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
|
|
6
6
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
7
|
-
import find from '
|
|
8
|
-
import includes from '
|
|
7
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
8
|
+
import includes from 'prebidjs-polyfill/includes.js';
|
|
9
9
|
import {config} from '../src/config.js';
|
|
10
10
|
|
|
11
11
|
/*
|
|
@@ -10,7 +10,7 @@ import { loadExternalScript } from '../src/adloader.js';
|
|
|
10
10
|
import { auctionManager } from '../src/auctionManager.js';
|
|
11
11
|
import { AUCTION_COMPLETED } from '../src/auction.js';
|
|
12
12
|
import CONSTANTS from '../src/constants.json';
|
|
13
|
-
import find from '
|
|
13
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
14
14
|
import {
|
|
15
15
|
deepAccess, logInfo, isPlainObject, logError, isStr, isNumber, getGptSlotInfoForAdUnitCode,
|
|
16
16
|
isFn, mergeDeep, logMessage, insertElement, logWarn, getUniqueIdentifierStr, parseUrl
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getAdUnitSizes, logInfo, isPlainObject, logError, isStr, isInteger, isArray, isBoolean, mergeDeep, deepAccess,
|
|
21
21
|
_each, deepSetValue, logWarn, getGptSlotInfoForAdUnitCode
|
|
22
22
|
} from '../src/utils.js';
|
|
23
|
-
import includes from '
|
|
23
|
+
import includes from 'prebidjs-polyfill/includes.js';
|
|
24
24
|
|
|
25
25
|
const MODULE_NAME = 'adloox';
|
|
26
26
|
const MODULE = `${MODULE_NAME}RtdProvider`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
2
2
|
import { NATIVE, BANNER } from '../src/mediaTypes.js';
|
|
3
3
|
import { parseSizesInput, deepAccess, parseQueryStringParameters } from '../src/utils.js';
|
|
4
|
-
import includes from '
|
|
4
|
+
import includes from 'prebidjs-polyfill/includes.js';
|
|
5
5
|
|
|
6
6
|
const BIDDER_CODE = 'adnow';
|
|
7
7
|
const ENDPOINT = 'https://n.ads3-adnow.com/a';
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
|
|
2
|
+
import { submodule } from '../src/hook.js'
|
|
3
|
+
import { logError, logInfo } from '../src/utils.js'
|
|
4
|
+
import { ajax } from '../src/ajax.js';
|
|
5
|
+
|
|
6
|
+
import { config as sourceConfig } from '../src/config.js';
|
|
7
|
+
|
|
8
|
+
const GVLID = 855;
|
|
9
|
+
|
|
10
|
+
function init(config, userConsent) {
|
|
11
|
+
if (!config.params || !config.params.providers) return false
|
|
12
|
+
logInfo(userConsent)
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Make sure that ajax has a function as callback
|
|
17
|
+
function prepProvider(provider) {
|
|
18
|
+
// Map parameter to something that adnuntius endpoint understands.
|
|
19
|
+
const mappedParameters = {
|
|
20
|
+
siteId: 's',
|
|
21
|
+
userId: 'browserId',
|
|
22
|
+
browserId: 'browserId',
|
|
23
|
+
folderId: 'folderId'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const tzo = new Date().getTimezoneOffset();
|
|
27
|
+
const URL = ['https://data.adnuntius.com/usr?tzo=' + tzo]
|
|
28
|
+
Object.keys(provider).forEach(key => {
|
|
29
|
+
URL.push(`${mappedParameters[key]}=${provider[key]}`)
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
ajax(URL.join('&'), {
|
|
34
|
+
success: function (res) {
|
|
35
|
+
const response = JSON.parse(res)
|
|
36
|
+
resolve(response)
|
|
37
|
+
},
|
|
38
|
+
error: function (err) { reject(err) }
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function setGlobalConfig(config, segments) {
|
|
44
|
+
const ortbSegments = {
|
|
45
|
+
ortb2: {
|
|
46
|
+
user: {
|
|
47
|
+
data: [{
|
|
48
|
+
name: 'adnuntius',
|
|
49
|
+
segment: segments
|
|
50
|
+
}]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (config.params && config.params.bidders) {
|
|
55
|
+
sourceConfig.mergeBidderConfig({
|
|
56
|
+
bidders: config.params.bidders,
|
|
57
|
+
config: ortbSegments
|
|
58
|
+
})
|
|
59
|
+
} else {
|
|
60
|
+
sourceConfig.mergeConfig(ortbSegments)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function alterBidRequests(reqBidsConfigObj, callback, config, userConsent) {
|
|
65
|
+
const gdpr = userConsent && userConsent.gdpr;
|
|
66
|
+
let allowedToRun = true
|
|
67
|
+
if (gdpr) {
|
|
68
|
+
if (userConsent.gdpr.gdprApplies) {
|
|
69
|
+
if (gdpr.gdprApplies && !gdpr.vendorData.vendorConsents[GVLID]) allowedToRun = false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (allowedToRun) {
|
|
73
|
+
const providerRequests = config.params.providers.map(provider => prepProvider(provider))
|
|
74
|
+
|
|
75
|
+
Promise.allSettled(providerRequests).then((values) => {
|
|
76
|
+
const segments = values.reduce((segments, array) => (array.status === 'fulfilled') ? segments.concat(array.value.segments) : [], []).map(segmentId => ({ id: segmentId }))
|
|
77
|
+
setGlobalConfig(config, segments)
|
|
78
|
+
callback();
|
|
79
|
+
})
|
|
80
|
+
.catch(err => logError('ADN: err', err));
|
|
81
|
+
} else callback();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** @type {RtdSubmodule} */
|
|
85
|
+
export const adnuntiusSubmodule = {
|
|
86
|
+
name: 'adnuntius',
|
|
87
|
+
init: init,
|
|
88
|
+
getBidRequestData: alterBidRequests,
|
|
89
|
+
setGlobalConfig: setGlobalConfig,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export function beforeInit() {
|
|
93
|
+
submodule('realTimeData', adnuntiusSubmodule);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
beforeInit();
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
### Overview
|
|
2
|
+
|
|
3
|
+
The Adnuntius Real Time Data Provider will request segments from adnuntius data, based on what is defined in the realTimeData object. It uses the siteId and userId that a publisher provides. These will have to correspond to a previously uploaded user to Adnuntius Data.
|
|
4
|
+
|
|
5
|
+
### Integration
|
|
6
|
+
|
|
7
|
+
1. Build the adnuntiusRTD module into the Prebid.js package with:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
gulp build --modules=adnuntiusRtdProvider,...
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
2. Use `setConfig` to instruct Prebid.js to initilaize the adnuntiusRtdProvider module, as specified below.
|
|
14
|
+
|
|
15
|
+
### Configuration
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
var pbjs = pbjs || { que: [] }
|
|
19
|
+
pbjs.que.push(function () {
|
|
20
|
+
pbjs.setConfig({
|
|
21
|
+
realTimeData: {
|
|
22
|
+
auctionDelay: 300,
|
|
23
|
+
dataProviders: [
|
|
24
|
+
{
|
|
25
|
+
name: 'adnuntius',
|
|
26
|
+
waitForIt: true,
|
|
27
|
+
params: {
|
|
28
|
+
bidders: ['adnuntius'],
|
|
29
|
+
providers: [{
|
|
30
|
+
siteId: 'site123',
|
|
31
|
+
userId: 'user123'
|
|
32
|
+
}]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Please reach out to Adnuntius if you need more info about this: prebid@adnuntius.com
|
|
@@ -2,8 +2,8 @@ import adapter from '../src/AnalyticsAdapter.js';
|
|
|
2
2
|
import CONSTANTS from '../src/constants.json';
|
|
3
3
|
import adapterManager from '../src/adapterManager.js';
|
|
4
4
|
import { logInfo } from '../src/utils.js';
|
|
5
|
-
import find from '
|
|
6
|
-
import findIndex from '
|
|
5
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
6
|
+
import findIndex from 'prebidjs-polyfill/findIndex.js';
|
|
7
7
|
|
|
8
8
|
// Events used in adomik analytics adapter
|
|
9
9
|
const auctionInit = CONSTANTS.EVENTS.AUCTION_INIT;
|
|
@@ -2,7 +2,7 @@ import {Renderer} from '../src/Renderer.js';
|
|
|
2
2
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
3
3
|
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
|
|
4
4
|
import {isStr, isArray, isNumber, isPlainObject, isBoolean, logError, replaceAuctionPrice} from '../src/utils.js';
|
|
5
|
-
import find from '
|
|
5
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
6
6
|
import { config } from '../src/config.js';
|
|
7
7
|
|
|
8
8
|
const ADAPTER_VERSION = 'v1.0.0';
|
package/modules/adpod.js
CHANGED
|
@@ -23,12 +23,11 @@ import { setupBeforeHookFnOnce, module } from '../src/hook.js';
|
|
|
23
23
|
import { store } from '../src/videoCache.js';
|
|
24
24
|
import { config } from '../src/config.js';
|
|
25
25
|
import { ADPOD } from '../src/mediaTypes.js';
|
|
26
|
-
import
|
|
27
|
-
import find from 'core-js-pure/features/array/find.js';
|
|
26
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
28
27
|
import { auctionManager } from '../src/auctionManager.js';
|
|
29
28
|
import CONSTANTS from '../src/constants.json';
|
|
30
29
|
|
|
31
|
-
const from = require('
|
|
30
|
+
const from = require('prebidjs-polyfill/arrayFrom.js');
|
|
32
31
|
|
|
33
32
|
const TARGETING_KEY_PB_CAT_DUR = 'hb_pb_cat_dur';
|
|
34
33
|
const TARGETING_KEY_CACHE_ID = 'hb_cache_id';
|
|
@@ -122,7 +121,7 @@ function getPricePartForAdpodKey(bid) {
|
|
|
122
121
|
const adpodDealPrefix = config.getConfig(`adpod.dealTier.${bid.bidderCode}.prefix`);
|
|
123
122
|
pricePart = (adpodDealPrefix) ? adpodDealPrefix + deepAccess(bid, 'video.dealTier') : deepAccess(bid, 'video.dealTier');
|
|
124
123
|
} else {
|
|
125
|
-
const granularity = getPriceGranularity(bid
|
|
124
|
+
const granularity = getPriceGranularity(bid);
|
|
126
125
|
pricePart = getPriceByGranularity(granularity)(bid);
|
|
127
126
|
}
|
|
128
127
|
return pricePart
|
|
@@ -223,10 +222,9 @@ function firePrebidCacheCall(auctionInstance, bidList, afterBidAdded) {
|
|
|
223
222
|
* @param {*} auctionInstance running context of the auction
|
|
224
223
|
* @param {Object} bidResponse incoming bid; if adpod, will be processed through hook function. If not adpod, returns to original function.
|
|
225
224
|
* @param {Function} afterBidAdded callback function used when Prebid Cache responds
|
|
226
|
-
* @param {Object}
|
|
225
|
+
* @param {Object} videoConfig mediaTypes.video from the bid's adUnit
|
|
227
226
|
*/
|
|
228
|
-
export function callPrebidCacheHook(fn, auctionInstance, bidResponse, afterBidAdded,
|
|
229
|
-
let videoConfig = deepAccess(bidderRequest, 'mediaTypes.video');
|
|
227
|
+
export function callPrebidCacheHook(fn, auctionInstance, bidResponse, afterBidAdded, videoConfig) {
|
|
230
228
|
if (videoConfig && videoConfig.context === ADPOD) {
|
|
231
229
|
let brandCategoryExclusion = config.getConfig('adpod.brandCategoryExclusion');
|
|
232
230
|
let adServerCatId = deepAccess(bidResponse, 'meta.adServerCatId');
|
|
@@ -250,7 +248,7 @@ export function callPrebidCacheHook(fn, auctionInstance, bidResponse, afterBidAd
|
|
|
250
248
|
}
|
|
251
249
|
}
|
|
252
250
|
} else {
|
|
253
|
-
fn.call(this, auctionInstance, bidResponse, afterBidAdded,
|
|
251
|
+
fn.call(this, auctionInstance, bidResponse, afterBidAdded, videoConfig);
|
|
254
252
|
}
|
|
255
253
|
}
|
|
256
254
|
|
|
@@ -310,18 +308,17 @@ export function checkAdUnitSetupHook(fn, adUnits) {
|
|
|
310
308
|
* (eg if range was [5, 15, 30] -> 2s is rounded to 5s; 17s is rounded back to 15s; 18s is rounded up to 30s)
|
|
311
309
|
* - if the bid is above the range of the listed durations (and outside the buffer), reject the bid
|
|
312
310
|
* - set the rounded duration value in the `bid.video.durationBucket` field for accepted bids
|
|
313
|
-
* @param {Object}
|
|
311
|
+
* @param {Object} videoMediaType 'mediaTypes.video' associated to bidResponse
|
|
314
312
|
* @param {Object} bidResponse incoming bidResponse being evaluated by bidderFactory
|
|
315
313
|
* @returns {boolean} return false if bid duration is deemed invalid as per adUnit configuration; return true if fine
|
|
316
314
|
*/
|
|
317
|
-
function checkBidDuration(
|
|
315
|
+
function checkBidDuration(videoMediaType, bidResponse) {
|
|
318
316
|
const buffer = 2;
|
|
319
317
|
let bidDuration = deepAccess(bidResponse, 'video.durationSeconds');
|
|
320
|
-
let
|
|
321
|
-
let adUnitRanges = videoConfig.durationRangeSec;
|
|
318
|
+
let adUnitRanges = videoMediaType.durationRangeSec;
|
|
322
319
|
adUnitRanges.sort((a, b) => a - b); // ensure the ranges are sorted in numeric order
|
|
323
320
|
|
|
324
|
-
if (!
|
|
321
|
+
if (!videoMediaType.requireExactDuration) {
|
|
325
322
|
let max = Math.max(...adUnitRanges);
|
|
326
323
|
if (bidDuration <= (max + buffer)) {
|
|
327
324
|
let nextHighestRange = find(adUnitRanges, range => (range + buffer) >= bidDuration);
|
|
@@ -346,12 +343,12 @@ function checkBidDuration(bidderRequest, bidResponse) {
|
|
|
346
343
|
* If it's found to not be an adpod bid, it will return to original function via hook logic
|
|
347
344
|
* @param {Function} fn reference to original function (used by hook logic)
|
|
348
345
|
* @param {Object} bid incoming bid object
|
|
349
|
-
* @param {Object}
|
|
346
|
+
* @param {Object} adUnit adUnit object of associated bid
|
|
350
347
|
* @param {Object} videoMediaType copy of the `bidRequest.mediaTypes.video` object; used in original function
|
|
351
348
|
* @param {String} context value of the `bidRequest.mediaTypes.video.context` field; used in original function
|
|
352
349
|
* @returns {boolean} this return is only used for adpod bids
|
|
353
350
|
*/
|
|
354
|
-
export function checkVideoBidSetupHook(fn, bid,
|
|
351
|
+
export function checkVideoBidSetupHook(fn, bid, adUnit, videoMediaType, context) {
|
|
355
352
|
if (context === ADPOD) {
|
|
356
353
|
let result = true;
|
|
357
354
|
let brandCategoryExclusion = config.getConfig('adpod.brandCategoryExclusion');
|
|
@@ -367,7 +364,7 @@ export function checkVideoBidSetupHook(fn, bid, bidRequest, videoMediaType, cont
|
|
|
367
364
|
if (!deepAccess(bid, 'video.durationSeconds') || bid.video.durationSeconds <= 0) {
|
|
368
365
|
result = false;
|
|
369
366
|
} else {
|
|
370
|
-
let isBidGood = checkBidDuration(
|
|
367
|
+
let isBidGood = checkBidDuration(videoMediaType, bid);
|
|
371
368
|
if (!isBidGood) result = false;
|
|
372
369
|
}
|
|
373
370
|
}
|
|
@@ -382,7 +379,7 @@ export function checkVideoBidSetupHook(fn, bid, bidRequest, videoMediaType, cont
|
|
|
382
379
|
|
|
383
380
|
fn.bail(result);
|
|
384
381
|
} else {
|
|
385
|
-
fn.call(this, bid,
|
|
382
|
+
fn.call(this, bid, adUnit, videoMediaType, context);
|
|
386
383
|
}
|
|
387
384
|
}
|
|
388
385
|
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
import { config } from '../src/config.js';
|
|
7
7
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
8
8
|
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
9
|
-
import find from '
|
|
10
|
-
import includes from '
|
|
9
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
10
|
+
import includes from 'prebidjs-polyfill/includes.js';
|
|
11
11
|
import { OUTSTREAM, INSTREAM } from '../src/video.js';
|
|
12
12
|
|
|
13
13
|
const BIDDER_CODE = 'adrelevantis';
|
|
@@ -2,7 +2,7 @@ import { deepAccess, isArray, chunk, _map, flatten, logError, parseSizesInput }
|
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
3
|
import { BANNER, VIDEO } from '../src/mediaTypes.js';
|
|
4
4
|
import { config } from '../src/config.js';
|
|
5
|
-
import find from '
|
|
5
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
6
6
|
|
|
7
7
|
const ENDPOINT = 'https://ghb.console.adtarget.com.tr/v2/auction/';
|
|
8
8
|
const BIDDER_CODE = 'adtarget';
|
|
@@ -3,7 +3,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
|
3
3
|
import { ADPOD, BANNER, VIDEO } from '../src/mediaTypes.js';
|
|
4
4
|
import { config } from '../src/config.js';
|
|
5
5
|
import { Renderer } from '../src/Renderer.js';
|
|
6
|
-
import find from '
|
|
6
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
7
7
|
|
|
8
8
|
const subdomainSuffixes = ['', 1, 2];
|
|
9
9
|
const AUCTION_PATH = '/v2/auction/';
|
|
@@ -2,8 +2,8 @@ import { isEmpty, deepAccess, isFn, parseSizesInput, generateUUID, parseUrl } fr
|
|
|
2
2
|
import { config } from '../src/config.js';
|
|
3
3
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
4
4
|
import { VIDEO, BANNER } from '../src/mediaTypes.js';
|
|
5
|
-
import find from '
|
|
6
|
-
import includes from '
|
|
5
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
6
|
+
import includes from 'prebidjs-polyfill/includes.js';
|
|
7
7
|
|
|
8
8
|
const ADAPTER_VERSION = '1.0';
|
|
9
9
|
const BIDDER_CODE = 'advangelists';
|
|
@@ -3,7 +3,7 @@ import { ajax } from '../src/ajax.js';
|
|
|
3
3
|
import adapter from '../src/AnalyticsAdapter.js';
|
|
4
4
|
import adapterManager from '../src/adapterManager.js';
|
|
5
5
|
import CONSTANTS from '../src/constants.json';
|
|
6
|
-
import includes from '
|
|
6
|
+
import includes from 'prebidjs-polyfill/includes.js';
|
|
7
7
|
|
|
8
8
|
const analyticsType = 'endpoint';
|
|
9
9
|
const defaultUrl = 'https://adxpremium.services/graphql';
|
|
@@ -2,7 +2,7 @@ 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
4
|
import { createEidsArray } from './userId/eids.js';
|
|
5
|
-
import find from '
|
|
5
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
6
6
|
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
|
|
7
7
|
|
|
8
8
|
const VERSION = '1.0';
|
package/modules/afpBidAdapter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import includes from '
|
|
1
|
+
import includes from 'prebidjs-polyfill/includes.js'
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js'
|
|
3
3
|
import { Renderer } from '../src/Renderer.js'
|
|
4
4
|
import { BANNER, VIDEO } from '../src/mediaTypes.js'
|
|
@@ -1,13 +1,14 @@
|
|
|
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
|
|
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';
|
|
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';
|
|
5
5
|
import { BANNER, NATIVE, VIDEO, ADPOD } from '../src/mediaTypes.js';
|
|
6
6
|
import { auctionManager } from '../src/auctionManager.js';
|
|
7
|
-
import find from '
|
|
8
|
-
import includes from '
|
|
7
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
8
|
+
import includes from 'prebidjs-polyfill/includes.js';
|
|
9
9
|
import { OUTSTREAM, INSTREAM } from '../src/video.js';
|
|
10
10
|
import { getStorageManager } from '../src/storageManager.js';
|
|
11
|
+
import { bidderSettings } from '../src/bidderSettings.js';
|
|
11
12
|
|
|
12
13
|
const BIDDER_CODE = 'appnexus';
|
|
13
14
|
const URL = 'https://ib.adnxs.com/ut/v3/prebid';
|
|
@@ -201,6 +202,17 @@ export const spec = {
|
|
|
201
202
|
payload.app = appIdObj;
|
|
202
203
|
}
|
|
203
204
|
|
|
205
|
+
let auctionKeywords = config.getConfig('appnexusAuctionKeywords');
|
|
206
|
+
if (isPlainObject(auctionKeywords)) {
|
|
207
|
+
let aucKeywords = transformBidderParamKeywords(auctionKeywords);
|
|
208
|
+
|
|
209
|
+
if (aucKeywords.length > 0) {
|
|
210
|
+
aucKeywords.forEach(deleteValues);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
payload.keywords = aucKeywords;
|
|
214
|
+
}
|
|
215
|
+
|
|
204
216
|
if (config.getConfig('adpod.brandCategoryExclusion')) {
|
|
205
217
|
payload.brand_category_uniqueness = true;
|
|
206
218
|
}
|
|
@@ -292,7 +304,7 @@ export const spec = {
|
|
|
292
304
|
serverResponse.tags.forEach(serverBid => {
|
|
293
305
|
const rtbBid = getRtbBid(serverBid);
|
|
294
306
|
if (rtbBid) {
|
|
295
|
-
const cpmCheck = (
|
|
307
|
+
const cpmCheck = (bidderSettings.get(bidderRequest.bidderCode, 'allowZeroCpmBids') === true) ? rtbBid.cpm >= 0 : rtbBid.cpm > 0;
|
|
296
308
|
if (cpmCheck && includes(this.supportedMediaTypes, rtbBid.ad_type)) {
|
|
297
309
|
const bid = newBid(serverBid, rtbBid, bidderRequest);
|
|
298
310
|
bid.mediaType = parseMediaType(rtbBid);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
2
|
+
import { BANNER } from '../src/mediaTypes.js';
|
|
3
|
+
import { config } from '../src/config.js';
|
|
4
|
+
|
|
5
|
+
export const BIDDER_CODE = 'aseal';
|
|
6
|
+
const SUPPORTED_AD_TYPES = [BANNER];
|
|
7
|
+
export const API_ENDPOINT = 'https://tkprebid.aotter.net/prebid/adapter';
|
|
8
|
+
export const HEADER_AOTTER_VERSION = 'prebid_0.0.1';
|
|
9
|
+
|
|
10
|
+
export const spec = {
|
|
11
|
+
code: BIDDER_CODE,
|
|
12
|
+
aliases: ['aotter', 'trek'],
|
|
13
|
+
supportedMediaTypes: SUPPORTED_AD_TYPES,
|
|
14
|
+
|
|
15
|
+
isBidRequestValid: (bid) => !!bid.params.placeUid && typeof bid.params.placeUid === 'string',
|
|
16
|
+
|
|
17
|
+
buildRequests: (validBidRequests, bidderRequest) => {
|
|
18
|
+
if (validBidRequests.length === 0) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const clientId =
|
|
23
|
+
config.getConfig('aseal.clientId') || '';
|
|
24
|
+
|
|
25
|
+
const data = {
|
|
26
|
+
bids: validBidRequests,
|
|
27
|
+
refererInfo: bidderRequest.refererInfo,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const options = {
|
|
31
|
+
contentType: 'application/json',
|
|
32
|
+
withCredentials: true,
|
|
33
|
+
customHeaders: {
|
|
34
|
+
'x-aotter-clientid': clientId,
|
|
35
|
+
'x-aotter-version': HEADER_AOTTER_VERSION,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return [{
|
|
40
|
+
method: 'POST',
|
|
41
|
+
url: API_ENDPOINT,
|
|
42
|
+
data,
|
|
43
|
+
options,
|
|
44
|
+
}];
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
interpretResponse: (serverResponse, bidRequest) => {
|
|
48
|
+
if (!Array.isArray(serverResponse.body)) {
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const bidResponses = serverResponse.body;
|
|
53
|
+
|
|
54
|
+
return bidResponses;
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
registerBidder(spec);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
Module Name: Aseal Bid Adapter
|
|
5
|
+
Module Type: Bidder Adapter
|
|
6
|
+
Maintainer: tech-service@aotter.net
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
# Description
|
|
10
|
+
|
|
11
|
+
Module that connects to Aseal server for bids.
|
|
12
|
+
Supported Ad Formats:
|
|
13
|
+
|
|
14
|
+
- Banner
|
|
15
|
+
|
|
16
|
+
# Configuration
|
|
17
|
+
|
|
18
|
+
Following configuration is required:
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
pbjs.setConfig({
|
|
22
|
+
aseal: {
|
|
23
|
+
clientId: "YOUR_CLIENT_ID"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
# Ad Unit Example
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
var adUnits = [
|
|
32
|
+
{
|
|
33
|
+
code: "banner-div",
|
|
34
|
+
mediaTypes: {
|
|
35
|
+
banner: {
|
|
36
|
+
sizes: [
|
|
37
|
+
[300, 250],
|
|
38
|
+
[300, 600]
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
bids: [
|
|
43
|
+
{
|
|
44
|
+
bidder: "aseal",
|
|
45
|
+
params: {
|
|
46
|
+
placeUid: "f4a74f73-9a74-4a87-91c9-545c6316c23d"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
```
|