prebid.js 9.46.0 → 9.48.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/.github/codeql/queries/jsonRequestContentType.ql +18 -0
- package/AGENTS.md +42 -0
- package/CLAUDE.md +1 -0
- package/babelConfig.js +1 -1
- package/dist/33acrossAnalyticsAdapter.js +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/BTBidAdapter.js +1 -1
- package/dist/adagioAnalyticsAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adagioUtils.js +1 -1
- package/dist/addefendBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adstirBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/advangUtils.js +1 -1
- package/dist/adverxoBidAdapter.js +1 -1
- package/dist/adxcgAnalyticsAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/agmaAnalyticsAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/aniviewBidAdapter.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/beopBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bitmediaBidAdapter.js +1 -1
- package/dist/blueBidAdapter.js +1 -1
- package/dist/blueUtils.js +1 -0
- package/dist/bmsBidAdapter.js +1 -1
- package/dist/bridBidAdapter.js +1 -1
- package/dist/bridgeuppBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/browsiUtils.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/chunk-core.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/contxtfulBidAdapter.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/czechAdIdSystem.js +1 -1
- package/dist/dailymotionBidAdapter.js +1 -1
- package/dist/debugging-standalone.js +1 -1
- package/dist/dependencies.json +16 -2
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/dxkultureBidAdapter.js +1 -1
- package/dist/dynamicAdBoostRtdProvider.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/eskimiBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/exadsBidAdapter.js +1 -1
- package/dist/excoBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/gptUtils.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsBidAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/id5AnalyticsAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmobiBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/intentIqAnalyticsAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/kimberliteBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentId.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/luceadBidAdapter.js +1 -1
- package/dist/luponmediaBidAdapter.js +1 -1
- package/dist/mabidderBidAdapter.js +1 -1
- package/dist/madsenseBidAdapter.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/medianetUtils.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/missenaBidAdapter.js +1 -1
- package/dist/mobilefuseBidAdapter.js +1 -1
- package/dist/nativeryBidAdapter.js +1 -0
- package/dist/nextMillenniumBidAdapter.js +1 -1
- package/dist/nexx360Utils.js +1 -1
- package/dist/nobidAnalyticsAdapter.js +1 -1
- package/dist/nobidBidAdapter.js +1 -1
- package/dist/nodalsAiRtdProvider.js +1 -1
- package/dist/not-for-prod/prebid.js +187 -184
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxBidAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/orbidderBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/pinkLionBidAdapter.js +1 -0
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/priceFloors.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubmaticRtdProvider.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubxaiAnalyticsAdapter.js +1 -1
- package/dist/pubxaiRtdProvider.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/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseUtils.js +1 -1
- package/dist/rtbhouseBidAdapter.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/showheroes-bsBidAdapter.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/snigelBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sparteoBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stroeerCoreBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/tappxBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/terceptAnalyticsAdapter.js +1 -1
- package/dist/themoneytizerBidAdapter.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/unifiedIdSystem.js +1 -1
- package/dist/unrulyBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/vidazooUtils.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/weboramaRtdProvider.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/xeUtils.js +1 -1
- package/dist/yahooAdsBidAdapter.js +1 -1
- package/dist/yandexBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/eslint.config.js +1 -3
- package/gulpHelpers.js +3 -6
- package/gulpfile.js +25 -24
- package/karma.conf.maker.js +1 -3
- package/libraries/advangUtils/index.js +3 -4
- package/libraries/blueUtils/bidderUtils.js +113 -0
- package/libraries/browsiUtils/browsiUtils.js +1 -2
- package/libraries/gptUtils/gptUtils.js +1 -2
- package/libraries/liveIntentId/shared.js +4 -0
- package/libraries/xeUtils/bidderUtils.js +3 -4
- package/modules/adagioBidAdapter.js +1 -2
- package/modules/addefendBidAdapter.md +1 -1
- package/modules/adtrgtmeBidAdapter.js +6 -8
- package/modules/aduptechBidAdapter.md +1 -1
- package/modules/adverxoBidAdapter.js +3 -3
- package/modules/blueBidAdapter.js +24 -104
- package/modules/bmsBidAdapter.js +25 -105
- package/modules/concertBidAdapter.md +1 -1
- package/modules/contxtfulBidAdapter.js +56 -10
- package/modules/conversantBidAdapter.js +0 -58
- package/modules/cwireBidAdapter.js +8 -0
- package/modules/czechAdIdSystem.js +13 -3
- package/modules/dynamicAdBoostRtdProvider.js +16 -33
- package/modules/dynamicAdBoostRtdProvider.md +1 -6
- package/modules/ixBidAdapter.js +2 -3
- package/modules/luponmediaBidAdapter.js +117 -522
- package/modules/luponmediaBidAdapter.md +2 -3
- package/modules/mediasquareBidAdapter.js +14 -20
- package/modules/microadBidAdapter.js +0 -1
- package/modules/nativeryBidAdapter.js +135 -0
- package/modules/nativeryBidAdapter.md +95 -0
- package/modules/nativoBidAdapter.js +3 -3
- package/modules/onetagBidAdapter.js +0 -1
- package/modules/pinkLionBidAdapter.js +17 -0
- package/modules/pinkLionBidAdapter.md +79 -0
- package/modules/prebidServerBidAdapter/ortbConverter.js +1 -1
- package/modules/priceFloors.js +2 -2
- package/modules/pubmaticBidAdapter.js +4 -1
- package/modules/qortexRtdProvider.md +1 -1
- package/modules/reconciliationRtdProvider.md +4 -4
- package/modules/rtbhouseBidAdapter.js +4 -83
- package/modules/rubiconBidAdapter.js +1 -1
- package/modules/sspBCBidAdapter.js +1 -1
- package/modules/stroeerCoreBidAdapter.js +3 -3
- package/modules/stvBidAdapter.js +19 -14
- package/modules/topicsFpdModule.md +1 -1
- package/modules/unifiedIdSystem.js +8 -1
- package/modules/userId/eids.js +15 -0
- package/modules/videoModule/index.js +0 -1
- package/modules/videoModule/videoImpressionVerifier.js +0 -1
- package/modules/yieldlabBidAdapter.js +1 -2
- package/modules/yieldmoBidAdapter.js +1 -2
- package/package.json +13 -20
- package/src/Renderer.js +1 -2
- package/src/adapterManager.js +14 -4
- package/src/auction.js +2 -3
- package/src/config.js +1 -2
- package/src/cpmBucketManager.js +1 -2
- package/src/secureCreatives.js +2 -3
- package/src/targeting.js +1 -2
- package/test/fake-server/README.md +3 -3
- package/test/helpers/index_adapter_utils.js +2 -2
- package/test/helpers/testing-utils.js +1 -1
- package/test/spec/auctionmanager_spec.js +2 -3
- package/test/spec/fpd/enrichment_spec.js +1 -1
- package/test/spec/libraries/greedy/greedyPromise_spec.js +2 -2
- package/test/spec/modules/adfBidAdapter_spec.js +1 -1
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +25 -9
- package/test/spec/modules/adtrgtmeBidAdapter_spec.js +2 -4
- package/test/spec/modules/adverxoBidAdapter_spec.js +25 -1
- package/test/spec/modules/afpBidAdapter_spec.js +0 -1
- package/test/spec/modules/bliinkBidAdapter_spec.js +15 -7
- package/test/spec/modules/contxtfulBidAdapter_spec.js +606 -82
- package/test/spec/modules/conversantBidAdapter_spec.js +1 -139
- package/test/spec/modules/cwireBidAdapter_spec.js +2 -2
- package/test/spec/modules/czechAdIdSystem_spec.js +4 -4
- package/test/spec/modules/displayioBidAdapter_spec.js +1 -1
- package/test/spec/modules/dynamicAdBoostRtdProvider_spec.js +0 -42
- package/test/spec/modules/enrichmentLiftMeasurement_spec.js +8 -8
- package/test/spec/modules/hypelabBidAdapter_spec.js +17 -11
- package/test/spec/modules/iasRtdProvider_spec.js +2 -2
- package/test/spec/modules/id5IdSystem_spec.js +1 -1
- package/test/spec/modules/idxIdSystem_spec.js +1 -2
- package/test/spec/modules/intentIqAnalyticsAdapter_spec.js +25 -25
- package/test/spec/modules/intentIqIdSystem_spec.js +32 -32
- package/test/spec/modules/kargoBidAdapter_spec.js +11 -5
- package/test/spec/modules/liveIntentIdSystem_spec.js +14 -0
- package/test/spec/modules/lmpIdSystem_spec.js +1 -2
- package/test/spec/modules/lockrAIMIdSystem_spec.js +2 -2
- package/test/spec/modules/luceadBidAdapter_spec.js +1 -1
- package/test/spec/modules/luponmediaBidAdapter_spec.js +186 -324
- package/test/spec/modules/mediaeyesBidAdapter_spec.js +1 -1
- package/test/spec/modules/mediakeysBidAdapter_spec.js +1 -2
- package/test/spec/modules/mediasquareBidAdapter_spec.js +13 -2
- package/test/spec/modules/missenaBidAdapter_spec.js +1 -1
- package/test/spec/modules/nativeryBidAdapter_spec.js +195 -0
- package/test/spec/modules/nexx360BidAdapter_spec.js +6 -6
- package/test/spec/modules/oguryBidAdapter_spec.js +2 -2
- package/test/spec/modules/omsBidAdapter_spec.js +1 -1
- package/test/spec/modules/onetagBidAdapter_spec.js +1 -2
- package/test/spec/modules/onomagicBidAdapter_spec.js +2 -2
- package/test/spec/modules/overtoneRtdProvider_spec.mjs +1 -1
- package/test/spec/modules/permutiveIdentityManagerIdSystem_spec.js +17 -14
- package/test/spec/modules/pinkLionBidAdapter_spec.js +480 -0
- package/test/spec/modules/prebidServerBidAdapter_spec.js +2 -2
- package/test/spec/modules/previousAuctionInfo_spec.js +2 -2
- package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +1 -1
- package/test/spec/modules/pubmaticBidAdapter_spec.js +19 -1
- package/test/spec/modules/pubmaticRtdProvider_spec.js +16 -17
- package/test/spec/modules/pubwiseAnalyticsAdapter_spec.js +2 -2
- package/test/spec/modules/rtbhouseBidAdapter_spec.js +0 -182
- package/test/spec/modules/rubiconBidAdapter_spec.js +3 -4
- package/test/spec/modules/sizeMappingV2_spec.js +1 -1
- package/test/spec/modules/sizeMapping_spec.js +2 -3
- package/test/spec/modules/stroeerCoreBidAdapter_spec.js +36 -26
- package/test/spec/modules/stvBidAdapter_spec.js +108 -40
- package/test/spec/modules/topLevelPaapi_spec.js +1 -1
- package/test/spec/modules/tpmnBidAdapter_spec.js +1 -1
- package/test/spec/modules/ttdBidAdapter_spec.js +1 -1
- package/test/spec/modules/unifiedIdSystem_spec.js +20 -0
- package/test/spec/modules/userId_spec.js +1 -1
- package/test/spec/modules/vibrantmediaBidAdapter_spec.js +1 -1
- package/test/spec/modules/videoModule/submodules/videojsVideoProvider_spec.js +1 -1
- package/test/spec/modules/yieldmoBidAdapter_spec.js +2 -2
- package/test/spec/modules/zeotapIdPlusIdSystem_spec.js +1 -2
- package/test/spec/unit/core/adapterManager_spec.js +29 -17
- package/test/spec/unit/core/targeting_spec.js +1 -1
- package/test/spec/unit/pbjs_api_spec.js +4 -5
- package/test/spec/utils_spec.js +20 -12
- package/test/test_deps.js +1 -1
- package/nightwatch.browserstack.json +0 -46
- package/nightwatch.conf.js +0 -36
- package/nightwatch.json +0 -40
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
2
2
|
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
3
|
-
import { _each, buildUrl, isStr, isEmptyStr, logInfo, logError } from '../src/utils.js';
|
|
3
|
+
import { _each, buildUrl, isStr, isEmptyStr, logInfo, logError, safeJSONEncode } from '../src/utils.js';
|
|
4
4
|
import { sendBeacon, ajax } from '../src/ajax.js';
|
|
5
5
|
import { config as pbjsConfig } from '../src/config.js';
|
|
6
6
|
import {
|
|
@@ -162,16 +162,60 @@ const logBidderError = ({ error, bidderRequest }) => {
|
|
|
162
162
|
logEvent('onBidderError', { error, bidderRequest });
|
|
163
163
|
};
|
|
164
164
|
|
|
165
|
+
const safeStringify = (data, keysToExclude = []) => {
|
|
166
|
+
try {
|
|
167
|
+
const seen = new WeakSet();
|
|
168
|
+
return JSON.stringify(data, function (key, value) {
|
|
169
|
+
try {
|
|
170
|
+
if (keysToExclude.includes(key)) {
|
|
171
|
+
return '[Excluded]';
|
|
172
|
+
}
|
|
173
|
+
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#exceptions
|
|
174
|
+
if (typeof value === "bigint") {
|
|
175
|
+
return value.toString();
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Handle browser objects
|
|
179
|
+
if (typeof value === "object" && value !== null) {
|
|
180
|
+
// In case we try to stringify some html object, it could throw a SecurityError before detecting the circular reference
|
|
181
|
+
if (value === window ||
|
|
182
|
+
(typeof Window !== 'undefined' && value instanceof Window) ||
|
|
183
|
+
(typeof Document !== 'undefined' && value instanceof Document) ||
|
|
184
|
+
(typeof HTMLElement !== 'undefined' && value instanceof HTMLElement) ||
|
|
185
|
+
(typeof Node !== 'undefined' && value instanceof Node)) {
|
|
186
|
+
return '[Browser Object]';
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Check for circular references
|
|
190
|
+
if (seen.has(value)) {
|
|
191
|
+
return "[Circular]";
|
|
192
|
+
}
|
|
193
|
+
seen.add(value);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return value;
|
|
197
|
+
} catch (error) {
|
|
198
|
+
// Handle any property access errors (like cross-origin SecurityError)
|
|
199
|
+
return '[Inaccessible Object]';
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
} catch (error) {
|
|
203
|
+
return safeJSONEncode({ traceId: data?.traceId || '[Unknown]', error: error?.toString() });
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
165
207
|
// Handles the logging of events
|
|
166
208
|
const logEvent = (eventType, data) => {
|
|
167
209
|
try {
|
|
168
|
-
// Log event
|
|
169
|
-
logInfo(BIDDER_CODE, `[${eventType}] ${JSON.stringify(data)}`);
|
|
170
|
-
|
|
171
210
|
// Get Config
|
|
172
211
|
const bidderConfig = pbjsConfig.getConfig();
|
|
173
212
|
const { version, customer } = extractParameters(bidderConfig);
|
|
174
213
|
|
|
214
|
+
// Construct a fail-safe payload
|
|
215
|
+
const stringifiedPayload = safeStringify(data, ["renderer"]);
|
|
216
|
+
|
|
217
|
+
logInfo(BIDDER_CODE, `[${eventType}] ${stringifiedPayload}`);
|
|
218
|
+
|
|
175
219
|
// Sampled monitoring
|
|
176
220
|
if (['onBidBillable', 'onAdRenderSucceeded'].includes(eventType)) {
|
|
177
221
|
const randomNumber = Math.random();
|
|
@@ -184,7 +228,6 @@ const logEvent = (eventType, data) => {
|
|
|
184
228
|
return;
|
|
185
229
|
}
|
|
186
230
|
|
|
187
|
-
const payload = { type: eventType, data };
|
|
188
231
|
const eventUrl = buildUrl({
|
|
189
232
|
protocol: 'https',
|
|
190
233
|
host: MONITORING_ENDPOINT,
|
|
@@ -192,19 +235,19 @@ const logEvent = (eventType, data) => {
|
|
|
192
235
|
});
|
|
193
236
|
|
|
194
237
|
// Try sending a beacon
|
|
195
|
-
if (sendBeacon(eventUrl,
|
|
196
|
-
logInfo(BIDDER_CODE, `[${eventType}] Logging data sent using Beacon and payload: ${
|
|
238
|
+
if (sendBeacon(eventUrl, stringifiedPayload)) {
|
|
239
|
+
logInfo(BIDDER_CODE, `[${eventType}] Logging data sent using Beacon and payload: ${stringifiedPayload}`);
|
|
197
240
|
} else {
|
|
198
241
|
// Fallback to using ajax
|
|
199
|
-
ajax(eventUrl, null,
|
|
242
|
+
ajax(eventUrl, null, stringifiedPayload, {
|
|
200
243
|
method: 'POST',
|
|
201
244
|
contentType: 'application/json',
|
|
202
245
|
withCredentials: true,
|
|
203
246
|
});
|
|
204
|
-
logInfo(BIDDER_CODE, `[${eventType}] Logging data sent using Ajax and payload: ${
|
|
247
|
+
logInfo(BIDDER_CODE, `[${eventType}] Logging data sent using Ajax and payload: ${stringifiedPayload}`);
|
|
205
248
|
}
|
|
206
249
|
} catch (error) {
|
|
207
|
-
logError(BIDDER_CODE, `Failed to log event: ${eventType}
|
|
250
|
+
logError(BIDDER_CODE, `Failed to log event: ${eventType}. Error: ${error.toString()}.`);
|
|
208
251
|
}
|
|
209
252
|
};
|
|
210
253
|
|
|
@@ -225,4 +268,7 @@ export const spec = {
|
|
|
225
268
|
onBidderError: logBidderError,
|
|
226
269
|
};
|
|
227
270
|
|
|
271
|
+
// Export for testing
|
|
272
|
+
export { safeStringify };
|
|
273
|
+
|
|
228
274
|
registerBidder(spec);
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildUrl,
|
|
3
3
|
deepAccess,
|
|
4
|
-
deepSetValue,
|
|
5
4
|
getBidIdParameter,
|
|
6
5
|
isArray,
|
|
7
6
|
isFn,
|
|
8
7
|
isPlainObject,
|
|
9
8
|
isStr,
|
|
10
|
-
logError,
|
|
11
9
|
logWarn,
|
|
12
10
|
mergeDeep,
|
|
13
11
|
parseUrl,
|
|
14
12
|
} from '../src/utils.js';
|
|
15
13
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
16
14
|
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
|
|
17
|
-
import {getStorageManager} from '../src/storageManager.js';
|
|
18
15
|
import {ortbConverter} from '../libraries/ortbConverter/converter.js';
|
|
19
16
|
import {ORTB_MTYPES} from '../libraries/ortbConverter/processors/mediaType.js';
|
|
20
17
|
|
|
@@ -30,7 +27,6 @@ import {ORTB_MTYPES} from '../libraries/ortbConverter/processors/mediaType.js';
|
|
|
30
27
|
const GVLID = 24;
|
|
31
28
|
|
|
32
29
|
const BIDDER_CODE = 'conversant';
|
|
33
|
-
export const storage = getStorageManager({gvlid: GVLID, bidderCode: BIDDER_CODE});
|
|
34
30
|
const URL = 'https://web.hb.ad.cpe.dotomi.com/cvx/client/hb/ortb/25';
|
|
35
31
|
|
|
36
32
|
function setSiteId(bidRequest, request) {
|
|
@@ -44,14 +40,6 @@ function setSiteId(bidRequest, request) {
|
|
|
44
40
|
}
|
|
45
41
|
}
|
|
46
42
|
|
|
47
|
-
function setPubcid(bidRequest, request) {
|
|
48
|
-
// Add common id if available
|
|
49
|
-
const pubcid = getPubcid(bidRequest);
|
|
50
|
-
if (pubcid) {
|
|
51
|
-
deepSetValue(request, 'user.ext.fpc', pubcid);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
43
|
const converter = ortbConverter({
|
|
56
44
|
context: {
|
|
57
45
|
netRevenue: true,
|
|
@@ -64,7 +52,6 @@ const converter = ortbConverter({
|
|
|
64
52
|
if (context.bidRequests) {
|
|
65
53
|
const bidRequest = context.bidRequests[0];
|
|
66
54
|
setSiteId(bidRequest, request);
|
|
67
|
-
setPubcid(bidRequest, request);
|
|
68
55
|
}
|
|
69
56
|
|
|
70
57
|
return request;
|
|
@@ -224,20 +211,6 @@ export const spec = {
|
|
|
224
211
|
}
|
|
225
212
|
};
|
|
226
213
|
|
|
227
|
-
function getPubcid(bidRequest) {
|
|
228
|
-
let pubcid = null;
|
|
229
|
-
if (bidRequest.userId && bidRequest.userId.pubcid) {
|
|
230
|
-
pubcid = bidRequest.userId.pubcid;
|
|
231
|
-
} else if (bidRequest.crumbs && bidRequest.crumbs.pubcid) {
|
|
232
|
-
pubcid = bidRequest.crumbs.pubcid;
|
|
233
|
-
}
|
|
234
|
-
if (!pubcid) {
|
|
235
|
-
const pubcidName = getBidIdParameter('pubcid_name', bidRequest.params) || '_pubcid';
|
|
236
|
-
pubcid = readStoredValue(pubcidName);
|
|
237
|
-
}
|
|
238
|
-
return pubcid;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
214
|
/**
|
|
242
215
|
* Check if it's a video bid request
|
|
243
216
|
*
|
|
@@ -261,37 +234,6 @@ function copyOptProperty(src, dst, dstName) {
|
|
|
261
234
|
}
|
|
262
235
|
}
|
|
263
236
|
|
|
264
|
-
/**
|
|
265
|
-
* Look for a stored value from both cookie and local storage and return the first value found.
|
|
266
|
-
* @param key Key for the search
|
|
267
|
-
* @return {string} Stored value
|
|
268
|
-
*/
|
|
269
|
-
function readStoredValue(key) {
|
|
270
|
-
let storedValue;
|
|
271
|
-
try {
|
|
272
|
-
// check cookies first
|
|
273
|
-
storedValue = storage.getCookie(key);
|
|
274
|
-
|
|
275
|
-
if (!storedValue) {
|
|
276
|
-
// check expiration time before reading local storage
|
|
277
|
-
const storedValueExp = storage.getDataFromLocalStorage(`${key}_exp`);
|
|
278
|
-
if (storedValueExp === '' || (storedValueExp && (new Date(storedValueExp)).getTime() - Date.now() > 0)) {
|
|
279
|
-
storedValue = storage.getDataFromLocalStorage(key);
|
|
280
|
-
storedValue = storedValue ? decodeURIComponent(storedValue) : storedValue;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
// deserialize JSON if needed
|
|
285
|
-
if (isStr(storedValue) && storedValue.charAt(0) === '{') {
|
|
286
|
-
storedValue = JSON.parse(storedValue);
|
|
287
|
-
}
|
|
288
|
-
} catch (e) {
|
|
289
|
-
logError(e);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
return storedValue;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
237
|
/**
|
|
296
238
|
* Get the floor price from bid.params for backward compatibility.
|
|
297
239
|
* If not found, then check floor module.
|
|
@@ -86,6 +86,13 @@ function getRefGroups() {
|
|
|
86
86
|
return []
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Returns the downlink speed of the connection in Mbps or an empty string if not available.
|
|
91
|
+
*/
|
|
92
|
+
function getConnectionDownLink(nav) {
|
|
93
|
+
return nav && nav.connection && nav.connection.downlink >= 0 ? nav.connection.downlink.toString() : '';
|
|
94
|
+
}
|
|
95
|
+
|
|
89
96
|
/**
|
|
90
97
|
* Reads the CWID from local storage.
|
|
91
98
|
*/
|
|
@@ -190,6 +197,7 @@ export const spec = {
|
|
|
190
197
|
httpRef: referrer,
|
|
191
198
|
// TODO: Verify whether the auctionId and the usage of pageViewId make sense.
|
|
192
199
|
pageViewId: pageViewId,
|
|
200
|
+
networkBandwidth: getConnectionDownLink(window.navigator),
|
|
193
201
|
sdk: {
|
|
194
202
|
version: '$prebid.version$'
|
|
195
203
|
},
|
|
@@ -18,11 +18,18 @@ import {MODULE_TYPE_UID} from '../src/activities/modules.js';
|
|
|
18
18
|
export const storage = getStorageManager({ moduleType: MODULE_TYPE_UID, moduleName: 'czechAdId' })
|
|
19
19
|
|
|
20
20
|
// Returns the id string from either cookie or localstorage
|
|
21
|
-
const readId = () => {
|
|
21
|
+
const readId = () => {
|
|
22
|
+
const id = storage.getCookie('czaid') || storage.getDataFromLocalStorage('czaid')
|
|
23
|
+
return id && isValidUUID(id) ? id : null
|
|
24
|
+
}
|
|
25
|
+
const isValidUUID = (str) => {
|
|
26
|
+
const uuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/
|
|
27
|
+
return uuidRegex.test(str)
|
|
28
|
+
}
|
|
22
29
|
|
|
23
30
|
/** @type {Submodule} */
|
|
24
31
|
export const czechAdIdSubmodule = {
|
|
25
|
-
version: '0.1.
|
|
32
|
+
version: '0.1.1',
|
|
26
33
|
/**
|
|
27
34
|
* used to link submodule with config
|
|
28
35
|
* @type {string}
|
|
@@ -38,7 +45,10 @@ export const czechAdIdSubmodule = {
|
|
|
38
45
|
* @function decode
|
|
39
46
|
* @returns {(Object|undefined)}
|
|
40
47
|
*/
|
|
41
|
-
decode () {
|
|
48
|
+
decode () {
|
|
49
|
+
const id = readId()
|
|
50
|
+
return id ? { czechAdId: readId() } : undefined
|
|
51
|
+
},
|
|
42
52
|
/**
|
|
43
53
|
* performs action to obtain id and return a value in the callback's response argument
|
|
44
54
|
* @function
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { submodule } from '../src/hook.js'
|
|
8
8
|
import { loadExternalScript } from '../src/adloader.js';
|
|
9
9
|
import { getGlobal } from '../src/prebidGlobal.js';
|
|
10
|
-
import { deepAccess, deepSetValue
|
|
10
|
+
import { deepAccess, deepSetValue } from '../src/utils.js';
|
|
11
11
|
import { MODULE_TYPE_RTD } from '../src/activities/modules.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -29,7 +29,7 @@ let dabStartTime;
|
|
|
29
29
|
// Array of div IDs to track
|
|
30
30
|
let dynamicAdBoostAdUnits = {};
|
|
31
31
|
|
|
32
|
-
function init(
|
|
32
|
+
function init() {
|
|
33
33
|
dabStartDate = new Date();
|
|
34
34
|
dabStartTime = dabStartDate.getTime();
|
|
35
35
|
if (!CLIENT_SUPPORTS_IO) {
|
|
@@ -37,47 +37,30 @@ function init(config, userConsent) {
|
|
|
37
37
|
}
|
|
38
38
|
// Create an Intersection Observer instance
|
|
39
39
|
observer = new IntersectionObserver(dabHandleIntersection, dabOptions);
|
|
40
|
-
|
|
41
|
-
let keyId = config.params.keyId;
|
|
42
|
-
if (keyId && !isEmptyStr(keyId)) {
|
|
43
|
-
let dabDivIdsToTrack = config.params.adUnits;
|
|
44
|
-
let dabInterval = setInterval(function() {
|
|
45
|
-
// Observe each div by its ID
|
|
46
|
-
dabDivIdsToTrack.forEach(divId => {
|
|
47
|
-
let div = document.getElementById(divId);
|
|
48
|
-
if (div) {
|
|
49
|
-
observer.observe(div);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
40
|
+
let keyId = 'rtd-' + window.location.hostname;
|
|
52
41
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
elapsedThreshold = config.params.threshold;
|
|
59
|
-
}
|
|
60
|
-
if (dabElapsedSeconds >= elapsedThreshold) {
|
|
61
|
-
clearInterval(dabInterval); // Stop
|
|
62
|
-
loadLmScript(keyId);
|
|
63
|
-
}
|
|
64
|
-
}, 1000);
|
|
42
|
+
let dabInterval = setInterval(function() {
|
|
43
|
+
let dabDateNow = new Date();
|
|
44
|
+
let dabTimeNow = dabDateNow.getTime();
|
|
45
|
+
let dabElapsedSeconds = Math.floor((dabTimeNow - dabStartTime) / 1000);
|
|
46
|
+
let elapsedThreshold = 0;
|
|
65
47
|
|
|
66
|
-
|
|
48
|
+
if (dabElapsedSeconds >= elapsedThreshold) {
|
|
49
|
+
clearInterval(dabInterval); // Stop
|
|
50
|
+
loadLmScript(keyId);
|
|
67
51
|
}
|
|
68
|
-
}
|
|
69
|
-
|
|
52
|
+
}, 1000);
|
|
53
|
+
|
|
54
|
+
return true;
|
|
70
55
|
}
|
|
71
56
|
|
|
72
57
|
function loadLmScript(keyId) {
|
|
73
|
-
|
|
74
|
-
let viewableAdUnitsCSV = viewableAdUnits.join(',');
|
|
75
|
-
const scriptUrl = `${SCRIPT_URL}/${keyId}.js?viewableAdUnits=${viewableAdUnitsCSV}`;
|
|
58
|
+
const scriptUrl = `${SCRIPT_URL}/${keyId}.js`;
|
|
76
59
|
loadExternalScript(scriptUrl, MODULE_TYPE_RTD, MODULE_NAME);
|
|
77
60
|
observer.disconnect();
|
|
78
61
|
}
|
|
79
62
|
|
|
80
|
-
function getBidRequestData(reqBidsConfigObj, callback
|
|
63
|
+
function getBidRequestData(reqBidsConfigObj, callback) {
|
|
81
64
|
const reqAdUnits = reqBidsConfigObj.adUnits || getGlobal().adUnits;
|
|
82
65
|
|
|
83
66
|
if (Array.isArray(reqAdUnits)) {
|
|
@@ -26,12 +26,7 @@ pbjs.setConfig(
|
|
|
26
26
|
auctionDelay: 2000,
|
|
27
27
|
dataProviders: [
|
|
28
28
|
{
|
|
29
|
-
name: "dynamicAdBoost"
|
|
30
|
-
params: {
|
|
31
|
-
keyId: "[PROVIDED_KEY]", // Your provided Dynamic AdBoost keyId
|
|
32
|
-
adUnits: ["allowedAdUnit1", "allowedAdUnit2"],
|
|
33
|
-
threshold: 35 // optional
|
|
34
|
-
}
|
|
29
|
+
name: "dynamicAdBoost"
|
|
35
30
|
}
|
|
36
31
|
]
|
|
37
32
|
}
|
package/modules/ixBidAdapter.js
CHANGED
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
import { BANNER, VIDEO, NATIVE } from '../src/mediaTypes.js';
|
|
20
20
|
import { config } from '../src/config.js';
|
|
21
21
|
import { getStorageManager } from '../src/storageManager.js';
|
|
22
|
-
import { find } from '../src/polyfill.js';
|
|
23
22
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
24
23
|
import { INSTREAM, OUTSTREAM } from '../src/video.js';
|
|
25
24
|
import { Renderer } from '../src/Renderer.js';
|
|
@@ -621,8 +620,8 @@ function getBidRequest(id, impressions, validBidRequests) {
|
|
|
621
620
|
return;
|
|
622
621
|
}
|
|
623
622
|
const bidRequest = {
|
|
624
|
-
...find(
|
|
625
|
-
...find(
|
|
623
|
+
...validBidRequests.find(bid => bid.bidId === id),
|
|
624
|
+
...impressions.find(imp => imp.id === id)
|
|
626
625
|
}
|
|
627
626
|
|
|
628
627
|
return bidRequest;
|