prebid.js 9.4.0 → 9.5.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 +31 -5
- package/.github/workflows/jscpd.yml +2 -2
- package/.github/workflows/linter.yml +107 -0
- package/creative/crossDomain.js +6 -3
- 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/adagioRtdProvider.js +1 -1
- package/dist/adagioUtils.js +1 -1
- package/dist/addefendBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adkernelAdnBidAdapter.js +1 -1
- package/dist/adkernelBidAdapter.js +1 -1
- package/dist/adkernelUtils.js +1 -0
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/admixerBidAdapter.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/advRedAnalyticsAdapter.js +1 -0
- 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/akamaiDapRtdProvider.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/anonymisedRtdProvider.js +1 -1
- package/dist/apacdexBidAdapter.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/azerionedgeRtdProvider.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/chunk-core.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connatixBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/contxtfulRtdProvider.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/currencyUtils.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dailymotionBidAdapter.js +1 -1
- package/dist/debugging-standalone.js +1 -1
- package/dist/dependencies.json +43 -7
- package/dist/dfpAdServerVideo.js +1 -1
- package/dist/dfpAdpod.js +1 -1
- package/dist/dfpUtils.js +1 -1
- package/dist/discoveryBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/dxkultureBidAdapter.js +1 -1
- package/dist/eightPodAnalyticsAdapter.js +1 -1
- package/dist/eightPodBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/exadsBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/fintezaAnalyticsAdapter.js +1 -1
- package/dist/fpdUtils.js +1 -0
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gptPreAuction.js +1 -1
- package/dist/gptUtils.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/growthCodeAnalyticsAdapter.js +1 -1
- package/dist/growthCodeRtdProvider.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/insticatorBidAdapter.js +1 -1
- package/dist/intentIqAnalyticsAdapter.js +1 -0
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/jwplayerBidAdapter.js +1 -1
- package/dist/jwplayerRtdProvider.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/liveIntentIdSystem.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/luceadBidAdapter.js +1 -1
- package/dist/mabidderBidAdapter.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/mediagoBidAdapter.js +1 -1
- package/dist/medianetAnalyticsAdapter.js +1 -1
- package/dist/medianetBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/missenaBidAdapter.js +1 -1
- package/dist/mobianRtdProvider.js +1 -1
- package/dist/nextMillenniumBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/nobidAnalyticsAdapter.js +1 -1
- package/dist/nobidBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +201 -193
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openwebBidAdapter.js +1 -1
- package/dist/openxBidAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/optoutBidAdapter.js +1 -1
- package/dist/orbidderBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/paapi.js +1 -1
- package/dist/permutiveRtdProvider.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/playdigoBidAdapter.js +1 -1
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/programmaticaBidAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/publirBidAdapter.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubxaiAnalyticsAdapter.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/relevatehealthBidAdapter.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/ringieraxelspringerBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/schainSerializer.js +1 -0
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/sizeMapping.js +1 -1
- package/dist/sizeUtils.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/sspBCBidAdapter.js +1 -1
- package/dist/stnBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/symitriDapRtdProvider.js +1 -0
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/tappxBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/targetVideoUtils.js +1 -0
- 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/unrulyBidAdapter.js +1 -1
- package/dist/userAgentUtils.js +1 -0
- package/dist/utiqIdSystem.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/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahooAdsBidAdapter.js +1 -1
- package/dist/yandexIdSystem.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/gpt/x-domain/creative.html +1 -1
- package/libraries/adkernelUtils/adkernelUtils.js +11 -0
- package/libraries/currencyUtils/floor.js +23 -0
- package/libraries/dfpUtils/dfpUtils.js +7 -0
- package/libraries/fpdUtils/deviceInfo.js +58 -0
- package/libraries/fpdUtils/pageInfo.js +73 -0
- package/libraries/gptUtils/gptUtils.js +23 -1
- package/libraries/schainSerializer/schainSerializer.js +24 -0
- package/libraries/sizeUtils/tranformSize.js +43 -0
- package/libraries/targetVideoUtils/bidderUtils.js +178 -0
- package/libraries/targetVideoUtils/constants.js +23 -0
- package/libraries/userAgentUtils/index.js +58 -0
- package/libraries/userAgentUtils/userAgentTypes.enums.js +22 -0
- package/modules/.submodules.json +1 -0
- package/modules/33acrossAnalyticsAdapter.js +2 -0
- package/modules/adagioBidAdapter.js +1 -1
- package/modules/adagioRtdProvider.js +18 -4
- package/modules/adkernelAdnBidAdapter.js +1 -12
- package/modules/adkernelBidAdapter.js +4 -13
- package/modules/adlooxAnalyticsAdapter.js +1 -0
- package/modules/admixerBidAdapter.js +10 -6
- package/modules/admixerBidAdapter.md +7 -10
- package/modules/adtrgtmeBidAdapter.js +1 -1
- package/modules/advRedAnalyticsAdapter.js +198 -0
- package/modules/advRedAnalyticsAdapter.md +30 -0
- package/modules/akamaiDapRtdProvider.js +19 -798
- package/modules/anonymisedRtdProvider.js +5 -1
- package/modules/anonymisedRtdProvider.md +1 -1
- package/modules/apacdexBidAdapter.js +1 -1
- package/modules/appnexusBidAdapter.js +56 -2
- package/modules/automatadAnalyticsAdapter.js +2 -0
- package/modules/azerionedgeRtdProvider.js +13 -3
- package/modules/azerionedgeRtdProvider.md +0 -17
- package/modules/bridBidAdapter.js +47 -47
- package/modules/cleanioRtdProvider.js +1 -0
- package/modules/concertBidAdapter.js +1 -1
- package/modules/connatixBidAdapter.js +36 -8
- package/modules/connectIdSystem.js +3 -1
- package/modules/contxtfulRtdProvider.js +20 -2
- package/modules/contxtfulRtdProvider.md +1 -0
- package/modules/craftBidAdapter.js +1 -1
- package/modules/criteoBidAdapter.js +1 -1
- package/modules/cwireBidAdapter.js +5 -1
- package/modules/dailymotionBidAdapter.js +85 -65
- package/modules/debugging/debugging.js +3 -0
- package/modules/dfpAdServerVideo.js +15 -33
- package/modules/dfpAdpod.js +2 -6
- package/modules/dgkeywordRtdProvider.js +2 -0
- package/modules/discoveryBidAdapter.js +26 -210
- package/modules/dspxBidAdapter.js +176 -54
- package/modules/eightPodAnalyticsAdapter.js +28 -34
- package/modules/eightPodBidAdapter.js +113 -57
- package/modules/fintezaAnalyticsAdapter.js +9 -4
- package/modules/goldbachBidAdapter.js +1 -1
- package/modules/gptPreAuction.js +63 -4
- package/modules/growthCodeAnalyticsAdapter.js +1 -1
- package/modules/growthCodeRtdProvider.js +1 -1
- package/modules/gumgumBidAdapter.js +14 -10
- package/modules/improvedigitalBidAdapter.js +1 -1
- package/modules/intentIqAnalyticsAdapter.js +234 -0
- package/modules/intentIqAnalyticsAdapter.md +27 -0
- package/modules/intentIqIdSystem.md +0 -0
- package/modules/jwplayerBidAdapter.js +1 -1
- package/modules/jwplayerRtdProvider.js +26 -6
- package/modules/jwplayerVideoProvider.js +6 -0
- package/modules/mediafuseBidAdapter.js +1 -1
- package/modules/mediagoBidAdapter.js +7 -176
- package/modules/medianetBidAdapter.js +101 -40
- package/modules/mgidBidAdapter.js +3 -1
- package/modules/mobianRtdProvider.js +16 -2
- package/modules/nextMillenniumBidAdapter.js +1 -27
- package/modules/nobidBidAdapter.js +1 -1
- package/modules/optoutBidAdapter.js +1 -1
- package/modules/paapi.js +48 -35
- package/modules/permutiveRtdProvider.js +72 -22
- package/modules/playdigoBidAdapter.js +4 -2
- package/modules/prebidServerBidAdapter/index.js +4 -2
- package/modules/prebidServerBidAdapter/ortbConverter.js +1 -0
- package/modules/programmaticaBidAdapter.js +1 -1
- package/modules/pubmaticBidAdapter.js +12 -0
- package/modules/pubxaiAnalyticsAdapter.js +306 -164
- package/modules/relevatehealthBidAdapter.js +2 -1
- package/modules/richaudienceBidAdapter.js +1 -1
- package/modules/rtdModule/index.js +5 -3
- package/modules/sirdataRtdProvider.js +2 -0
- package/modules/sizeMapping.js +2 -5
- package/modules/smaatoBidAdapter.js +18 -1
- package/modules/smilewantedBidAdapter.js +26 -22
- package/modules/snigelBidAdapter.js +1 -1
- package/modules/sonobiBidAdapter.js +5 -10
- package/modules/symitriDapRtdProvider.js +812 -0
- package/modules/symitriDapRtdProvider.md +49 -0
- package/modules/targetVideoBidAdapter.js +120 -152
- package/modules/targetVideoBidAdapter.md +20 -3
- package/modules/userId/eids.js +3 -0
- package/modules/utiqIdSystem.js +12 -10
- package/modules/validationFpdModule/index.js +22 -17
- package/modules/videojsVideoProvider.js +3 -0
- package/modules/visxBidAdapter.js +1 -1
- package/modules/winrBidAdapter.js +2 -27
- package/modules/yahooAdsBidAdapter.js +1 -1
- package/modules/yandexIdSystem.js +1 -1
- package/package.json +4 -4
- package/plugins/eslint/index.js +73 -45
- package/src/adRendering.js +7 -3
- package/src/adloader.js +1 -0
- package/src/ajax.js +15 -0
- package/src/config.js +0 -4
- package/src/debugging.js +1 -0
- package/src/secureCreatives.js +1 -1
- package/src/storageManager.js +62 -73
- package/src/targeting.js +26 -20
- package/src/utils.js +9 -0
- package/test/pages/banner_sync.html +97 -0
- package/test/pages/consent_mgt_gdpr.html +1 -1
- package/test/spec/ajax_spec.js +11 -0
- package/test/spec/creative/crossDomainCreative_spec.js +26 -9
- package/test/spec/e2e/banner/basic_banner_ad.spec.js +20 -14
- package/test/spec/fpd/gdpr_spec.js +1 -1
- package/test/spec/libraries/userAgentUtils_spec.js +109 -0
- package/test/spec/modules/adagioRtdProvider_spec.js +72 -0
- package/test/spec/modules/admixerBidAdapter_spec.js +21 -17
- package/test/spec/modules/advRedAnalyticsAdapter_spec.js +114 -0
- package/test/spec/modules/adxcgBidAdapter_spec.js +1 -1
- package/test/spec/modules/appnexusBidAdapter_spec.js +36 -0
- package/test/spec/modules/azerionedgeRtdProvider_spec.js +36 -21
- package/test/spec/modules/connatixBidAdapter_spec.js +55 -2
- package/test/spec/modules/consentManagement_spec.js +1 -1
- package/test/spec/modules/contxtfulRtdProvider_spec.js +6 -0
- package/test/spec/modules/dailymotionBidAdapter_spec.js +497 -4
- package/test/spec/modules/discoveryBidAdapter_spec.js +9 -6
- package/test/spec/modules/dspxBidAdapter_spec.js +188 -7
- package/test/spec/modules/eightPodAnalyticsAdapter_spec.js +22 -13
- package/test/spec/modules/gptPreAuction_spec.js +143 -1
- package/test/spec/modules/gumgumBidAdapter_spec.js +17 -0
- package/test/spec/modules/intentIqAnalyticsAdapter_spec.js +172 -0
- package/test/spec/modules/jwplayerRtdProvider_spec.js +61 -0
- package/test/spec/modules/mediagoBidAdapter_spec.js +34 -37
- package/test/spec/modules/medianetBidAdapter_spec.js +297 -16
- package/test/spec/modules/mgidBidAdapter_spec.js +15 -5
- package/test/spec/modules/mobianRtdProvider_spec.js +1 -3
- package/test/spec/modules/paapi_spec.js +177 -111
- package/test/spec/modules/permutiveRtdProvider_spec.js +42 -8
- package/test/spec/modules/prebidServerBidAdapter_spec.js +17 -3
- package/test/spec/modules/proxistoreBidAdapter_spec.js +1 -1
- package/test/spec/modules/pubmaticBidAdapter_spec.js +40 -0
- package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +970 -603
- package/test/spec/modules/pulsepointBidAdapter_spec.js +4 -4
- package/test/spec/modules/smaatoBidAdapter_spec.js +36 -1
- package/test/spec/modules/smilewantedBidAdapter_spec.js +57 -1
- package/test/spec/modules/symitriDapRtdProvider_spec.js +600 -0
- package/test/spec/modules/targetVideoBidAdapter_spec.js +112 -11
- package/test/spec/modules/yandexIdSystem_spec.js +6 -1
- package/test/spec/schainSerializer/schainSerializer_spec.js +138 -0
- package/test/spec/unit/core/storageManager_spec.js +68 -51
- package/test/spec/utils_spec.js +19 -0
- /package/src/utils/{gpdr.js → gdpr.js} +0 -0
|
@@ -1,204 +1,346 @@
|
|
|
1
|
-
import { deepAccess, parseSizesInput, getWindowLocation, buildUrl } from '../src/utils.js';
|
|
2
|
-
import { ajax } from '../src/ajax.js';
|
|
3
1
|
import adapter from '../libraries/analyticsAdapter/AnalyticsAdapter.js';
|
|
2
|
+
import {
|
|
3
|
+
getGptSlotInfoForAdUnitCode, getGptSlotForAdUnitCode
|
|
4
|
+
} from '../libraries/gptUtils/gptUtils.js';
|
|
5
|
+
import { getDeviceType, getBrowser, getOS } from '../libraries/userAgentUtils/index.js';
|
|
6
|
+
import { MODULE_TYPE_ANALYTICS } from '../src/activities/modules.js';
|
|
4
7
|
import adapterManager from '../src/adapterManager.js';
|
|
8
|
+
import { sendBeacon } from '../src/ajax.js'
|
|
5
9
|
import { EVENTS } from '../src/constants.js';
|
|
6
|
-
import {getGlobal} from '../src/prebidGlobal.js';
|
|
7
|
-
import {
|
|
10
|
+
import { getGlobal } from '../src/prebidGlobal.js';
|
|
11
|
+
import { getStorageManager } from '../src/storageManager.js';
|
|
12
|
+
import {
|
|
13
|
+
deepAccess, parseSizesInput, getWindowLocation, buildUrl, cyrb53Hash
|
|
14
|
+
} from '../src/utils.js';
|
|
15
|
+
|
|
16
|
+
let initOptions;
|
|
8
17
|
|
|
9
18
|
const emptyUrl = '';
|
|
10
19
|
const analyticsType = 'endpoint';
|
|
11
|
-
const
|
|
20
|
+
const adapterCode = 'pubxai';
|
|
21
|
+
const pubxaiAnalyticsVersion = 'v2.0.0';
|
|
12
22
|
const defaultHost = 'api.pbxai.com';
|
|
13
23
|
const auctionPath = '/analytics/auction';
|
|
14
24
|
const winningBidPath = '/analytics/bidwon';
|
|
25
|
+
const storage = getStorageManager({ moduleType: MODULE_TYPE_ANALYTICS, moduleName: adapterCode })
|
|
15
26
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
pageDetail: {},
|
|
23
|
-
deviceDetail: {}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
function getStorage() {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
var pubxaiAnalyticsAdapter = Object.assign(adapter(
|
|
27
|
+
/**
|
|
28
|
+
* The sendCache is a global cache object which tracks the pending sends
|
|
29
|
+
* back to pubx.ai. The data may be removed from this cache, post send.
|
|
30
|
+
*/
|
|
31
|
+
export const sendCache = new Proxy(
|
|
32
|
+
{},
|
|
31
33
|
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
track({ eventType, args }) {
|
|
36
|
-
if (typeof args !== 'undefined') {
|
|
37
|
-
if (eventType === EVENTS.BID_TIMEOUT) {
|
|
38
|
-
args.forEach(item => { mapBidResponse(item, 'timeout'); });
|
|
39
|
-
} else if (eventType === EVENTS.AUCTION_INIT) {
|
|
40
|
-
events.auctionInit = args;
|
|
41
|
-
events.floorDetail = {};
|
|
42
|
-
events.bids = [];
|
|
43
|
-
const floorData = deepAccess(args, 'bidderRequests.0.bids.0.floorData');
|
|
44
|
-
if (typeof floorData !== 'undefined') {
|
|
45
|
-
Object.assign(events.floorDetail, floorData);
|
|
46
|
-
}
|
|
47
|
-
auctionTimestamp = args.timestamp;
|
|
48
|
-
} else if (eventType === EVENTS.BID_RESPONSE) {
|
|
49
|
-
mapBidResponse(args, 'response');
|
|
50
|
-
} else if (eventType === EVENTS.BID_WON) {
|
|
51
|
-
send({
|
|
52
|
-
winningBid: mapBidResponse(args, 'bidwon')
|
|
53
|
-
}, 'bidwon');
|
|
34
|
+
get: (target, name) => {
|
|
35
|
+
if (!target.hasOwnProperty(name)) {
|
|
36
|
+
target[name] = [];
|
|
54
37
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
send(events, 'auctionEnd');
|
|
58
|
-
}
|
|
38
|
+
return target[name];
|
|
39
|
+
},
|
|
59
40
|
}
|
|
60
|
-
|
|
41
|
+
);
|
|
61
42
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
43
|
+
/**
|
|
44
|
+
* auctionCache is a global cache object which stores all auction histories
|
|
45
|
+
* for the session. When getting a key from the auction cache, any
|
|
46
|
+
* information already known about the auction or associated data (floor
|
|
47
|
+
* data configured by prebid, browser data, user data etc) is added to
|
|
48
|
+
* the cache automatically.
|
|
49
|
+
*/
|
|
50
|
+
export const auctionCache = new Proxy(
|
|
51
|
+
{},
|
|
52
|
+
{
|
|
53
|
+
get: (target, name) => {
|
|
54
|
+
if (!target.hasOwnProperty(name)) {
|
|
55
|
+
target[name] = {
|
|
56
|
+
bids: [],
|
|
57
|
+
auctionDetail: {
|
|
58
|
+
refreshRank: Object.keys(target).length,
|
|
59
|
+
auctionId: name,
|
|
60
|
+
},
|
|
61
|
+
floorDetail: {},
|
|
62
|
+
pageDetail: {
|
|
63
|
+
host: getWindowLocation().host,
|
|
64
|
+
path: getWindowLocation().pathname,
|
|
65
|
+
search: getWindowLocation().search,
|
|
66
|
+
},
|
|
67
|
+
deviceDetail: {
|
|
68
|
+
platform: navigator.platform,
|
|
69
|
+
deviceType: getDeviceType(),
|
|
70
|
+
deviceOS: getOS(),
|
|
71
|
+
browser: getBrowser(),
|
|
72
|
+
},
|
|
73
|
+
userDetail: {
|
|
74
|
+
userIdTypes: Object.keys(getGlobal().getUserIds?.() || {}),
|
|
75
|
+
},
|
|
76
|
+
consentDetail: {
|
|
77
|
+
consentTypes: Object.keys(getGlobal().getConsentMetadata?.() || {}),
|
|
78
|
+
},
|
|
79
|
+
pmacDetail: JSON.parse(storage.getDataFromLocalStorage('pubx:pmac')) || {}, // {auction_1: {floor:0.23,maxBid:0.34,bidCount:3},auction_2:{floor:0.13,maxBid:0.14,bidCount:2}
|
|
80
|
+
initOptions: {
|
|
81
|
+
...initOptions,
|
|
82
|
+
auctionId: name, // back-compat
|
|
83
|
+
},
|
|
84
|
+
sendAs: [],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
return target[name];
|
|
88
|
+
},
|
|
105
89
|
}
|
|
106
|
-
|
|
90
|
+
);
|
|
107
91
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Fetch extra ad server data for a specific ad slot (bid)
|
|
94
|
+
* @param {object} bid an output from extractBid
|
|
95
|
+
* @returns {object} key value pairs from the adserver
|
|
96
|
+
*/
|
|
97
|
+
const getAdServerDataForBid = (bid) => {
|
|
98
|
+
const gptSlot = getGptSlotForAdUnitCode(bid);
|
|
99
|
+
if (gptSlot) {
|
|
100
|
+
return Object.fromEntries(
|
|
101
|
+
gptSlot
|
|
102
|
+
.getTargetingKeys()
|
|
103
|
+
.filter(
|
|
104
|
+
(key) =>
|
|
105
|
+
key.startsWith('pubx-') ||
|
|
106
|
+
(key.startsWith('hb_') && (key.match(/_/g) || []).length === 1)
|
|
107
|
+
)
|
|
108
|
+
.map((key) => [key, gptSlot.getTargeting(key)])
|
|
109
|
+
);
|
|
111
110
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
return 'desktop';
|
|
116
|
-
}
|
|
111
|
+
return {}; // TODO: support more ad servers
|
|
112
|
+
};
|
|
117
113
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
114
|
+
/**
|
|
115
|
+
* extracts and derives valuable data from a prebid bidder bidResponse object
|
|
116
|
+
* @param {object} bidResponse a prebid bidder bidResponse (see
|
|
117
|
+
* https://docs.prebid.org/dev-docs/publisher-api-reference/getBidResponses.html)
|
|
118
|
+
* @returns {object}
|
|
119
|
+
*/
|
|
120
|
+
const extractBid = (bidResponse) => {
|
|
121
|
+
return {
|
|
122
|
+
adUnitCode: bidResponse.adUnitCode,
|
|
123
|
+
gptSlotCode:
|
|
124
|
+
getGptSlotInfoForAdUnitCode(bidResponse.adUnitCode).gptSlot || null,
|
|
125
|
+
auctionId: bidResponse.auctionId,
|
|
126
|
+
bidderCode: bidResponse.bidder,
|
|
127
|
+
cpm: bidResponse.cpm,
|
|
128
|
+
creativeId: bidResponse.creativeId,
|
|
129
|
+
dealId: bidResponse.dealId,
|
|
130
|
+
currency: bidResponse.currency,
|
|
131
|
+
floorData: bidResponse.floorData,
|
|
132
|
+
mediaType: bidResponse.mediaType,
|
|
133
|
+
netRevenue: bidResponse.netRevenue,
|
|
134
|
+
requestTimestamp: bidResponse.requestTimestamp,
|
|
135
|
+
responseTimestamp: bidResponse.responseTimestamp,
|
|
136
|
+
status: bidResponse.status,
|
|
137
|
+
sizes: parseSizesInput(bidResponse.size).toString(),
|
|
138
|
+
statusMessage: bidResponse.statusMessage,
|
|
139
|
+
timeToRespond: bidResponse.timeToRespond,
|
|
140
|
+
transactionId: bidResponse.transactionId,
|
|
141
|
+
bidId: bidResponse.bidId || bidResponse.requestId,
|
|
142
|
+
placementId: bidResponse.params
|
|
143
|
+
? deepAccess(bidResponse, 'params.0.placementId')
|
|
144
|
+
: null,
|
|
145
|
+
source: bidResponse.source || 'null',
|
|
146
|
+
};
|
|
147
|
+
};
|
|
127
148
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Track the events emitted by prebid and handle each case. See https://docs.prebid.org/dev-docs/publisher-api-reference/getEvents.html for more info
|
|
151
|
+
* @param {object} event the prebid event emmitted
|
|
152
|
+
* @param {string} event.eventType the type of the event
|
|
153
|
+
* @param {object} event.args the arguments of the emitted event
|
|
154
|
+
*/
|
|
155
|
+
const track = ({ eventType, args }) => {
|
|
156
|
+
switch (eventType) {
|
|
157
|
+
// handle invalid bids, and remove them from the adUnit cache
|
|
158
|
+
case EVENTS.BID_TIMEOUT:
|
|
159
|
+
args.map(extractBid).forEach((bid) => {
|
|
160
|
+
bid.renderStatus = 3;
|
|
161
|
+
auctionCache[bid.auctionId].bids.push(bid);
|
|
162
|
+
});
|
|
163
|
+
break;
|
|
164
|
+
// handle valid bid responses and record them as part of an auction
|
|
165
|
+
case EVENTS.BID_RESPONSE:
|
|
166
|
+
const bid = Object.assign(extractBid(args), { renderStatus: 2 });
|
|
167
|
+
auctionCache[bid.auctionId].bids.push(bid);
|
|
168
|
+
break;
|
|
169
|
+
// capture extra information from the auction, and if there were no bids
|
|
170
|
+
// (and so no chance of a win) send the auction
|
|
171
|
+
case EVENTS.AUCTION_END:
|
|
172
|
+
Object.assign(
|
|
173
|
+
auctionCache[args.auctionId].floorDetail,
|
|
174
|
+
args.adUnits
|
|
175
|
+
.map((i) => i?.bids.length && i.bids[0]?.floorData)
|
|
176
|
+
.find((i) => i) || {}
|
|
177
|
+
);
|
|
178
|
+
auctionCache[args.auctionId].deviceDetail.cdep = args.bidderRequests
|
|
179
|
+
.map((bidRequest) => bidRequest.ortb2?.device?.ext?.cdep)
|
|
180
|
+
.find((i) => i);
|
|
181
|
+
Object.assign(auctionCache[args.auctionId].auctionDetail, {
|
|
182
|
+
adUnitCodes: args.adUnits.map((i) => i.code),
|
|
183
|
+
timestamp: args.timestamp,
|
|
184
|
+
});
|
|
185
|
+
if (
|
|
186
|
+
auctionCache[args.auctionId].bids.every((bid) => bid.renderStatus === 3)
|
|
187
|
+
) {
|
|
188
|
+
prepareSend(args.auctionId);
|
|
189
|
+
}
|
|
190
|
+
break;
|
|
191
|
+
// send the prebid winning bid back to pubx
|
|
192
|
+
case EVENTS.BID_WON:
|
|
193
|
+
const winningBid = extractBid(args);
|
|
194
|
+
const floorDetail = auctionCache[winningBid.auctionId].floorDetail;
|
|
195
|
+
Object.assign(winningBid, {
|
|
196
|
+
floorProvider: floorDetail?.floorProvider || null,
|
|
197
|
+
floorFetchStatus: floorDetail?.fetchStatus || null,
|
|
198
|
+
floorLocation: floorDetail?.location || null,
|
|
199
|
+
floorModelVersion: floorDetail?.modelVersion || null,
|
|
200
|
+
floorSkipRate: floorDetail?.skipRate || 0,
|
|
201
|
+
isFloorSkipped: floorDetail?.skipped || false,
|
|
202
|
+
isWinningBid: true,
|
|
203
|
+
renderedSize: args.size,
|
|
204
|
+
renderStatus: 4,
|
|
205
|
+
});
|
|
206
|
+
winningBid.adServerData = getAdServerDataForBid(winningBid);
|
|
207
|
+
auctionCache[winningBid.auctionId].winningBid = winningBid;
|
|
208
|
+
prepareSend(winningBid.auctionId);
|
|
209
|
+
break;
|
|
210
|
+
// do nothing
|
|
211
|
+
default:
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
};
|
|
137
215
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
216
|
+
/**
|
|
217
|
+
* If true, send data back to pubxai
|
|
218
|
+
* @param {string} auctionId
|
|
219
|
+
* @param {number} samplingRate
|
|
220
|
+
* @returns {boolean}
|
|
221
|
+
*/
|
|
222
|
+
const shouldFireEventRequest = (auctionId, samplingRate = 1) => {
|
|
223
|
+
return parseInt(cyrb53Hash(auctionId)) % samplingRate === 0;
|
|
141
224
|
};
|
|
142
225
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
226
|
+
/**
|
|
227
|
+
* prepare the payload for sending auction data back to pubx.ai
|
|
228
|
+
* @param {string} auctionId the auction to send
|
|
229
|
+
*/
|
|
230
|
+
const prepareSend = (auctionId) => {
|
|
231
|
+
const auctionData = Object.assign({}, auctionCache[auctionId]);
|
|
232
|
+
if (!shouldFireEventRequest(auctionId, initOptions.samplingRate)) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
[
|
|
236
|
+
{
|
|
237
|
+
path: winningBidPath,
|
|
238
|
+
requiredKeys: [
|
|
239
|
+
'winningBid',
|
|
240
|
+
'pageDetail',
|
|
241
|
+
'deviceDetail',
|
|
242
|
+
'floorDetail',
|
|
243
|
+
'auctionDetail',
|
|
244
|
+
'userDetail',
|
|
245
|
+
'consentDetail',
|
|
246
|
+
'pmacDetail',
|
|
247
|
+
'initOptions',
|
|
248
|
+
],
|
|
249
|
+
eventType: 'win',
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
path: auctionPath,
|
|
253
|
+
requiredKeys: [
|
|
254
|
+
'bids',
|
|
255
|
+
'pageDetail',
|
|
256
|
+
'deviceDetail',
|
|
257
|
+
'floorDetail',
|
|
258
|
+
'auctionDetail',
|
|
259
|
+
'userDetail',
|
|
260
|
+
'consentDetail',
|
|
261
|
+
'pmacDetail',
|
|
262
|
+
'initOptions',
|
|
263
|
+
],
|
|
264
|
+
eventType: 'auction',
|
|
265
|
+
},
|
|
266
|
+
].forEach(({ path, requiredKeys, eventType }) => {
|
|
267
|
+
const data = Object.fromEntries(
|
|
268
|
+
requiredKeys.map((key) => [key, auctionData[key]])
|
|
269
|
+
);
|
|
270
|
+
if (
|
|
271
|
+
auctionCache[auctionId].sendAs.includes(eventType) ||
|
|
272
|
+
!requiredKeys.every((key) => !!auctionData[key])
|
|
273
|
+
) {
|
|
274
|
+
return;
|
|
165
275
|
}
|
|
166
|
-
|
|
167
|
-
Object.assign(data.deviceDetail, {
|
|
168
|
-
platform: navigator.platform,
|
|
169
|
-
deviceType: getDeviceType(),
|
|
170
|
-
deviceOS: getOS(),
|
|
171
|
-
browser: getBrowser()
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
let pubxaiAnalyticsRequestUrl = buildUrl({
|
|
276
|
+
const pubxaiAnalyticsRequestUrl = buildUrl({
|
|
175
277
|
protocol: 'https',
|
|
176
|
-
hostname:
|
|
177
|
-
|
|
278
|
+
hostname:
|
|
279
|
+
(auctionData.initOptions && auctionData.initOptions.hostName) ||
|
|
280
|
+
defaultHost,
|
|
281
|
+
pathname: path,
|
|
178
282
|
search: {
|
|
179
|
-
auctionTimestamp:
|
|
283
|
+
auctionTimestamp: auctionData.auctionDetail.timestamp,
|
|
180
284
|
pubxaiAnalyticsVersion: pubxaiAnalyticsVersion,
|
|
181
|
-
prebidVersion:
|
|
285
|
+
prebidVersion: '$prebid.version$',
|
|
286
|
+
},
|
|
287
|
+
});
|
|
288
|
+
sendCache[pubxaiAnalyticsRequestUrl].push(data);
|
|
289
|
+
auctionCache[auctionId].sendAs.push(eventType);
|
|
290
|
+
});
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
const send = () => {
|
|
294
|
+
const toBlob = (d) => new Blob([JSON.stringify(d)], { type: 'text/json' });
|
|
295
|
+
|
|
296
|
+
Object.entries(sendCache).forEach(([requestUrl, events]) => {
|
|
297
|
+
let payloadStart = 0;
|
|
298
|
+
|
|
299
|
+
events.forEach((event, index, arr) => {
|
|
300
|
+
const payload = arr.slice(payloadStart, index + 2);
|
|
301
|
+
const payloadTooLarge = toBlob(payload).size > 65536;
|
|
302
|
+
|
|
303
|
+
if (payloadTooLarge || index + 1 === arr.length) {
|
|
304
|
+
sendBeacon(
|
|
305
|
+
requestUrl,
|
|
306
|
+
toBlob(payloadTooLarge ? payload.slice(0, -1) : payload)
|
|
307
|
+
);
|
|
308
|
+
payloadStart = index;
|
|
182
309
|
}
|
|
183
310
|
});
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
311
|
+
|
|
312
|
+
events.splice(0);
|
|
313
|
+
});
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
// register event listener to send logs when user leaves page
|
|
317
|
+
if (document.visibilityState) {
|
|
318
|
+
document.addEventListener('visibilitychange', () => {
|
|
319
|
+
if (document.visibilityState === 'hidden') {
|
|
320
|
+
send();
|
|
189
321
|
}
|
|
190
|
-
}
|
|
322
|
+
});
|
|
191
323
|
}
|
|
192
324
|
|
|
193
|
-
|
|
194
|
-
pubxaiAnalyticsAdapter
|
|
325
|
+
// declare the analytics adapter
|
|
326
|
+
var pubxaiAnalyticsAdapter = Object.assign(
|
|
327
|
+
adapter({
|
|
328
|
+
emptyUrl,
|
|
329
|
+
analyticsType,
|
|
330
|
+
}),
|
|
331
|
+
{ track }
|
|
332
|
+
);
|
|
333
|
+
|
|
334
|
+
pubxaiAnalyticsAdapter.originEnableAnalytics =
|
|
335
|
+
pubxaiAnalyticsAdapter.enableAnalytics;
|
|
336
|
+
pubxaiAnalyticsAdapter.enableAnalytics = (config) => {
|
|
195
337
|
initOptions = config.options;
|
|
196
338
|
pubxaiAnalyticsAdapter.originEnableAnalytics(config);
|
|
197
339
|
};
|
|
198
340
|
|
|
199
341
|
adapterManager.registerAnalyticsAdapter({
|
|
200
342
|
adapter: pubxaiAnalyticsAdapter,
|
|
201
|
-
code:
|
|
343
|
+
code: adapterCode,
|
|
202
344
|
});
|
|
203
345
|
|
|
204
346
|
export default pubxaiAnalyticsAdapter;
|
|
@@ -142,7 +142,8 @@ function buildUser(bid) {
|
|
|
142
142
|
if (bid && bid.params) {
|
|
143
143
|
return {
|
|
144
144
|
id: bid.params.user_id && typeof bid.params.user_id == 'string' ? bid.params.user_id : '',
|
|
145
|
-
|
|
145
|
+
// TODO: commented out because of rule violations
|
|
146
|
+
buyeruid: '', // localStorage.getItem('adx_profile_guid') ? localStorage.getItem('adx_profile_guid') : '',
|
|
146
147
|
keywords: bid.params.keywords && typeof bid.params.keywords == 'string' ? bid.params.keywords : '',
|
|
147
148
|
customdata: bid.params.customdata && typeof bid.params.customdata == 'string' ? bid.params.customdata : ''
|
|
148
149
|
};
|
|
@@ -151,7 +151,7 @@ export const spec = {
|
|
|
151
151
|
*
|
|
152
152
|
* @param {syncOptions} Publisher prebid configuration
|
|
153
153
|
* @param {serverResponses} Response from the server
|
|
154
|
-
* @param {gdprConsent}
|
|
154
|
+
* @param {gdprConsent} GDPR consent object
|
|
155
155
|
* @returns {Array}
|
|
156
156
|
*/
|
|
157
157
|
getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent, gppConsent) {
|
|
@@ -188,10 +188,12 @@ let _dataProviders = [];
|
|
|
188
188
|
let _userConsent;
|
|
189
189
|
|
|
190
190
|
/**
|
|
191
|
-
* Register a RTD submodule.
|
|
191
|
+
* Register a Real-Time Data (RTD) submodule.
|
|
192
192
|
*
|
|
193
|
-
* @param {
|
|
194
|
-
* @
|
|
193
|
+
* @param {Object} submodule The RTD submodule to register.
|
|
194
|
+
* @param {string} submodule.name The name of the RTD submodule.
|
|
195
|
+
* @param {number} [submodule.gvlid] The Global Vendor List ID (GVLID) of the RTD submodule.
|
|
196
|
+
* @returns {function(): void} A de-registration function that will unregister the module when called.
|
|
195
197
|
*/
|
|
196
198
|
export function attachRealTimeDataProvider(submodule) {
|
|
197
199
|
registeredSubModules.push(submodule);
|
|
@@ -219,6 +219,8 @@ export function postContentForSemanticAnalysis(postContentToken, actualUrl) {
|
|
|
219
219
|
|
|
220
220
|
// Use the Beacon API if supported to send the payload
|
|
221
221
|
if ('sendBeacon' in navigator) {
|
|
222
|
+
// TODO FIX RULES VIOLATION
|
|
223
|
+
// eslint-disable-next-line prebid/no-member
|
|
222
224
|
navigator.sendBeacon(url, payload);
|
|
223
225
|
} else {
|
|
224
226
|
// Fallback to using AJAX if Beacon API is not supported
|
package/modules/sizeMapping.js
CHANGED
|
@@ -4,7 +4,6 @@ import {includes} from '../src/polyfill.js';
|
|
|
4
4
|
import {BANNER, VIDEO} from '../src/mediaTypes.js';
|
|
5
5
|
import {setupAdUnitMediaTypes} from '../src/adapterManager.js';
|
|
6
6
|
|
|
7
|
-
let installed = false;
|
|
8
7
|
let sizeConfig = [];
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -24,11 +23,9 @@ let sizeConfig = [];
|
|
|
24
23
|
*/
|
|
25
24
|
export function setSizeConfig(config) {
|
|
26
25
|
sizeConfig = config;
|
|
27
|
-
if (!installed) {
|
|
28
|
-
setupAdUnitMediaTypes.before((next, adUnit, labels) => next(processAdUnitsForLabels(adUnit, labels), labels));
|
|
29
|
-
installed = true;
|
|
30
|
-
}
|
|
31
26
|
}
|
|
27
|
+
|
|
28
|
+
setupAdUnitMediaTypes.before((next, adUnit, labels) => next(processAdUnitsForLabels(adUnit, labels), labels));
|
|
32
29
|
config.getConfig('sizeConfig', config => setSizeConfig(config.sizeConfig));
|
|
33
30
|
|
|
34
31
|
/**
|
|
@@ -19,10 +19,11 @@ import {ortbConverter} from '../libraries/ortbConverter/converter.js';
|
|
|
19
19
|
|
|
20
20
|
const BIDDER_CODE = 'smaato';
|
|
21
21
|
const SMAATO_ENDPOINT = 'https://prebid.ad.smaato.net/oapi/prebid';
|
|
22
|
-
const SMAATO_CLIENT = 'prebid_js_$prebid.version$_3.
|
|
22
|
+
const SMAATO_CLIENT = 'prebid_js_$prebid.version$_3.2'
|
|
23
23
|
const TTL = 300;
|
|
24
24
|
const CURRENCY = 'USD';
|
|
25
25
|
const SUPPORTED_MEDIA_TYPES = [BANNER, VIDEO, NATIVE];
|
|
26
|
+
const SYNC_URL = 'https://s.ad.smaato.net/c/?adExInit=p'
|
|
26
27
|
|
|
27
28
|
export const spec = {
|
|
28
29
|
code: BIDDER_CODE,
|
|
@@ -196,6 +197,22 @@ export const spec = {
|
|
|
196
197
|
* @return {UserSync[]} The user syncs which should be dropped.
|
|
197
198
|
*/
|
|
198
199
|
getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => {
|
|
200
|
+
if (syncOptions && syncOptions.pixelEnabled) {
|
|
201
|
+
let gdprParams = '';
|
|
202
|
+
if (gdprConsent && gdprConsent.consentString) {
|
|
203
|
+
if (typeof gdprConsent.gdprApplies === 'boolean') {
|
|
204
|
+
gdprParams = `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
|
|
205
|
+
} else {
|
|
206
|
+
gdprParams = `&gdpr_consent=${gdprConsent.consentString}`;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return [{
|
|
211
|
+
type: 'image',
|
|
212
|
+
url: SYNC_URL + gdprParams
|
|
213
|
+
}];
|
|
214
|
+
}
|
|
215
|
+
|
|
199
216
|
return [];
|
|
200
217
|
}
|
|
201
218
|
}
|