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
|
@@ -152,10 +152,10 @@ export const spec = {
|
|
|
152
152
|
|
|
153
153
|
const { seatbid, cur } = serverResponse.body;
|
|
154
154
|
|
|
155
|
-
const bidResponses = flatten(seatbid.map(seat => seat.bid)).reduce((result, bid) => {
|
|
155
|
+
const bidResponses = (typeof seatbid != 'undefined') ? flatten(seatbid.map(seat => seat.bid)).reduce((result, bid) => {
|
|
156
156
|
result[bid.impid - 1] = bid;
|
|
157
157
|
return result;
|
|
158
|
-
}, []);
|
|
158
|
+
}, []) : [];
|
|
159
159
|
|
|
160
160
|
return bids
|
|
161
161
|
.map((bid, id) => {
|
|
@@ -167,7 +167,7 @@ export const spec = {
|
|
|
167
167
|
cpm: bidResponse.price,
|
|
168
168
|
creativeId: bidResponse.crid,
|
|
169
169
|
ttl: 1000,
|
|
170
|
-
netRevenue: bid.netRevenue === 'net',
|
|
170
|
+
netRevenue: (!bid.netRevenue || bid.netRevenue === 'net'),
|
|
171
171
|
currency: cur,
|
|
172
172
|
mediaType: NATIVE,
|
|
173
173
|
bidderCode: BIDDER_CODE,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { deepAccess, generateUUID, inIframe } 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';
|
|
5
5
|
import { createEidsArray } from './userId/eids.js';
|
|
6
6
|
|
|
7
|
-
const VERSION = '4.0
|
|
7
|
+
const VERSION = '4.1.0';
|
|
8
8
|
const BIDDER_CODE = 'sharethrough';
|
|
9
9
|
const SUPPLY_ID = 'WYu2BXv1';
|
|
10
10
|
|
|
@@ -23,6 +23,7 @@ export const sharethroughAdapterSpec = {
|
|
|
23
23
|
|
|
24
24
|
buildRequests: (bidRequests, bidderRequest) => {
|
|
25
25
|
const timeout = config.getConfig('bidderTimeout');
|
|
26
|
+
const firstPartyData = config.getConfig('ortb2') || {};
|
|
26
27
|
|
|
27
28
|
const nonHttp = sharethroughInternal.getProtocol().indexOf('http') < 0;
|
|
28
29
|
const secure = nonHttp || (sharethroughInternal.getProtocol().indexOf('https') > -1);
|
|
@@ -35,12 +36,8 @@ export const sharethroughAdapterSpec = {
|
|
|
35
36
|
site: {
|
|
36
37
|
domain: window.location.hostname,
|
|
37
38
|
page: window.location.href,
|
|
38
|
-
ref: bidderRequest
|
|
39
|
-
|
|
40
|
-
user: {
|
|
41
|
-
ext: {
|
|
42
|
-
eids: userIdAsEids(bidRequests[0]),
|
|
43
|
-
},
|
|
39
|
+
ref: deepAccess(bidderRequest, 'refererInfo.referer'),
|
|
40
|
+
...firstPartyData.site,
|
|
44
41
|
},
|
|
45
42
|
device: {
|
|
46
43
|
ua: navigator.userAgent,
|
|
@@ -66,6 +63,10 @@ export const sharethroughAdapterSpec = {
|
|
|
66
63
|
test: 0,
|
|
67
64
|
};
|
|
68
65
|
|
|
66
|
+
req.user = nullish(firstPartyData.user, {});
|
|
67
|
+
if (!req.user.ext) req.user.ext = {};
|
|
68
|
+
req.user.ext.eids = userIdAsEids(bidRequests[0]);
|
|
69
|
+
|
|
69
70
|
if (bidderRequest.gdprConsent) {
|
|
70
71
|
const gdprApplies = bidderRequest.gdprConsent.gdprApplies === true;
|
|
71
72
|
req.regs.ext.gdpr = gdprApplies ? 1 : 0;
|
|
@@ -86,15 +87,9 @@ export const sharethroughAdapterSpec = {
|
|
|
86
87
|
impression.ext = { gpid: gpid };
|
|
87
88
|
}
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
if (bidReq.mediaTypes && bidReq.mediaTypes.video && bidReq.mediaTypes.video.context === 'outstream') {
|
|
91
|
-
// return null so we can easily remove this imp from the array of imps that we send to adserver
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (bidReq.mediaTypes && bidReq.mediaTypes.video) {
|
|
96
|
-
const videoRequest = bidReq.mediaTypes.video;
|
|
90
|
+
const videoRequest = deepAccess(bidReq, 'mediaTypes.video');
|
|
97
91
|
|
|
92
|
+
if (videoRequest) {
|
|
98
93
|
// default playerSize, only change this if we know width and height are properly defined in the request
|
|
99
94
|
let [w, h] = [640, 360];
|
|
100
95
|
if (videoRequest.playerSize && videoRequest.playerSize[0] && videoRequest.playerSize[1]) {
|
|
@@ -117,9 +112,9 @@ export const sharethroughAdapterSpec = {
|
|
|
117
112
|
startdelay: nullish(videoRequest.startdelay, 0),
|
|
118
113
|
skipmin: nullish(videoRequest.skipmin, 0),
|
|
119
114
|
skipafter: nullish(videoRequest.skipafter, 0),
|
|
115
|
+
placement: videoRequest.context === 'instream' ? 1 : +deepAccess(videoRequest, 'placement', 4),
|
|
120
116
|
};
|
|
121
117
|
|
|
122
|
-
if (videoRequest.placement) impression.video.placement = videoRequest.placement;
|
|
123
118
|
if (videoRequest.delivery) impression.video.delivery = videoRequest.delivery;
|
|
124
119
|
if (videoRequest.companiontype) impression.video.companiontype = videoRequest.companiontype;
|
|
125
120
|
if (videoRequest.companionad) impression.video.companionad = videoRequest.companionad;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Sigmoid Analytics Adapter for prebid.js v1.1.0-pre
|
|
2
2
|
Updated : 2018-03-28 */
|
|
3
|
-
import includes from '
|
|
3
|
+
import includes from 'prebidjs-polyfill/includes.js';
|
|
4
4
|
import adapter from '../src/AnalyticsAdapter.js';
|
|
5
5
|
import CONSTANTS from '../src/constants.json';
|
|
6
6
|
import adapterManager from '../src/adapterManager.js';
|
|
@@ -10,7 +10,7 @@ import {getGlobal} from '../src/prebidGlobal.js';
|
|
|
10
10
|
import { deepAccess, logError, deepEqual, deepSetValue, isEmpty, mergeDeep } from '../src/utils.js';
|
|
11
11
|
import {submodule} from '../src/hook.js';
|
|
12
12
|
import {ajax} from '../src/ajax.js';
|
|
13
|
-
import findIndex from '
|
|
13
|
+
import findIndex from 'prebidjs-polyfill/findIndex.js';
|
|
14
14
|
import { getRefererInfo } from '../src/refererDetection.js';
|
|
15
15
|
import { config } from '../src/config.js';
|
|
16
16
|
|
package/modules/sizeMappingV2.js
CHANGED
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { isArray, logError, isArrayOfNums, deepClone, logWarn, getWindowTop, deepEqual, logInfo, isValidMediaTypes, deepAccess, getDefinedParams, getUniqueIdentifierStr, flatten } from '../src/utils.js';
|
|
8
|
-
import { processNativeAdUnitParams } from '../src/native.js';
|
|
9
8
|
import { adunitCounter } from '../src/adUnits.js';
|
|
10
|
-
import includes from '
|
|
9
|
+
import includes from 'prebidjs-polyfill/includes.js';
|
|
11
10
|
import { getHook } from '../src/hook.js';
|
|
12
11
|
import { adUnitSetupChecks } from '../src/prebid.js';
|
|
13
12
|
|
|
@@ -536,14 +535,8 @@ export function getBids({ bidderCode, auctionId, bidderRequestId, adUnits, label
|
|
|
536
535
|
.reduce((bids, bid) => {
|
|
537
536
|
if (internal.isLabelActivated(bid, labels, adUnit.code, adUnitInstance)) {
|
|
538
537
|
// handle native params
|
|
539
|
-
const nativeParams = adUnit.nativeParams || deepAccess(adUnit, 'mediaTypes.native');
|
|
540
|
-
if (nativeParams) {
|
|
541
|
-
bid = Object.assign({}, bid, {
|
|
542
|
-
nativeParams: processNativeAdUnitParams(nativeParams)
|
|
543
|
-
});
|
|
544
|
-
}
|
|
545
538
|
|
|
546
|
-
bid = Object.assign({}, bid, getDefinedParams(adUnit, ['mediaType', 'renderer']));
|
|
539
|
+
bid = Object.assign({}, bid, getDefinedParams(adUnit, ['mediaType', 'renderer', 'nativeParams']));
|
|
547
540
|
|
|
548
541
|
if (bid.sizeConfig) {
|
|
549
542
|
const relevantMediaTypes = internal.getRelevantMediaTypesForBidder(bid.sizeConfig, activeViewport);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
2
2
|
import { BANNER } from '../src/mediaTypes.js';
|
|
3
|
-
import find from '
|
|
3
|
+
import find from 'prebidjs-polyfill/find.js';
|
|
4
4
|
|
|
5
5
|
const SMARTICO_CONFIG = {
|
|
6
6
|
bidRequestUrl: 'https://trmads.eu/preBidRequest',
|
|
@@ -5,6 +5,7 @@ import adapterManager from '../src/adapterManager.js';
|
|
|
5
5
|
import {ajax} from '../src/ajax.js';
|
|
6
6
|
import {getGlobal} from '../src/prebidGlobal.js';
|
|
7
7
|
import { config } from '../src/config.js';
|
|
8
|
+
import {bidderSettings} from '../src/bidderSettings.js';
|
|
8
9
|
|
|
9
10
|
const DEFAULT_PROTOCOL = 'https';
|
|
10
11
|
const DEFAULT_HOST = 'pa.deployads.com';
|
|
@@ -182,11 +183,11 @@ function getFactor(bidder) {
|
|
|
182
183
|
}
|
|
183
184
|
|
|
184
185
|
function getBiddersFactors() {
|
|
185
|
-
const pb = getGlobal();
|
|
186
186
|
const result = {};
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
187
|
+
const settings = bidderSettings.getSettings();
|
|
188
|
+
if (settings) {
|
|
189
|
+
Object.keys(settings).forEach(bidderKey => {
|
|
190
|
+
const bidder = settings[bidderKey];
|
|
190
191
|
const factor = getFactor(bidder);
|
|
191
192
|
if (factor !== null) {
|
|
192
193
|
result[bidderKey] = factor;
|
|
@@ -4,8 +4,8 @@ import adaptermanager from '../src/adapterManager.js'
|
|
|
4
4
|
import CONSTANTS from '../src/constants.json'
|
|
5
5
|
import {ajaxBuilder} from '../src/ajax.js'
|
|
6
6
|
import {config} from '../src/config.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
|
|
|
10
10
|
const ajax = ajaxBuilder(0)
|
|
11
11
|
|
|
@@ -1,12 +1,38 @@
|
|
|
1
|
-
import { _each, getBidIdParameter, isArray, deepClone, parseUrl, getUniqueIdentifierStr, deepSetValue, logError, deepAccess } from '../src/utils.js';
|
|
1
|
+
import { _each, getBidIdParameter, isArray, deepClone, parseUrl, getUniqueIdentifierStr, deepSetValue, logError, deepAccess, isInteger, logWarn } from '../src/utils.js';
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js'
|
|
3
|
-
import { BANNER } from '../src/mediaTypes.js'
|
|
3
|
+
import { ADPOD, BANNER, VIDEO } from '../src/mediaTypes.js'
|
|
4
4
|
import { createEidsArray } from './userId/eids.js';
|
|
5
5
|
import {config} from '../src/config.js';
|
|
6
6
|
|
|
7
|
+
const ORTB_VIDEO_PARAMS = {
|
|
8
|
+
'mimes': (value) => Array.isArray(value) && value.length > 0 && value.every(v => typeof v === 'string'),
|
|
9
|
+
'minduration': (value) => isInteger(value),
|
|
10
|
+
'maxduration': (value) => isInteger(value),
|
|
11
|
+
'protocols': (value) => Array.isArray(value) && value.every(v => v >= 1 && v <= 10),
|
|
12
|
+
'w': (value) => isInteger(value),
|
|
13
|
+
'h': (value) => isInteger(value),
|
|
14
|
+
'startdelay': (value) => isInteger(value),
|
|
15
|
+
'placement': (value) => Array.isArray(value) && value.every(v => v >= 1 && v <= 5),
|
|
16
|
+
'linearity': (value) => [1, 2].indexOf(value) !== -1,
|
|
17
|
+
'skip': (value) => [0, 1].indexOf(value) !== -1,
|
|
18
|
+
'skipmin': (value) => isInteger(value),
|
|
19
|
+
'skipafter': (value) => isInteger(value),
|
|
20
|
+
'sequence': (value) => isInteger(value),
|
|
21
|
+
'battr': (value) => Array.isArray(value) && value.every(v => v >= 1 && v <= 17),
|
|
22
|
+
'maxextended': (value) => isInteger(value),
|
|
23
|
+
'minbitrate': (value) => isInteger(value),
|
|
24
|
+
'maxbitrate': (value) => isInteger(value),
|
|
25
|
+
'boxingallowed': (value) => [0, 1].indexOf(value) !== -1,
|
|
26
|
+
'playbackmethod': (value) => Array.isArray(value) && value.every(v => v >= 1 && v <= 6),
|
|
27
|
+
'playbackend': (value) => [1, 2, 3].indexOf(value) !== -1,
|
|
28
|
+
'delivery': (value) => [1, 2, 3].indexOf(value) !== -1,
|
|
29
|
+
'pos': (value) => Array.isArray(value) && value.every(v => v >= 0 && v <= 7),
|
|
30
|
+
'api': (value) => Array.isArray(value) && value.every(v => v >= 1 && v <= 6)
|
|
31
|
+
}
|
|
32
|
+
|
|
7
33
|
export const spec = {
|
|
8
34
|
code: 'sovrn',
|
|
9
|
-
supportedMediaTypes: [BANNER],
|
|
35
|
+
supportedMediaTypes: [BANNER, VIDEO],
|
|
10
36
|
gvlid: 13,
|
|
11
37
|
|
|
12
38
|
/**
|
|
@@ -15,7 +41,12 @@ export const spec = {
|
|
|
15
41
|
* @return boolean for whether or not a bid is valid
|
|
16
42
|
*/
|
|
17
43
|
isBidRequestValid: function(bid) {
|
|
18
|
-
return !!(
|
|
44
|
+
return !!(
|
|
45
|
+
bid.params.tagid &&
|
|
46
|
+
!isNaN(parseFloat(bid.params.tagid)) &&
|
|
47
|
+
isFinite(bid.params.tagid) &&
|
|
48
|
+
deepAccess(bid, 'mediaTypes.video.context') !== ADPOD
|
|
49
|
+
)
|
|
19
50
|
},
|
|
20
51
|
|
|
21
52
|
/**
|
|
@@ -50,13 +81,9 @@ export const spec = {
|
|
|
50
81
|
}
|
|
51
82
|
iv = iv || getBidIdParameter('iv', bid.params)
|
|
52
83
|
|
|
53
|
-
let bidSizes = (bid.mediaTypes && bid.mediaTypes.banner && bid.mediaTypes.banner.sizes) || bid.sizes
|
|
54
|
-
bidSizes = ((isArray(bidSizes) && isArray(bidSizes[0])) ? bidSizes : [bidSizes])
|
|
55
|
-
bidSizes = bidSizes.filter(size => isArray(size))
|
|
56
|
-
const processedSizes = bidSizes.map(size => ({w: parseInt(size[0], 10), h: parseInt(size[1], 10)}))
|
|
57
84
|
const floorInfo = (bid.getFloor && typeof bid.getFloor === 'function') ? bid.getFloor({
|
|
58
85
|
currency: 'USD',
|
|
59
|
-
mediaType: 'banner',
|
|
86
|
+
mediaType: bid.mediaTypes && bid.mediaTypes.banner ? 'banner' : 'video',
|
|
60
87
|
size: '*'
|
|
61
88
|
}) : {}
|
|
62
89
|
floorInfo.floor = floorInfo.floor || getBidIdParameter('bidfloor', bid.params)
|
|
@@ -64,13 +91,24 @@ export const spec = {
|
|
|
64
91
|
const imp = {
|
|
65
92
|
adunitcode: bid.adUnitCode,
|
|
66
93
|
id: bid.bidId,
|
|
67
|
-
|
|
94
|
+
tagid: String(getBidIdParameter('tagid', bid.params)),
|
|
95
|
+
bidfloor: floorInfo.floor
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (deepAccess(bid, 'mediaTypes.banner')) {
|
|
99
|
+
let bidSizes = deepAccess(bid, 'mediaTypes.banner.sizes') || bid.sizes
|
|
100
|
+
bidSizes = (isArray(bidSizes) && isArray(bidSizes[0])) ? bidSizes : [bidSizes]
|
|
101
|
+
bidSizes = bidSizes.filter(size => isArray(size))
|
|
102
|
+
const processedSizes = bidSizes.map(size => ({w: parseInt(size[0], 10), h: parseInt(size[1], 10)}))
|
|
103
|
+
|
|
104
|
+
imp.banner = {
|
|
68
105
|
format: processedSizes,
|
|
69
106
|
w: 1,
|
|
70
107
|
h: 1,
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
if (deepAccess(bid, 'mediaTypes.video')) {
|
|
111
|
+
imp.video = _buildVideoRequestObj(bid);
|
|
74
112
|
}
|
|
75
113
|
|
|
76
114
|
imp.ext = getBidIdParameter('ext', bid.ortb2Imp) || undefined
|
|
@@ -149,7 +187,7 @@ export const spec = {
|
|
|
149
187
|
seatbid[0].bid &&
|
|
150
188
|
seatbid[0].bid.length > 0) {
|
|
151
189
|
seatbid[0].bid.map(sovrnBid => {
|
|
152
|
-
|
|
190
|
+
const bid = {
|
|
153
191
|
requestId: sovrnBid.impid,
|
|
154
192
|
cpm: parseFloat(sovrnBid.price),
|
|
155
193
|
width: parseInt(sovrnBid.w),
|
|
@@ -158,11 +196,18 @@ export const spec = {
|
|
|
158
196
|
dealId: sovrnBid.dealid || null,
|
|
159
197
|
currency: 'USD',
|
|
160
198
|
netRevenue: true,
|
|
161
|
-
mediaType: BANNER,
|
|
162
|
-
ad: decodeURIComponent(`${sovrnBid.adm}<img src="${sovrnBid.nurl}">`),
|
|
163
199
|
ttl: sovrnBid.ext ? (sovrnBid.ext.ttl || 90) : 90,
|
|
164
200
|
meta: { advertiserDomains: sovrnBid && sovrnBid.adomain ? sovrnBid.adomain : [] }
|
|
165
|
-
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (!sovrnBid.nurl) {
|
|
204
|
+
bid.mediaType = VIDEO
|
|
205
|
+
bid.vastXml = decodeURIComponent(sovrnBid.adm)
|
|
206
|
+
} else {
|
|
207
|
+
bid.mediaType = BANNER
|
|
208
|
+
bid.ad = decodeURIComponent(`${sovrnBid.adm}<img src="${sovrnBid.nurl}">`)
|
|
209
|
+
}
|
|
210
|
+
sovrnBidResponses.push(bid);
|
|
166
211
|
});
|
|
167
212
|
}
|
|
168
213
|
return sovrnBidResponses
|
|
@@ -209,4 +254,34 @@ export const spec = {
|
|
|
209
254
|
},
|
|
210
255
|
}
|
|
211
256
|
|
|
212
|
-
|
|
257
|
+
function _buildVideoRequestObj(bid) {
|
|
258
|
+
const videoObj = {}
|
|
259
|
+
const videoAdUnitParams = deepAccess(bid, 'mediaTypes.video', {})
|
|
260
|
+
const videoBidderParams = deepAccess(bid, 'params.video', {})
|
|
261
|
+
const computedParams = {}
|
|
262
|
+
|
|
263
|
+
if (Array.isArray(videoAdUnitParams.playerSize)) {
|
|
264
|
+
const sizes = (Array.isArray(videoAdUnitParams.playerSize[0])) ? videoAdUnitParams.playerSize[0] : videoAdUnitParams.playerSize
|
|
265
|
+
computedParams.w = sizes[0]
|
|
266
|
+
computedParams.h = sizes[1]
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const videoParams = {
|
|
270
|
+
...computedParams,
|
|
271
|
+
...videoAdUnitParams,
|
|
272
|
+
...videoBidderParams
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
Object.keys(ORTB_VIDEO_PARAMS).forEach(paramName => {
|
|
276
|
+
if (videoParams.hasOwnProperty(paramName)) {
|
|
277
|
+
if (ORTB_VIDEO_PARAMS[paramName](videoParams[paramName])) {
|
|
278
|
+
videoObj[paramName] = videoParams[paramName]
|
|
279
|
+
} else {
|
|
280
|
+
logWarn(`The OpenRTB video param ${paramName} has been skipped due to misformating. Please refer to OpenRTB 2.5 spec.`);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
})
|
|
284
|
+
return videoObj
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
registerBidder(spec)
|
|
@@ -10,9 +10,9 @@ Maintainer: jrosendahl@sovrn.com
|
|
|
10
10
|
|
|
11
11
|
Sovrn's adapter integration to the Prebid library. Posts plain-text JSON to the /rtb/bid endpoint.
|
|
12
12
|
|
|
13
|
-
# Test Parameters
|
|
13
|
+
# Banner Test Parameters
|
|
14
14
|
|
|
15
|
-
```
|
|
15
|
+
```js
|
|
16
16
|
var adUnits = [
|
|
17
17
|
{
|
|
18
18
|
code: 'test-leaderboard',
|
|
@@ -45,3 +45,81 @@ var adUnits = [
|
|
|
45
45
|
}
|
|
46
46
|
]
|
|
47
47
|
```
|
|
48
|
+
|
|
49
|
+
# Video Test Parameters
|
|
50
|
+
### Instream
|
|
51
|
+
```js
|
|
52
|
+
var videoAdUnit = {
|
|
53
|
+
code: 'video1',
|
|
54
|
+
sizes: [640, 480],
|
|
55
|
+
mediaTypes: {
|
|
56
|
+
video: {
|
|
57
|
+
context: 'instream',
|
|
58
|
+
playerSize: [640, 480],
|
|
59
|
+
mimes: ['video/mp4'],
|
|
60
|
+
protocols: [1, 2, 3, 4, 5, 6, 7, 8],
|
|
61
|
+
playbackmethod: [2],
|
|
62
|
+
skip: 1,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
bids: [
|
|
66
|
+
{
|
|
67
|
+
bidder: 'sovrn',
|
|
68
|
+
// Prebid Server Bidder Params https://docs.prebid.org/dev-docs/pbs-bidders.html#sovrn
|
|
69
|
+
params: {
|
|
70
|
+
tagid: '315045',
|
|
71
|
+
bidfloor: '0.04',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
### Outstream
|
|
78
|
+
```js
|
|
79
|
+
var adUnits = [
|
|
80
|
+
{
|
|
81
|
+
code: videoId,
|
|
82
|
+
mediaTypes: {
|
|
83
|
+
video: {
|
|
84
|
+
context: 'outstream',
|
|
85
|
+
playerSize: [640, 360],
|
|
86
|
+
mimes: ['video/mp4'],
|
|
87
|
+
protocols: [1, 2, 3, 4, 5, 6, 7, 8],
|
|
88
|
+
playbackmethod: [2],
|
|
89
|
+
skip: 1,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
bids: [
|
|
93
|
+
{
|
|
94
|
+
bidder: 'sovrn',
|
|
95
|
+
// Prebid Server Bidder Params https://docs.prebid.org/dev-docs/pbs-bidders.html#sovrn
|
|
96
|
+
params: {
|
|
97
|
+
tagid: '315045',
|
|
98
|
+
bidfloor: '0.04',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
renderer: {
|
|
103
|
+
url: 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js',
|
|
104
|
+
render: function (bid) {
|
|
105
|
+
adResponse = {
|
|
106
|
+
ad: {
|
|
107
|
+
video: {
|
|
108
|
+
content: bid.vastXml,
|
|
109
|
+
player_height: bid.height,
|
|
110
|
+
player_width: bid.width,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
}
|
|
114
|
+
// push to render queue because ANOutstreamVideo may not be loaded yet.
|
|
115
|
+
bid.renderer.push(() => {
|
|
116
|
+
ANOutstreamVideo.renderAd({
|
|
117
|
+
targetId: bid.adUnitCode,
|
|
118
|
+
adResponse: adResponse,
|
|
119
|
+
})
|
|
120
|
+
})
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
]
|
|
125
|
+
```
|
|
@@ -2,14 +2,16 @@ import { isArray, deepAccess, logWarn, parseUrl } from '../src/utils.js';
|
|
|
2
2
|
import { ajax } from '../src/ajax.js';
|
|
3
3
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
4
4
|
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
5
|
-
import strIncludes from '
|
|
5
|
+
import strIncludes from 'prebidjs-polyfill/includes.js';
|
|
6
6
|
|
|
7
7
|
const BIDDER_CODE = 'sspBC';
|
|
8
8
|
const BIDDER_URL = 'https://ssp.wp.pl/bidder/';
|
|
9
9
|
const SYNC_URL = 'https://ssp.wp.pl/bidder/usersync';
|
|
10
10
|
const NOTIFY_URL = 'https://ssp.wp.pl/bidder/notify';
|
|
11
|
+
const TRACKER_URL = 'https://bdr.wpcdn.pl/tag/jstracker.js';
|
|
12
|
+
const GVLID = 676;
|
|
11
13
|
const TMAX = 450;
|
|
12
|
-
const BIDDER_VERSION = '5.
|
|
14
|
+
const BIDDER_VERSION = '5.41';
|
|
13
15
|
const W = window;
|
|
14
16
|
const { navigator } = W;
|
|
15
17
|
const oneCodeDetection = {};
|
|
@@ -29,8 +31,8 @@ const getNotificationPayload = bidData => {
|
|
|
29
31
|
const result = {
|
|
30
32
|
requestId: undefined,
|
|
31
33
|
siteId: [],
|
|
32
|
-
adUnit: [],
|
|
33
34
|
slotId: [],
|
|
35
|
+
tagid: [],
|
|
34
36
|
}
|
|
35
37
|
bids.forEach(bid => {
|
|
36
38
|
let params = isArray(bid.params) ? bid.params[0] : bid.params;
|
|
@@ -55,7 +57,7 @@ const getNotificationPayload = bidData => {
|
|
|
55
57
|
result.adomain = meta.advertiserDomains && meta.advertiserDomains[0];
|
|
56
58
|
result.networkName = meta.networkName;
|
|
57
59
|
}
|
|
58
|
-
result.
|
|
60
|
+
result.tagid.push(bid.adUnitCode);
|
|
59
61
|
result.requestId = bid.auctionId || result.requestId;
|
|
60
62
|
result.timeout = bid.timeout || result.timeout;
|
|
61
63
|
})
|
|
@@ -123,7 +125,16 @@ const applyClientHints = ortbRequest => {
|
|
|
123
125
|
]
|
|
124
126
|
}];
|
|
125
127
|
|
|
126
|
-
|
|
128
|
+
const ch = { data };
|
|
129
|
+
ortbRequest.user = { ...ortbRequest.user, ...ch };
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const applyUserIds = (validBidRequest, ortbRequest) => {
|
|
133
|
+
const eids = validBidRequest.userIdAsEids
|
|
134
|
+
if (eids && eids.length) {
|
|
135
|
+
const ids = { eids };
|
|
136
|
+
ortbRequest.user = { ...ortbRequest.user, ...ids };
|
|
137
|
+
}
|
|
127
138
|
};
|
|
128
139
|
|
|
129
140
|
/**
|
|
@@ -135,8 +146,8 @@ const applyGdpr = (bidderRequest, ortbRequest) => {
|
|
|
135
146
|
if (gdprConsent) {
|
|
136
147
|
const { apiVersion, gdprApplies, consentString } = gdprConsent;
|
|
137
148
|
consentApiVersion = apiVersion;
|
|
138
|
-
ortbRequest.regs = Object.assign(ortbRequest.regs, { '
|
|
139
|
-
ortbRequest.user = Object.assign(ortbRequest.user, { '
|
|
149
|
+
ortbRequest.regs = Object.assign(ortbRequest.regs, { 'gdpr': gdprApplies ? 1 : 0 });
|
|
150
|
+
ortbRequest.user = Object.assign(ortbRequest.user, { 'consent': consentString });
|
|
140
151
|
}
|
|
141
152
|
}
|
|
142
153
|
|
|
@@ -299,7 +310,7 @@ const mapImpression = slot => {
|
|
|
299
310
|
ext.data = Object.assign({ pbsize: adUnitsCalled[adUnitCode] }, ext.data);
|
|
300
311
|
|
|
301
312
|
const imp = {
|
|
302
|
-
id: id && siteId ? id : 'bidid-' + bidId,
|
|
313
|
+
id: id && siteId ? id.padStart(3, '0') : 'bidid-' + bidId,
|
|
303
314
|
banner: mapBanner(slot),
|
|
304
315
|
native: mapNative(slot),
|
|
305
316
|
video: mapVideo(slot),
|
|
@@ -342,7 +353,7 @@ const isVideoAd = bid => {
|
|
|
342
353
|
const isNativeAd = bid => {
|
|
343
354
|
const xmlTester = new RegExp(/^{['"]native['"]/);
|
|
344
355
|
|
|
345
|
-
return bid.adm && bid.adm.match(xmlTester);
|
|
356
|
+
return bid.admNative || (bid.adm && bid.adm.match(xmlTester));
|
|
346
357
|
}
|
|
347
358
|
|
|
348
359
|
const parseNative = nativeData => {
|
|
@@ -450,12 +461,10 @@ const renderCreative = (site, auctionId, bid, seat, request) => {
|
|
|
450
461
|
window.gdpr = ${JSON.stringify(request.gdprConsent)};
|
|
451
462
|
window.page = "${site.page}";
|
|
452
463
|
window.ref = "${site.ref}";
|
|
464
|
+
window.adlabel = "${site.adLabel ? site.adLabel : ''}";
|
|
465
|
+
window.pubid = "${site.publisherId ? site.publisherId : ''}";
|
|
453
466
|
`;
|
|
454
467
|
|
|
455
|
-
if (gam) {
|
|
456
|
-
adcode += `window.gam = ${JSON.stringify(gam)};`;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
468
|
adcode += `</script>
|
|
460
469
|
</head>
|
|
461
470
|
<body>
|
|
@@ -469,6 +478,7 @@ const renderCreative = (site, auctionId, bid, seat, request) => {
|
|
|
469
478
|
|
|
470
479
|
const spec = {
|
|
471
480
|
code: BIDDER_CODE,
|
|
481
|
+
gvlid: GVLID,
|
|
472
482
|
aliases: [],
|
|
473
483
|
supportedMediaTypes: [BANNER, NATIVE, VIDEO],
|
|
474
484
|
isBidRequestValid(bid) {
|
|
@@ -513,6 +523,7 @@ const spec = {
|
|
|
513
523
|
|
|
514
524
|
applyGdpr(bidderRequest, payload);
|
|
515
525
|
applyClientHints(payload);
|
|
526
|
+
applyUserIds(validBidRequests[0], payload);
|
|
516
527
|
|
|
517
528
|
return {
|
|
518
529
|
method: 'POST',
|
|
@@ -558,10 +569,14 @@ const spec = {
|
|
|
558
569
|
/*
|
|
559
570
|
bid response might include ext object containing siteId / slotId, as detected by OneCode
|
|
560
571
|
update site / slot data in this case
|
|
572
|
+
|
|
573
|
+
ext also might contain publisherId and custom ad label
|
|
561
574
|
*/
|
|
562
|
-
const { siteid, slotid } = ext;
|
|
575
|
+
const { siteid, slotid, pubid, adlabel } = ext;
|
|
563
576
|
site.id = siteid || site.id;
|
|
564
577
|
site.slot = slotid || site.slot;
|
|
578
|
+
site.publisherId = pubid;
|
|
579
|
+
site.adLabel = adlabel;
|
|
565
580
|
}
|
|
566
581
|
|
|
567
582
|
if (bidRequest && site.id && !strIncludes(site.id, 'bidid')) {
|
|
@@ -598,10 +613,28 @@ const spec = {
|
|
|
598
613
|
bid.mediaType = 'native';
|
|
599
614
|
// check native object
|
|
600
615
|
try {
|
|
601
|
-
const nativeData = JSON.parse(serverBid.adm).native;
|
|
616
|
+
const nativeData = serverBid.admNative || JSON.parse(serverBid.adm).native;
|
|
602
617
|
bid.native = parseNative(nativeData);
|
|
603
618
|
bid.width = 1;
|
|
604
619
|
bid.height = 1;
|
|
620
|
+
|
|
621
|
+
// append viewability tracker
|
|
622
|
+
const jsData = {
|
|
623
|
+
rid: bidRequest.auctionId,
|
|
624
|
+
crid: bid.creativeId,
|
|
625
|
+
adunit: bidRequest.adUnitCode,
|
|
626
|
+
url: bid.native.clickUrl,
|
|
627
|
+
vendor: seat,
|
|
628
|
+
site: site.id,
|
|
629
|
+
slot: site.slot,
|
|
630
|
+
cpm: bid.cpm.toPrecision(4),
|
|
631
|
+
}
|
|
632
|
+
const jsTracker = '<script type="text/javascript" async="true" src="' + TRACKER_URL + '" ' + Object.keys(jsData).reduce((acc, current) => { return acc + ` data-wpar-${current}="${jsData[current]}"` }, '') + '><\/script>';
|
|
633
|
+
if (bid.native.javascriptTrackers) {
|
|
634
|
+
bid.native.javascriptTrackers.push(jsTracker);
|
|
635
|
+
} else {
|
|
636
|
+
bid.native.javascriptTrackers = [jsTracker];
|
|
637
|
+
}
|
|
605
638
|
} catch (err) {
|
|
606
639
|
logWarn('Could not parse native data', serverBid.adm);
|
|
607
640
|
bid.cpm = 0;
|
|
@@ -624,15 +657,15 @@ const spec = {
|
|
|
624
657
|
|
|
625
658
|
return bids;
|
|
626
659
|
},
|
|
627
|
-
getUserSyncs(syncOptions) {
|
|
660
|
+
getUserSyncs(syncOptions, serverResponses, gdprConsent) {
|
|
661
|
+
let mySyncs = [];
|
|
628
662
|
if (syncOptions.iframeEnabled && consentApiVersion != 1) {
|
|
629
|
-
|
|
663
|
+
mySyncs.push({
|
|
630
664
|
type: 'iframe',
|
|
631
665
|
url: `${SYNC_URL}?tcf=${consentApiVersion}`,
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
}
|
|
666
|
+
});
|
|
667
|
+
};
|
|
668
|
+
return mySyncs;
|
|
636
669
|
},
|
|
637
670
|
|
|
638
671
|
onTimeout(timeoutData) {
|