prebid.js 5.14.0 → 5.18.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/.devcontainer/Dockerfile +11 -0
- package/.devcontainer/devcontainer.json +27 -0
- package/.devcontainer/postCreate.sh +6 -0
- package/allowedModules.js +2 -1
- package/integrationExamples/gpt/afpExample.html +242 -0
- package/integrationExamples/gpt/afpGamExample.html +152 -0
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +126 -0
- package/modules/.submodules.json +29 -27
- package/modules/33acrossBidAdapter.js +23 -20
- package/modules/a4gBidAdapter.js +3 -3
- package/modules/ablidaBidAdapter.js +2 -2
- package/modules/adWMGBidAdapter.js +4 -4
- package/modules/adagioAnalyticsAdapter.js +4 -4
- package/modules/adagioBidAdapter.js +85 -82
- package/modules/adbookpspBidAdapter.js +56 -54
- package/modules/adfBidAdapter.js +24 -16
- package/modules/adgenerationBidAdapter.js +42 -18
- package/modules/adhashBidAdapter.js +105 -0
- package/modules/adhashBidAdapter.md +1 -1
- package/modules/adkernelAdnAnalyticsAdapter.js +6 -6
- package/modules/adkernelAdnBidAdapter.js +23 -23
- package/modules/adkernelBidAdapter.js +49 -44
- package/modules/adlooxAdServerVideo.js +26 -26
- package/modules/adlooxAnalyticsAdapter.js +38 -35
- package/modules/adlooxRtdProvider.js +49 -46
- package/modules/admanBidAdapter.js +4 -4
- package/modules/admixerBidAdapter.js +13 -2
- package/modules/admixerIdSystem.js +4 -4
- package/modules/adnowBidAdapter.js +4 -4
- package/modules/adnuntiusBidAdapter.js +6 -5
- package/modules/adoceanBidAdapter.js +10 -10
- package/modules/adpartnerBidAdapter.js +3 -3
- package/modules/adpod.js +45 -42
- package/modules/adprimeBidAdapter.js +4 -4
- package/modules/adqueryBidAdapter.js +204 -0
- package/modules/adqueryBidAdapter.md +32 -0
- package/modules/adrelevantisBidAdapter.js +30 -27
- package/modules/adriverBidAdapter.js +13 -13
- package/modules/adtargetBidAdapter.js +24 -24
- package/modules/adtelligentBidAdapter.js +29 -29
- package/modules/adtrueBidAdapter.js +35 -35
- package/modules/aduptechBidAdapter.js +10 -10
- package/modules/advangelistsBidAdapter.js +14 -14
- package/modules/adxcgAnalyticsAdapter.js +5 -5
- package/modules/adxcgBidAdapter.js +56 -56
- package/modules/adxpremiumAnalyticsAdapter.js +17 -17
- package/modules/adyoulikeBidAdapter.js +11 -11
- package/modules/afpBidAdapter.js +166 -0
- package/modules/afpBidAdapter.md +348 -0
- package/modules/ajaBidAdapter.js +12 -12
- package/modules/akamaiDAPIdSystem.js +9 -9
- package/modules/aniviewBidAdapter.js +2 -2
- package/modules/aolBidAdapter.js +15 -14
- package/modules/apacdexBidAdapter.js +16 -16
- package/modules/appnexusBidAdapter.js +59 -59
- package/modules/apstreamBidAdapter.js +5 -5
- package/modules/asoBidAdapter.js +30 -30
- package/modules/astraoneBidAdapter.js +2 -2
- package/modules/atsAnalyticsAdapter.js +35 -30
- package/modules/audiencerunBidAdapter.js +15 -15
- package/modules/automatadBidAdapter.js +2 -2
- package/modules/axonixBidAdapter.js +7 -7
- package/modules/beachfrontBidAdapter.js +23 -23
- package/modules/beopBidAdapter.js +22 -22
- package/modules/bidViewabilityIO.js +7 -7
- package/modules/bidglassBidAdapter.js +8 -8
- package/modules/bidscubeBidAdapter.js +3 -3
- package/modules/bizzclickBidAdapter.js +10 -10
- package/modules/bliinkBidAdapter.js +58 -32
- package/modules/bliinkBidAdapter.md +29 -6
- package/modules/bluebillywigBidAdapter.js +30 -30
- package/modules/boldwinBidAdapter.js +4 -4
- package/modules/braveBidAdapter.js +5 -5
- package/modules/bridgewellBidAdapter.js +5 -5
- package/modules/brightMountainMediaBidAdapter.js +10 -10
- package/modules/brightcomBidAdapter.js +18 -18
- package/modules/britepoolIdSystem.js +7 -7
- package/modules/browsiRtdProvider.js +8 -8
- package/modules/bucksenseBidAdapter.js +9 -9
- package/modules/buzzoolaBidAdapter.js +4 -4
- package/modules/byDataAnalyticsAdapter.js +12 -12
- package/modules/ccxBidAdapter.js +38 -38
- package/modules/cleanmedianetBidAdapter.js +9 -9
- package/modules/clickforceBidAdapter.js +4 -4
- package/modules/cointrafficBidAdapter.js +4 -4
- package/modules/coinzillaBidAdapter.js +2 -2
- package/modules/colossussspBidAdapter.js +7 -3
- package/modules/concertAnalyticsAdapter.js +3 -3
- package/modules/concertBidAdapter.js +16 -17
- package/modules/connectadBidAdapter.js +13 -13
- package/modules/consentManagement.js +29 -28
- package/modules/consentManagementUsp.js +14 -14
- package/modules/consumableBidAdapter.js +3 -3
- package/modules/contentexchangeBidAdapter.js +5 -5
- package/modules/conversantBidAdapter.js +32 -31
- package/modules/cpmstarBidAdapter.js +8 -9
- package/modules/craftBidAdapter.js +10 -10
- package/modules/criteoBidAdapter.js +16 -16
- package/modules/criteoIdSystem.js +5 -5
- package/modules/currency.js +18 -18
- package/modules/cwireBidAdapter.js +272 -0
- package/modules/cwireBidAdapter.md +43 -0
- package/modules/datablocksBidAdapter.js +12 -12
- package/modules/deepintentBidAdapter.js +13 -13
- package/modules/dgkeywordRtdProvider.js +10 -11
- package/modules/districtmDMXBidAdapter.js +15 -15
- package/modules/dmdIdSystem.js +5 -5
- package/modules/docereeBidAdapter.js +9 -9
- package/modules/dspxBidAdapter.js +5 -5
- package/modules/ebdrBidAdapter.js +9 -9
- package/modules/emx_digitalBidAdapter.js +23 -23
- package/modules/enrichmentFpdModule.js +10 -9
- package/modules/eplanningAnalyticsAdapter.js +2 -2
- package/modules/eplanningBidAdapter.js +10 -10
- package/modules/etargetBidAdapter.js +4 -4
- package/modules/express.js +9 -10
- package/modules/fabrickIdSystem.js +6 -6
- package/modules/feedadBidAdapter.js +5 -5
- package/modules/fintezaAnalyticsAdapter.js +4 -4
- package/modules/flocIdSystem.js +5 -5
- package/modules/fluctBidAdapter.js +6 -5
- package/modules/freewheel-sspBidAdapter.js +6 -6
- package/modules/gamoshiBidAdapter.js +22 -22
- package/modules/gdprEnforcement.js +13 -14
- package/modules/getintentBidAdapter.js +3 -4
- package/modules/glimpseBidAdapter.js +160 -48
- package/modules/glimpseBidAdapter.md +11 -74
- package/modules/gmosspBidAdapter.js +17 -17
- package/modules/gnetBidAdapter.js +5 -5
- package/modules/googleAnalyticsAdapter.js +6 -6
- package/modules/gothamadsBidAdapter.js +9 -9
- package/modules/gptPreAuction.js +7 -7
- package/modules/gridBidAdapter.js +15 -16
- package/modules/gridNMBidAdapter.js +214 -63
- package/modules/growadvertisingBidAdapter.js +7 -8
- package/modules/gumgumBidAdapter.js +19 -13
- package/modules/h12mediaBidAdapter.js +12 -12
- package/modules/haloIdSystem.js +8 -8
- package/modules/hybridBidAdapter.js +7 -7
- package/modules/iasRtdProvider.js +79 -63
- package/modules/id5IdSystem.js +24 -24
- package/modules/idImportLibrary.js +35 -35
- package/modules/idxIdSystem.js +3 -3
- package/modules/impactifyBidAdapter.js +10 -10
- package/modules/improvedigitalBidAdapter.js +36 -36
- package/modules/imuIdSystem.js +6 -6
- package/modules/inmarBidAdapter.js +2 -2
- package/modules/innityBidAdapter.js +3 -3
- package/modules/inskinBidAdapter.js +14 -2
- package/modules/inskinBidAdapter.md +5 -4
- package/modules/instreamTracking.js +5 -5
- package/modules/integr8BidAdapter.js +4 -4
- package/modules/intentIqIdSystem.js +7 -7
- package/modules/interactiveOffersBidAdapter.js +5 -5
- package/modules/invibesBidAdapter.js +53 -19
- package/modules/invisiblyAnalyticsAdapter.js +5 -5
- package/modules/iqmBidAdapter.js +19 -19
- package/modules/iqzoneBidAdapter.js +5 -5
- package/modules/ixBidAdapter.js +73 -73
- package/modules/jixieBidAdapter.js +6 -6
- package/modules/justpremiumBidAdapter.js +5 -1
- package/modules/kargoBidAdapter.js +16 -9
- package/modules/kargoBidAdapter.md +20 -0
- package/modules/kinessoIdSystem.js +8 -8
- package/modules/koblerBidAdapter.js +12 -12
- package/modules/konduitAnalyticsAdapter.js +4 -4
- package/modules/konduitWrapper.js +14 -14
- package/modules/krushmediaBidAdapter.js +4 -4
- package/modules/kubientBidAdapter.js +5 -5
- package/modules/limelightDigitalBidAdapter.js +4 -4
- package/modules/liveIntentIdSystem.js +4 -5
- package/modules/livewrappedAnalyticsAdapter.js +27 -15
- package/modules/livewrappedBidAdapter.js +7 -7
- package/modules/liveyieldAnalyticsAdapter.js +13 -13
- package/modules/lockerdomeBidAdapter.js +2 -2
- package/modules/loganBidAdapter.js +4 -4
- package/modules/lotamePanoramaIdSystem.js +13 -13
- package/modules/lunamediahbBidAdapter.js +2 -2
- package/modules/madvertiseBidAdapter.js +3 -3
- package/modules/marsmediaBidAdapter.js +26 -26
- package/modules/mathildeadsBidAdapter.js +5 -5
- package/modules/mediaforceBidAdapter.js +11 -11
- package/modules/mediakeysBidAdapter.js +444 -53
- package/modules/mediakeysBidAdapter.md +108 -0
- package/modules/medianetAnalyticsAdapter.js +48 -125
- package/modules/medianetBidAdapter.js +38 -33
- package/modules/medianetRtdProvider.js +7 -7
- package/modules/merkleIdSystem.js +19 -19
- package/modules/mgidBidAdapter.js +50 -50
- package/modules/microadBidAdapter.js +3 -3
- package/modules/multibid/index.js +15 -13
- package/modules/mwOpenLinkIdSystem.js +7 -7
- package/modules/mytargetBidAdapter.js +112 -0
- package/modules/nativoBidAdapter.js +46 -31
- package/modules/nativoBidAdapter.md +0 -1
- package/modules/naveggIdSystem.js +3 -3
- package/modules/nextMillenniumBidAdapter.js +6 -6
- package/modules/nextrollBidAdapter.js +375 -0
- package/modules/nobidBidAdapter.js +12 -11
- package/modules/novatiqIdSystem.js +8 -8
- package/modules/oguryBidAdapter.js +22 -6
- package/modules/oneVideoBidAdapter.js +20 -20
- package/modules/onomagicBidAdapter.js +16 -16
- package/modules/ooloAnalyticsAdapter.js +13 -13
- package/modules/openwebBidAdapter.js +26 -26
- package/modules/openxAnalyticsAdapter.js +33 -33
- package/modules/openxBidAdapter.js +29 -29
- package/modules/operaadsBidAdapter.js +53 -53
- package/modules/optimeraRtdProvider.js +9 -9
- package/modules/optoutBidAdapter.js +3 -3
- package/modules/orbidderBidAdapter.js +3 -3
- package/modules/outbrainBidAdapter.js +13 -13
- package/modules/ozoneBidAdapter.js +131 -131
- package/modules/padsquadBidAdapter.js +4 -4
- package/modules/parrableIdSystem.js +17 -17
- package/modules/pixfutureBidAdapter.js +45 -25
- package/modules/pixfutureBidAdapter.md +127 -0
- package/modules/prebidServerBidAdapter/index.js +109 -105
- package/modules/prebidmanagerAnalyticsAdapter.js +7 -7
- package/modules/priceFloors.js +47 -47
- package/modules/proxistoreBidAdapter.js +6 -8
- package/modules/pubCommonId.js +11 -11
- package/modules/pubProvidedIdSystem.js +3 -3
- package/modules/publinkIdSystem.js +23 -7
- package/modules/publinkIdSystem.md +7 -2
- package/modules/pubmaticAnalyticsAdapter.js +16 -16
- package/modules/pubmaticBidAdapter.js +109 -93
- package/modules/pubmaticBidAdapter.md +1 -1
- package/modules/pubperfAnalyticsAdapter.js +3 -3
- package/modules/pubwiseAnalyticsAdapter.js +6 -6
- package/modules/pubwiseBidAdapter.js +23 -23
- package/modules/pubxBidAdapter.js +2 -2
- package/modules/pubxaiAnalyticsAdapter.js +7 -7
- package/modules/pulsepointBidAdapter.js +13 -13
- package/modules/pxyzBidAdapter.js +7 -7
- package/modules/quantcastBidAdapter.js +16 -16
- package/modules/radsBidAdapter.js +5 -5
- package/modules/realvuAnalyticsAdapter.js +5 -7
- package/modules/reconciliationRtdProvider.js +6 -6
- package/modules/relaidoBidAdapter.js +44 -38
- package/modules/resetdigitalBidAdapter.js +3 -4
- package/modules/revcontentBidAdapter.js +9 -9
- package/modules/rhythmoneBidAdapter.js +17 -16
- package/modules/richaudienceBidAdapter.js +9 -9
- package/modules/riseBidAdapter.js +26 -26
- package/modules/riseBidAdapter.md +1 -3
- package/modules/roxotAnalyticsAdapter.js +14 -14
- package/modules/rtbhouseBidAdapter.js +7 -7
- package/modules/rtbsapeBidAdapter.js +3 -4
- package/modules/rtdModule/index.js +3 -3
- package/modules/rubiconAnalyticsAdapter.js +82 -82
- package/modules/rubiconBidAdapter.js +72 -68
- package/modules/scaleableAnalyticsAdapter.js +2 -2
- package/modules/seedingAllianceBidAdapter.js +231 -0
- package/modules/seedtagBidAdapter.js +10 -10
- package/modules/sharedIdSystem.js +11 -11
- package/modules/sharethroughAnalyticsAdapter.js +8 -8
- package/modules/sharethroughBidAdapter.js +20 -27
- package/modules/showheroes-bsBidAdapter.js +23 -23
- package/modules/sigmoidAnalyticsAdapter.js +4 -5
- package/modules/sirdataRtdProvider.js +34 -34
- package/modules/sizeMappingV2.js +39 -39
- package/modules/slimcutBidAdapter.js +121 -0
- package/modules/smaatoBidAdapter.js +44 -44
- package/modules/smartadserverBidAdapter.js +7 -7
- package/modules/smartxBidAdapter.js +72 -72
- package/modules/smartyadsBidAdapter.js +2 -2
- package/modules/smilewantedBidAdapter.js +6 -6
- package/modules/sonobiAnalyticsAdapter.js +23 -23
- package/modules/sortableAnalyticsAdapter.js +5 -5
- package/modules/sortableBidAdapter.js +28 -28
- package/modules/sovrnAnalyticsAdapter.js +5 -5
- package/modules/sovrnBidAdapter.js +22 -22
- package/modules/spotxBidAdapter.js +97 -83
- package/modules/sspBCBidAdapter.js +216 -21
- package/modules/sspBCBidAdapter.md +1 -1
- package/modules/staqAnalyticsAdapter.js +9 -9
- package/modules/stroeerCoreBidAdapter.js +16 -16
- package/modules/sublimeBidAdapter.js +6 -6
- package/modules/talkadsBidAdapter.js +129 -0
- package/modules/talkadsBidAdapter.md +60 -0
- package/modules/tapadIdSystem.js +3 -3
- package/modules/tappxBidAdapter.js +63 -64
- package/modules/teadsBidAdapter.js +20 -20
- package/modules/telariaBidAdapter.js +17 -17
- package/modules/temedyaBidAdapter.js +4 -4
- package/modules/terceptAnalyticsAdapter.js +4 -4
- package/modules/theAdxBidAdapter.js +16 -16
- package/modules/timeoutRtdProvider.js +15 -15
- package/modules/tpmnBidAdapter.js +3 -3
- package/modules/trionBidAdapter.js +15 -15
- package/modules/tripleliftBidAdapter.js +27 -24
- package/modules/truereachBidAdapter.js +4 -4
- package/modules/trustxBidAdapter.js +22 -18
- package/modules/ucfunnelBidAdapter.js +3 -3
- package/modules/uid2IdSystem.js +6 -6
- package/modules/underdogmediaBidAdapter.js +4 -4
- package/modules/unicornBidAdapter.js +15 -15
- package/modules/unifiedIdSystem.js +4 -4
- package/modules/unrulyBidAdapter.js +16 -16
- package/modules/userId/eids.js +9 -9
- package/modules/userId/index.js +37 -35
- package/modules/validationFpdModule/index.js +15 -15
- package/modules/vdoaiBidAdapter.js +2 -2
- package/modules/verizonMediaIdSystem.js +5 -5
- package/modules/vidazooBidAdapter.js +5 -5
- package/modules/videobyteBidAdapter.js +24 -24
- package/modules/videoreachBidAdapter.js +7 -7
- package/modules/vidoomyBidAdapter.js +105 -22
- package/modules/viewdeosDXBidAdapter.js +17 -17
- package/modules/visxBidAdapter.js +21 -29
- package/modules/voxBidAdapter.js +7 -7
- package/modules/vuukleBidAdapter.js +2 -2
- package/modules/waardexBidAdapter.js +26 -26
- package/modules/weboramaRtdProvider.js +174 -0
- package/modules/weboramaRtdProvider.md +70 -0
- package/modules/winrBidAdapter.js +27 -27
- package/modules/wipesBidAdapter.js +2 -2
- package/modules/yahoosspBidAdapter.js +637 -0
- package/modules/yahoosspBidAdapter.md +795 -0
- package/modules/yieldlabBidAdapter.js +57 -12
- package/modules/yieldlabBidAdapter.md +16 -1
- package/modules/yieldliftBidAdapter.js +9 -9
- package/modules/yieldmoBidAdapter.js +64 -50
- package/modules/yieldoneAnalyticsAdapter.js +6 -6
- package/modules/yieldoneBidAdapter.js +11 -11
- package/modules/yuktamediaAnalyticsAdapter.js +15 -15
- package/modules/zeotapIdPlusIdSystem.js +2 -2
- package/modules/zetaBidAdapter.js +6 -6
- package/modules/zeta_global_sspBidAdapter.js +14 -14
- package/package.json +1 -1
- package/src/AnalyticsAdapter.js +6 -6
- package/src/Renderer.js +10 -8
- package/src/adapterManager.js +45 -42
- package/src/adloader.js +6 -6
- package/src/ajax.js +8 -9
- package/src/auction.js +26 -23
- package/src/bidfactory.js +2 -2
- package/src/config.js +52 -50
- package/src/cpmBucketManager.js +2 -2
- package/src/prebid.js +85 -81
- package/src/storageManager.js +5 -5
- package/src/targeting.js +25 -26
- package/src/userSync.js +35 -22
- package/src/videoCache.js +2 -2
- package/test/.eslintrc.js +2 -1
- package/test/spec/modules/adfBidAdapter_spec.js +55 -0
- package/test/spec/modules/adgenerationBidAdapter_spec.js +121 -50
- package/test/spec/modules/adhashBidAdapter_spec.js +155 -0
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +68 -0
- package/test/spec/modules/adqueryBidAdapter_spec.js +185 -0
- package/test/spec/modules/afpBidAdapter_spec.js +306 -0
- package/test/spec/modules/atsAnalyticsAdapter_spec.js +37 -2
- package/test/spec/modules/bliinkBidAdapter_spec.js +87 -36
- package/test/spec/modules/colossussspBidAdapter_spec.js +14 -6
- package/test/spec/modules/cwireBidAdapter_spec.js +246 -0
- package/test/spec/modules/eplanningBidAdapter_spec.js +3 -3
- package/test/spec/modules/glimpseBidAdapter_spec.js +302 -204
- package/test/spec/modules/gridBidAdapter_spec.js +38 -2
- package/test/spec/modules/gridNMBidAdapter_spec.js +121 -47
- package/test/spec/modules/gumgumBidAdapter_spec.js +27 -6
- package/test/spec/modules/iasRtdProvider_spec.js +71 -6
- package/test/spec/modules/inskinBidAdapter_spec.js +10 -1
- package/test/spec/modules/invibesBidAdapter_spec.js +114 -2
- package/test/spec/modules/justpremiumBidAdapter_spec.js +16 -2
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +33 -7
- package/test/spec/modules/mediakeysBidAdapter_spec.js +406 -51
- package/test/spec/modules/medianetAnalyticsAdapter_spec.js +39 -7
- package/test/spec/modules/medianetBidAdapter_spec.js +62 -1
- package/test/spec/modules/mytargetBidAdapter_spec.js +199 -0
- package/test/spec/modules/nativoBidAdapter_spec.js +50 -3
- package/test/spec/modules/nextrollBidAdapter_spec.js +290 -0
- package/test/spec/modules/nobidBidAdapter_spec.js +65 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +120 -7
- package/test/spec/modules/publinkIdSystem_spec.js +42 -12
- package/test/spec/modules/pubmaticBidAdapter_spec.js +217 -1
- package/test/spec/modules/relaidoBidAdapter_spec.js +21 -20
- package/test/spec/modules/rubiconAnalyticsAdapter_spec.js +100 -81
- package/test/spec/modules/rubiconAnalyticsSchema.json +5 -2
- package/test/spec/modules/seedingAllianceAdapter_spec.js +186 -0
- package/test/spec/modules/sharethroughBidAdapter_spec.js +156 -136
- package/test/spec/modules/slimcutBidAdapter_spec.js +200 -0
- package/test/spec/modules/spotxBidAdapter_spec.js +36 -0
- package/test/spec/modules/sspBCBidAdapter_spec.js +210 -62
- package/test/spec/modules/talkadsBidAdapter_spec.js +231 -0
- package/test/spec/modules/tappxBidAdapter_spec.js +39 -3
- package/test/spec/modules/tripleliftBidAdapter_spec.js +2 -0
- package/test/spec/modules/trustxBidAdapter_spec.js +35 -2
- package/test/spec/modules/unicornBidAdapter_spec.js +4 -4
- package/test/spec/modules/visxBidAdapter_spec.js +48 -4
- package/test/spec/modules/weboramaRtdProvider_spec.js +288 -0
- package/test/spec/modules/yahoosspBidAdapter_spec.js +1332 -0
- package/test/spec/modules/yieldlabBidAdapter_spec.js +65 -1
- package/test/spec/modules/yieldmoBidAdapter_spec.js +30 -9
- package/test/spec/unit/pbjs_api_spec.js +4 -0
- package/test/spec/userSync_spec.js +30 -2
- package/modules/turktelekomBidAdapter.md +0 -49
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
|
|
1
2
|
/**
|
|
2
3
|
* This module adds GDPR consentManagement support to prebid.js. It interacts with
|
|
3
4
|
* supported CMPs (Consent Management Platforms) to grab the user's consent information
|
|
4
5
|
* and make it available for any GDPR supported adapters to read/pass this information to
|
|
5
6
|
* their system.
|
|
6
7
|
*/
|
|
7
|
-
import
|
|
8
|
+
import { logInfo, isFn, getAdUnitSizes, logWarn, isStr, isPlainObject, logError, isNumber } from '../src/utils.js';
|
|
8
9
|
import { config } from '../src/config.js';
|
|
9
10
|
import { gdprDataHandler } from '../src/adapterManager.js';
|
|
10
11
|
import includes from 'core-js-pure/features/array/includes.js';
|
|
@@ -98,7 +99,7 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) {
|
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
function v2CmpResponseCallback(tcfData, success) {
|
|
101
|
-
|
|
102
|
+
logInfo('Received a response from CMP', tcfData);
|
|
102
103
|
if (success) {
|
|
103
104
|
if (tcfData.gdprApplies === false || tcfData.eventStatus === 'tcloaded' || tcfData.eventStatus === 'useractioncomplete') {
|
|
104
105
|
cmpSuccess(tcfData, hookConfig);
|
|
@@ -113,7 +114,7 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) {
|
|
|
113
114
|
|
|
114
115
|
function afterEach() {
|
|
115
116
|
if (cmpResponse.getConsentData && cmpResponse.getVendorConsents) {
|
|
116
|
-
|
|
117
|
+
logInfo('Received all requested responses from CMP', cmpResponse);
|
|
117
118
|
cmpSuccess(cmpResponse, hookConfig);
|
|
118
119
|
}
|
|
119
120
|
}
|
|
@@ -147,8 +148,8 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) {
|
|
|
147
148
|
// else assume prebid may be inside an iframe and use the IAB CMP locator code to see if CMP's located in a higher parent window. this works in cross domain iframes
|
|
148
149
|
// if the CMP is not found, the iframe function will call the cmpError exit callback to abort the rest of the CMP workflow
|
|
149
150
|
|
|
150
|
-
if (
|
|
151
|
-
|
|
151
|
+
if (isFn(cmpFunction)) {
|
|
152
|
+
logInfo('Detected CMP API is directly accessible, calling it now...');
|
|
152
153
|
if (cmpVersion === 1) {
|
|
153
154
|
cmpFunction('getConsentData', null, v1CallbackHandler.consentDataCallback);
|
|
154
155
|
cmpFunction('getVendorConsents', null, v1CallbackHandler.vendorConsentsCallback);
|
|
@@ -157,11 +158,11 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) {
|
|
|
157
158
|
}
|
|
158
159
|
} else if (cmpVersion === 1 && inASafeFrame() && typeof window.$sf.ext.cmp === 'function') {
|
|
159
160
|
// this safeframe workflow is only supported with TCF v1 spec; the v2 recommends to use the iframe postMessage route instead (even if you are in a safeframe).
|
|
160
|
-
|
|
161
|
+
logInfo('Detected Prebid.js is encased in a SafeFrame and CMP is registered, calling it now...');
|
|
161
162
|
callCmpWhileInSafeFrame('getConsentData', v1CallbackHandler.consentDataCallback);
|
|
162
163
|
callCmpWhileInSafeFrame('getVendorConsents', v1CallbackHandler.vendorConsentsCallback);
|
|
163
164
|
} else {
|
|
164
|
-
|
|
165
|
+
logInfo('Detected CMP is outside the current iframe where Prebid.js is located, calling it now...');
|
|
165
166
|
if (cmpVersion === 1) {
|
|
166
167
|
callCmpWhileInIframe('getConsentData', cmpFrame, v1CallbackHandler.consentDataCallback);
|
|
167
168
|
callCmpWhileInIframe('getVendorConsents', cmpFrame, v1CallbackHandler.vendorConsentsCallback);
|
|
@@ -187,7 +188,7 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) {
|
|
|
187
188
|
let width = 1;
|
|
188
189
|
let height = 1;
|
|
189
190
|
if (Array.isArray(adUnits) && adUnits.length > 0) {
|
|
190
|
-
let sizes =
|
|
191
|
+
let sizes = getAdUnitSizes(adUnits[0]);
|
|
191
192
|
width = sizes[0][0];
|
|
192
193
|
height = sizes[0][1];
|
|
193
194
|
}
|
|
@@ -282,12 +283,12 @@ export function requestBidsHook(fn, reqBidsConfigObj) {
|
|
|
282
283
|
|
|
283
284
|
// in case we already have consent (eg during bid refresh)
|
|
284
285
|
if (consentData) {
|
|
285
|
-
|
|
286
|
+
logInfo('User consent information already known. Pulling internally stored information...');
|
|
286
287
|
return exitModule(null, hookConfig);
|
|
287
288
|
}
|
|
288
289
|
|
|
289
290
|
if (!includes(Object.keys(cmpCallMap), userCMP)) {
|
|
290
|
-
|
|
291
|
+
logWarn(`CMP framework (${userCMP}) is not a supported framework. Aborting consentManagement module and resuming auction.`);
|
|
291
292
|
return hookConfig.nextFn.apply(hookConfig.context, hookConfig.args);
|
|
292
293
|
}
|
|
293
294
|
|
|
@@ -316,8 +317,8 @@ function processCmpData(consentObject, hookConfig) {
|
|
|
316
317
|
return !!(
|
|
317
318
|
(typeof gdprApplies !== 'boolean') ||
|
|
318
319
|
(gdprApplies === true &&
|
|
319
|
-
!(
|
|
320
|
-
|
|
320
|
+
!(isStr(consentObject.getConsentData.consentData) &&
|
|
321
|
+
isPlainObject(consentObject.getVendorConsents) &&
|
|
321
322
|
Object.keys(consentObject.getVendorConsents).length > 1
|
|
322
323
|
)
|
|
323
324
|
)
|
|
@@ -330,7 +331,7 @@ function processCmpData(consentObject, hookConfig) {
|
|
|
330
331
|
let tcString = consentObject && consentObject.tcString;
|
|
331
332
|
return !!(
|
|
332
333
|
(typeof gdprApplies !== 'boolean') ||
|
|
333
|
-
(gdprApplies === true && !
|
|
334
|
+
(gdprApplies === true && !isStr(tcString))
|
|
334
335
|
);
|
|
335
336
|
}
|
|
336
337
|
|
|
@@ -348,12 +349,12 @@ function processCmpData(consentObject, hookConfig) {
|
|
|
348
349
|
|
|
349
350
|
// Raise deprecation warning if 'allowAuctionWithoutConsent' is used with TCF 2.
|
|
350
351
|
if (allowAuction.definedInConfig && cmpVersion === 2) {
|
|
351
|
-
|
|
352
|
+
logWarn(`'allowAuctionWithoutConsent' ignored for TCF 2`);
|
|
352
353
|
} else if (!allowAuction.definedInConfig && cmpVersion === 1) {
|
|
353
|
-
|
|
354
|
+
logInfo(`'allowAuctionWithoutConsent' using system default: (${DEFAULT_ALLOW_AUCTION_WO_CONSENT}).`);
|
|
354
355
|
}
|
|
355
356
|
|
|
356
|
-
if (
|
|
357
|
+
if (isFn(checkFn)) {
|
|
357
358
|
if (checkFn(consentObject)) {
|
|
358
359
|
cmpFailed(`CMP returned unexpected value during lookup process.`, hookConfig, consentObject);
|
|
359
360
|
} else {
|
|
@@ -406,7 +407,7 @@ function storeConsentData(cmpConsentObject) {
|
|
|
406
407
|
vendorData: (cmpConsentObject) || undefined,
|
|
407
408
|
gdprApplies: cmpConsentObject && typeof cmpConsentObject.gdprApplies === 'boolean' ? cmpConsentObject.gdprApplies : gdprScope
|
|
408
409
|
};
|
|
409
|
-
if (cmpConsentObject && cmpConsentObject.addtlConsent &&
|
|
410
|
+
if (cmpConsentObject && cmpConsentObject.addtlConsent && isStr(cmpConsentObject.addtlConsent)) {
|
|
410
411
|
consentData.addtlConsent = cmpConsentObject.addtlConsent;
|
|
411
412
|
};
|
|
412
413
|
}
|
|
@@ -441,14 +442,14 @@ function exitModule(errMsg, hookConfig, extraArgs) {
|
|
|
441
442
|
|
|
442
443
|
if (errMsg) {
|
|
443
444
|
if (allowAuction.value && cmpVersion === 1) {
|
|
444
|
-
|
|
445
|
+
logWarn(errMsg + ` 'allowAuctionWithoutConsent' activated.`, extraArgs);
|
|
445
446
|
nextFn.apply(context, args);
|
|
446
447
|
} else {
|
|
447
|
-
|
|
448
|
+
logError(errMsg + ' Canceling auction as per consentManagement config.', extraArgs);
|
|
448
449
|
if (typeof hookConfig.bidsBackHandler === 'function') {
|
|
449
450
|
hookConfig.bidsBackHandler();
|
|
450
451
|
} else {
|
|
451
|
-
|
|
452
|
+
logError('Error executing bidsBackHandler');
|
|
452
453
|
}
|
|
453
454
|
}
|
|
454
455
|
} else {
|
|
@@ -476,21 +477,21 @@ export function setConsentConfig(config) {
|
|
|
476
477
|
// else for backward compatability, just use `config`
|
|
477
478
|
config = config && (config.gdpr || config.usp ? config.gdpr : config);
|
|
478
479
|
if (!config || typeof config !== 'object') {
|
|
479
|
-
|
|
480
|
+
logWarn('consentManagement config not defined, exiting consent manager');
|
|
480
481
|
return;
|
|
481
482
|
}
|
|
482
|
-
if (
|
|
483
|
+
if (isStr(config.cmpApi)) {
|
|
483
484
|
userCMP = config.cmpApi;
|
|
484
485
|
} else {
|
|
485
486
|
userCMP = DEFAULT_CMP;
|
|
486
|
-
|
|
487
|
+
logInfo(`consentManagement config did not specify cmp. Using system default setting (${DEFAULT_CMP}).`);
|
|
487
488
|
}
|
|
488
489
|
|
|
489
|
-
if (
|
|
490
|
+
if (isNumber(config.timeout)) {
|
|
490
491
|
consentTimeout = config.timeout;
|
|
491
492
|
} else {
|
|
492
493
|
consentTimeout = DEFAULT_CONSENT_TIMEOUT;
|
|
493
|
-
|
|
494
|
+
logInfo(`consentManagement config did not specify timeout. Using system default setting (${DEFAULT_CONSENT_TIMEOUT}).`);
|
|
494
495
|
}
|
|
495
496
|
|
|
496
497
|
if (typeof config.allowAuctionWithoutConsent === 'boolean') {
|
|
@@ -501,14 +502,14 @@ export function setConsentConfig(config) {
|
|
|
501
502
|
// if true, then gdprApplies should be set to true
|
|
502
503
|
gdprScope = config.defaultGdprScope === true;
|
|
503
504
|
|
|
504
|
-
|
|
505
|
+
logInfo('consentManagement module has been activated...');
|
|
505
506
|
|
|
506
507
|
if (userCMP === 'static') {
|
|
507
|
-
if (
|
|
508
|
+
if (isPlainObject(config.consentData)) {
|
|
508
509
|
staticConsentData = config.consentData;
|
|
509
510
|
consentTimeout = 0;
|
|
510
511
|
} else {
|
|
511
|
-
|
|
512
|
+
logError(`consentManagement config with cmpApi: 'static' did not specify consentData. No consents will be available to adapters.`);
|
|
512
513
|
}
|
|
513
514
|
}
|
|
514
515
|
if (!addedConsentHook) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* information and make it available for any USP (CCPA) supported adapters to
|
|
5
5
|
* read/pass this information to their system.
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import { isFn, logInfo, logWarn, isStr, isNumber, isPlainObject, logError } from '../src/utils.js';
|
|
8
8
|
import { config } from '../src/config.js';
|
|
9
9
|
import { uspDataHandler } from '../src/adapterManager.js';
|
|
10
10
|
|
|
@@ -111,15 +111,15 @@ function lookupUspConsent(uspSuccess, uspError, hookConfig) {
|
|
|
111
111
|
// - else assume prebid is in an iframe, and use the locator to see if the CMP is located in a higher parent window. This works in cross domain iframes.
|
|
112
112
|
// - if USPAPI is not found, the iframe function will call the uspError exit callback to abort the rest of the USPAPI workflow
|
|
113
113
|
|
|
114
|
-
if (
|
|
115
|
-
|
|
114
|
+
if (isFn(uspapiFunction)) {
|
|
115
|
+
logInfo('Detected USP CMP is directly accessible, calling it now...');
|
|
116
116
|
uspapiFunction(
|
|
117
117
|
'getUSPData',
|
|
118
118
|
USPAPI_VERSION,
|
|
119
119
|
callbackHandler.consentDataCallback
|
|
120
120
|
);
|
|
121
121
|
} else {
|
|
122
|
-
|
|
122
|
+
logInfo(
|
|
123
123
|
'Detected USP CMP is outside the current iframe where Prebid.js is located, calling it now...'
|
|
124
124
|
);
|
|
125
125
|
callUspApiWhileInIframe(
|
|
@@ -185,7 +185,7 @@ export function requestBidsHook(fn, reqBidsConfigObj) {
|
|
|
185
185
|
};
|
|
186
186
|
|
|
187
187
|
if (!uspCallMap[consentAPI]) {
|
|
188
|
-
|
|
188
|
+
logWarn(`USP framework (${consentAPI}) is not a supported framework. Aborting consentManagement module and resuming auction.`);
|
|
189
189
|
return hookConfig.nextFn.apply(hookConfig.context, hookConfig.args);
|
|
190
190
|
}
|
|
191
191
|
|
|
@@ -275,7 +275,7 @@ function exitModule(errMsg, hookConfig, extraArgs) {
|
|
|
275
275
|
let nextFn = hookConfig.nextFn;
|
|
276
276
|
|
|
277
277
|
if (errMsg) {
|
|
278
|
-
|
|
278
|
+
logWarn(errMsg + ' Resuming auction without consent data as per consentManagement config.', extraArgs);
|
|
279
279
|
}
|
|
280
280
|
nextFn.apply(context, args);
|
|
281
281
|
}
|
|
@@ -297,31 +297,31 @@ export function resetConsentData() {
|
|
|
297
297
|
export function setConsentConfig(config) {
|
|
298
298
|
config = config && config.usp;
|
|
299
299
|
if (!config || typeof config !== 'object') {
|
|
300
|
-
|
|
300
|
+
logWarn('consentManagement.usp config not defined, exiting usp consent manager');
|
|
301
301
|
return;
|
|
302
302
|
}
|
|
303
|
-
if (
|
|
303
|
+
if (isStr(config.cmpApi)) {
|
|
304
304
|
consentAPI = config.cmpApi;
|
|
305
305
|
} else {
|
|
306
306
|
consentAPI = DEFAULT_CONSENT_API;
|
|
307
|
-
|
|
307
|
+
logInfo(`consentManagement.usp config did not specify cmpApi. Using system default setting (${DEFAULT_CONSENT_API}).`);
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
-
if (
|
|
310
|
+
if (isNumber(config.timeout)) {
|
|
311
311
|
consentTimeout = config.timeout;
|
|
312
312
|
} else {
|
|
313
313
|
consentTimeout = DEFAULT_CONSENT_TIMEOUT;
|
|
314
|
-
|
|
314
|
+
logInfo(`consentManagement.usp config did not specify timeout. Using system default setting (${DEFAULT_CONSENT_TIMEOUT}).`);
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
-
|
|
317
|
+
logInfo('USPAPI consentManagement module has been activated...');
|
|
318
318
|
|
|
319
319
|
if (consentAPI === 'static') {
|
|
320
|
-
if (
|
|
320
|
+
if (isPlainObject(config.consentData) && isPlainObject(config.consentData.getUSPData)) {
|
|
321
321
|
if (config.consentData.getUSPData.uspString) staticConsentData = { usPrivacy: config.consentData.getUSPData.uspString };
|
|
322
322
|
consentTimeout = 0;
|
|
323
323
|
} else {
|
|
324
|
-
|
|
324
|
+
logError(`consentManagement config with cmpApi: 'static' did not specify consentData. No consents will be available to adapters.`);
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
if (!addedConsentHook) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { logWarn, createTrackPixelHtml } from '../src/utils.js';
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
3
|
|
|
4
4
|
const BIDDER_CODE = 'consumable';
|
|
@@ -145,7 +145,7 @@ export const spec = {
|
|
|
145
145
|
if (syncOptions.pixelEnabled && serverResponses.length > 0) {
|
|
146
146
|
return serverResponses[0].body.pixels;
|
|
147
147
|
} else {
|
|
148
|
-
|
|
148
|
+
logWarn(bidder + ': Please enable iframe based user syncing.');
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
};
|
|
@@ -207,7 +207,7 @@ function getSize(sizes) {
|
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
function retrieveAd(decision, unitId, unitName) {
|
|
210
|
-
let ad = decision.contents && decision.contents[0] && decision.contents[0].body +
|
|
210
|
+
let ad = decision.contents && decision.contents[0] && decision.contents[0].body + createTrackPixelHtml(decision.impressionUrl);
|
|
211
211
|
|
|
212
212
|
return ad;
|
|
213
213
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { isFn, deepAccess, logMessage } from '../src/utils.js';
|
|
1
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
2
3
|
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
3
|
-
import * as utils from '../src/utils.js';
|
|
4
4
|
import {config} from '../src/config.js';
|
|
5
5
|
|
|
6
6
|
const BIDDER_CODE = 'contentexchange';
|
|
@@ -69,8 +69,8 @@ function getPlacementReqData (bid) {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
function getBidFloor(bid) {
|
|
72
|
-
if (!
|
|
73
|
-
return
|
|
72
|
+
if (!isFn(bid.getFloor)) {
|
|
73
|
+
return deepAccess(bid, 'params.bidfloor', 0);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
try {
|
|
@@ -123,7 +123,7 @@ export const spec = {
|
|
|
123
123
|
deviceHeight = winTop.screen.height;
|
|
124
124
|
winLocation = winTop.location;
|
|
125
125
|
} catch (e) {
|
|
126
|
-
|
|
126
|
+
logMessage(e);
|
|
127
127
|
winLocation = window.location;
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -132,7 +132,7 @@ export const spec = {
|
|
|
132
132
|
try {
|
|
133
133
|
refferLocation = refferUrl && new URL(refferUrl);
|
|
134
134
|
} catch (e) {
|
|
135
|
-
|
|
135
|
+
logMessage(e);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
let location = refferLocation || winLocation;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { logWarn, isStr, deepAccess, isArray, getBidIdParameter, deepSetValue, isEmpty, _each, convertTypes, parseUrl, mergeDeep, buildUrl, _map, logError, isFn, isPlainObject } from '../src/utils.js';
|
|
2
2
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
3
3
|
import {BANNER, VIDEO} from '../src/mediaTypes.js';
|
|
4
4
|
import {getStorageManager} from '../src/storageManager.js';
|
|
@@ -23,22 +23,22 @@ export const spec = {
|
|
|
23
23
|
*/
|
|
24
24
|
isBidRequestValid: function(bid) {
|
|
25
25
|
if (!bid || !bid.params) {
|
|
26
|
-
|
|
26
|
+
logWarn(BIDDER_CODE + ': Missing bid parameters');
|
|
27
27
|
return false;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
if (!
|
|
31
|
-
|
|
30
|
+
if (!isStr(bid.params.site_id)) {
|
|
31
|
+
logWarn(BIDDER_CODE + ': site_id must be specified as a string');
|
|
32
32
|
return false;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
if (isVideoRequest(bid)) {
|
|
36
|
-
const mimes = bid.params.mimes ||
|
|
36
|
+
const mimes = bid.params.mimes || deepAccess(bid, 'mediaTypes.video.mimes');
|
|
37
37
|
if (!mimes) {
|
|
38
38
|
// Give a warning but let it pass
|
|
39
|
-
|
|
40
|
-
} else if (!
|
|
41
|
-
|
|
39
|
+
logWarn(BIDDER_CODE + ': mimes should be specified for videos');
|
|
40
|
+
} else if (!isArray(mimes) || !mimes.every(s => isStr(s))) {
|
|
41
|
+
logWarn(BIDDER_CODE + ': mimes must be an array of strings');
|
|
42
42
|
return false;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -64,8 +64,8 @@ export const spec = {
|
|
|
64
64
|
const conversantImps = validBidRequests.map(function(bid) {
|
|
65
65
|
const bidfloor = getBidFloor(bid);
|
|
66
66
|
|
|
67
|
-
siteId =
|
|
68
|
-
pubcidName =
|
|
67
|
+
siteId = getBidIdParameter('site_id', bid.params) || siteId;
|
|
68
|
+
pubcidName = getBidIdParameter('pubcid_name', bid.params) || pubcidName;
|
|
69
69
|
|
|
70
70
|
requestId = bid.auctionId;
|
|
71
71
|
|
|
@@ -80,7 +80,7 @@ export const spec = {
|
|
|
80
80
|
copyOptProperty(bid.params.tag_id, imp, 'tagid');
|
|
81
81
|
|
|
82
82
|
if (isVideoRequest(bid)) {
|
|
83
|
-
const videoData =
|
|
83
|
+
const videoData = deepAccess(bid, 'mediaTypes.video') || {};
|
|
84
84
|
const format = convertSizes(videoData.playerSize || bid.sizes);
|
|
85
85
|
const video = {};
|
|
86
86
|
|
|
@@ -97,7 +97,7 @@ export const spec = {
|
|
|
97
97
|
|
|
98
98
|
imp.video = video;
|
|
99
99
|
} else {
|
|
100
|
-
const bannerData =
|
|
100
|
+
const bannerData = deepAccess(bid, 'mediaTypes.banner') || {};
|
|
101
101
|
const format = convertSizes(bannerData.sizes || bid.sizes);
|
|
102
102
|
const banner = {format: format};
|
|
103
103
|
|
|
@@ -138,12 +138,12 @@ export const spec = {
|
|
|
138
138
|
userExt.consent = bidderRequest.gdprConsent.consentString;
|
|
139
139
|
|
|
140
140
|
if (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') {
|
|
141
|
-
|
|
141
|
+
deepSetValue(payload, 'regs.ext.gdpr', bidderRequest.gdprConsent.gdprApplies ? 1 : 0);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
if (bidderRequest.uspConsent) {
|
|
146
|
-
|
|
146
|
+
deepSetValue(payload, 'regs.ext.us_privacy', bidderRequest.uspConsent);
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
@@ -163,7 +163,7 @@ export const spec = {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
// Only add the user object if it's not empty
|
|
166
|
-
if (!
|
|
166
|
+
if (!isEmpty(userExt)) {
|
|
167
167
|
payload.user = {ext: userExt};
|
|
168
168
|
}
|
|
169
169
|
|
|
@@ -186,12 +186,12 @@ export const spec = {
|
|
|
186
186
|
serverResponse = serverResponse.body;
|
|
187
187
|
|
|
188
188
|
if (bidRequest && bidRequest.data && bidRequest.data.imp) {
|
|
189
|
-
|
|
189
|
+
_each(bidRequest.data.imp, imp => requestMap[imp.id] = imp);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
if (serverResponse &&
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
if (serverResponse && isArray(serverResponse.seatbid)) {
|
|
193
|
+
_each(serverResponse.seatbid, function(bidList) {
|
|
194
|
+
_each(bidList.bid, function(conversantBid) {
|
|
195
195
|
const responseCPM = parseFloat(conversantBid.price);
|
|
196
196
|
if (responseCPM > 0.0 && conversantBid.impid) {
|
|
197
197
|
const responseAd = conversantBid.adm || '';
|
|
@@ -243,7 +243,7 @@ export const spec = {
|
|
|
243
243
|
* @return {Object} params bid params
|
|
244
244
|
*/
|
|
245
245
|
transformBidParams: function(params, isOpenRtb) {
|
|
246
|
-
return
|
|
246
|
+
return convertTypes({
|
|
247
247
|
'site_id': 'string',
|
|
248
248
|
'secure': 'number',
|
|
249
249
|
'mobile': 'number'
|
|
@@ -277,12 +277,12 @@ export const spec = {
|
|
|
277
277
|
})
|
|
278
278
|
.map((entry) => {
|
|
279
279
|
return entry.urls.map((endpoint) => {
|
|
280
|
-
let urlInfo =
|
|
281
|
-
|
|
280
|
+
let urlInfo = parseUrl(endpoint);
|
|
281
|
+
mergeDeep(urlInfo.search, params);
|
|
282
282
|
if (Object.keys(urlInfo.search).length === 0) {
|
|
283
283
|
delete urlInfo.search; // empty search object causes buildUrl to add a trailing ? to the url
|
|
284
284
|
}
|
|
285
|
-
return {type: entry.type, url:
|
|
285
|
+
return {type: entry.type, url: buildUrl(urlInfo)};
|
|
286
286
|
})
|
|
287
287
|
.reduce((x, y) => x.concat(y), []);
|
|
288
288
|
})
|
|
@@ -333,7 +333,7 @@ function convertSizes(bidSizes) {
|
|
|
333
333
|
if (bidSizes.length === 2 && typeof bidSizes[0] === 'number' && typeof bidSizes[1] === 'number') {
|
|
334
334
|
format = [{w: bidSizes[0], h: bidSizes[1]}];
|
|
335
335
|
} else {
|
|
336
|
-
format =
|
|
336
|
+
format = _map(bidSizes, d => { return {w: d[0], h: d[1]}; });
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
|
|
@@ -347,7 +347,7 @@ function convertSizes(bidSizes) {
|
|
|
347
347
|
* @returns {boolean} True if it's a video bid
|
|
348
348
|
*/
|
|
349
349
|
function isVideoRequest(bid) {
|
|
350
|
-
return bid.mediaType === 'video' || !!
|
|
350
|
+
return bid.mediaType === 'video' || !!deepAccess(bid, 'mediaTypes.video');
|
|
351
351
|
}
|
|
352
352
|
|
|
353
353
|
/**
|
|
@@ -370,9 +370,10 @@ function copyOptProperty(src, dst, dstName) {
|
|
|
370
370
|
function collectEids(bidRequests) {
|
|
371
371
|
const request = bidRequests[0]; // bidRequests have the same userId object
|
|
372
372
|
const eids = [];
|
|
373
|
-
if (
|
|
373
|
+
if (isArray(request.userIdAsEids) && request.userIdAsEids.length > 0) {
|
|
374
374
|
// later following white-list can be converted to block-list if needed
|
|
375
375
|
const requiredSourceValues = {
|
|
376
|
+
'epsilon.com': 1,
|
|
376
377
|
'adserver.org': 1,
|
|
377
378
|
'liveramp.com': 1,
|
|
378
379
|
'criteo.com': 1,
|
|
@@ -410,11 +411,11 @@ function readStoredValue(key) {
|
|
|
410
411
|
}
|
|
411
412
|
|
|
412
413
|
// deserialize JSON if needed
|
|
413
|
-
if (
|
|
414
|
+
if (isStr(storedValue) && storedValue.charAt(0) === '{') {
|
|
414
415
|
storedValue = JSON.parse(storedValue);
|
|
415
416
|
}
|
|
416
417
|
} catch (e) {
|
|
417
|
-
|
|
418
|
+
logError(e);
|
|
418
419
|
}
|
|
419
420
|
|
|
420
421
|
return storedValue;
|
|
@@ -427,16 +428,16 @@ function readStoredValue(key) {
|
|
|
427
428
|
* @returns {*|number} floor price
|
|
428
429
|
*/
|
|
429
430
|
function getBidFloor(bid) {
|
|
430
|
-
let floor =
|
|
431
|
+
let floor = getBidIdParameter('bidfloor', bid.params);
|
|
431
432
|
|
|
432
|
-
if (!floor &&
|
|
433
|
+
if (!floor && isFn(bid.getFloor)) {
|
|
433
434
|
const floorObj = bid.getFloor({
|
|
434
435
|
currency: 'USD',
|
|
435
436
|
mediaType: '*',
|
|
436
437
|
size: '*'
|
|
437
438
|
});
|
|
438
439
|
|
|
439
|
-
if (
|
|
440
|
+
if (isPlainObject(floorObj) && !isNaN(floorObj.floor) && floorObj.currency === 'USD') {
|
|
440
441
|
floor = floorObj.floor;
|
|
441
442
|
}
|
|
442
443
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import * as utils from '../src/utils.js';
|
|
1
|
+
import { deepAccess, getBidIdParameter, logWarn, logError } from '../src/utils.js';
|
|
3
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
4
3
|
import { VIDEO, BANNER } from '../src/mediaTypes.js';
|
|
5
4
|
import { config } from '../src/config.js';
|
|
@@ -26,11 +25,11 @@ export const spec = {
|
|
|
26
25
|
|
|
27
26
|
getMediaType: function (bidRequest) {
|
|
28
27
|
if (bidRequest == null) return BANNER;
|
|
29
|
-
return !
|
|
28
|
+
return !deepAccess(bidRequest, 'mediaTypes.video') ? BANNER : VIDEO;
|
|
30
29
|
},
|
|
31
30
|
|
|
32
31
|
getPlayerSize: function (bidRequest) {
|
|
33
|
-
var playerSize =
|
|
32
|
+
var playerSize = deepAccess(bidRequest, 'mediaTypes.video.playerSize');
|
|
34
33
|
if (playerSize == null) return [640, 440];
|
|
35
34
|
if (playerSize[0] != null) playerSize = playerSize[0];
|
|
36
35
|
if (playerSize == null || playerSize[0] == null || playerSize[1] == null) return [640, 440];
|
|
@@ -48,13 +47,13 @@ export const spec = {
|
|
|
48
47
|
for (var i = 0; i < validBidRequests.length; i++) {
|
|
49
48
|
var bidRequest = validBidRequests[i];
|
|
50
49
|
var referer = encodeURIComponent(bidderRequest.refererInfo.referer);
|
|
51
|
-
var e =
|
|
50
|
+
var e = getBidIdParameter('endpoint', bidRequest.params);
|
|
52
51
|
var ENDPOINT = e == 'dev' ? ENDPOINT_DEV : e == 'staging' ? ENDPOINT_STAGING : ENDPOINT_PRODUCTION;
|
|
53
52
|
var mediaType = spec.getMediaType(bidRequest);
|
|
54
53
|
var playerSize = spec.getPlayerSize(bidRequest);
|
|
55
54
|
var videoArgs = '&fv=0' + (playerSize ? ('&w=' + playerSize[0] + '&h=' + playerSize[1]) : '');
|
|
56
55
|
var url = ENDPOINT + '?media=' + mediaType + (mediaType == VIDEO ? videoArgs : '') +
|
|
57
|
-
'&json=c_b&mv=1&poolid=' +
|
|
56
|
+
'&json=c_b&mv=1&poolid=' + getBidIdParameter('placementId', bidRequest.params) +
|
|
58
57
|
'&reachedTop=' + encodeURIComponent(bidderRequest.refererInfo.reachedTop) +
|
|
59
58
|
'&requestid=' + bidRequest.bidId +
|
|
60
59
|
'&referer=' + encodeURIComponent(referer);
|
|
@@ -117,13 +116,13 @@ export const spec = {
|
|
|
117
116
|
var raw = serverResponse.body[i];
|
|
118
117
|
var rawBid = raw.creatives[0];
|
|
119
118
|
if (!rawBid) {
|
|
120
|
-
|
|
119
|
+
logWarn('cpmstarBidAdapter: server response failed check');
|
|
121
120
|
return;
|
|
122
121
|
}
|
|
123
122
|
var cpm = (parseFloat(rawBid.cpm) || 0);
|
|
124
123
|
|
|
125
124
|
if (!cpm) {
|
|
126
|
-
|
|
125
|
+
logWarn('cpmstarBidAdapter: server response failed check. Missing cpm')
|
|
127
126
|
return;
|
|
128
127
|
}
|
|
129
128
|
|
|
@@ -156,7 +155,7 @@ export const spec = {
|
|
|
156
155
|
bidResponse.mediaType = VIDEO;
|
|
157
156
|
bidResponse.vastXml = rawBid.creativemacros.HTML5VID_VASTSTRING;
|
|
158
157
|
} else {
|
|
159
|
-
return
|
|
158
|
+
return logError('bad response', rawBid);
|
|
160
159
|
}
|
|
161
160
|
|
|
162
161
|
bidResponses.push(bidResponse);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { logError, convertTypes, convertCamelToUnderscore, isArray, deepAccess, getBidRequest, isEmpty, transformBidderParamKeywords } from '../src/utils.js';
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
3
|
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
4
4
|
import { auctionManager } from '../src/auctionManager.js';
|
|
@@ -67,7 +67,7 @@ export const spec = {
|
|
|
67
67
|
if (serverResponse.error) {
|
|
68
68
|
errorMessage += `: ${serverResponse.error}`;
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
logError(errorMessage);
|
|
71
71
|
return bids;
|
|
72
72
|
}
|
|
73
73
|
if (serverResponse.tags) {
|
|
@@ -89,17 +89,17 @@ export const spec = {
|
|
|
89
89
|
},
|
|
90
90
|
|
|
91
91
|
transformBidParams: function(params, isOpenRtb) {
|
|
92
|
-
params =
|
|
92
|
+
params = convertTypes({
|
|
93
93
|
'sitekey': 'string',
|
|
94
94
|
'placementId': 'string',
|
|
95
|
-
'keywords':
|
|
95
|
+
'keywords': transformBidderParamKeywords
|
|
96
96
|
}, params);
|
|
97
97
|
if (isOpenRtb) {
|
|
98
98
|
if (isPopulatedArray(params.keywords)) {
|
|
99
99
|
params.keywords.forEach(deleteValues);
|
|
100
100
|
}
|
|
101
101
|
Object.keys(params).forEach(paramKey => {
|
|
102
|
-
let convertedKey =
|
|
102
|
+
let convertedKey = convertCamelToUnderscore(paramKey);
|
|
103
103
|
if (convertedKey !== paramKey) {
|
|
104
104
|
params[convertedKey] = params[paramKey];
|
|
105
105
|
delete params[paramKey];
|
|
@@ -117,7 +117,7 @@ export const spec = {
|
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
function isPopulatedArray(arr) {
|
|
120
|
-
return !!(
|
|
120
|
+
return !!(isArray(arr) && arr.length > 0);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
function deleteValues(keyPairObj) {
|
|
@@ -130,7 +130,7 @@ function hasPurpose1Consent(bidderRequest) {
|
|
|
130
130
|
let result = true;
|
|
131
131
|
if (bidderRequest && bidderRequest.gdprConsent) {
|
|
132
132
|
if (bidderRequest.gdprConsent.gdprApplies && bidderRequest.gdprConsent.apiVersion === 2) {
|
|
133
|
-
result = !!(
|
|
133
|
+
result = !!(deepAccess(bidderRequest.gdprConsent, 'vendorData.purpose.consents.1') === true);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
return result;
|
|
@@ -155,7 +155,7 @@ function formatRequest(payload, bidderRequest) {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
function newBid(serverBid, rtbBid, bidderRequest) {
|
|
158
|
-
const bidRequest =
|
|
158
|
+
const bidRequest = getBidRequest(serverBid.uuid, [bidderRequest]);
|
|
159
159
|
const bid = {
|
|
160
160
|
requestId: serverBid.uuid,
|
|
161
161
|
cpm: rtbBid.cpm,
|
|
@@ -190,8 +190,8 @@ function bidToTag(bid) {
|
|
|
190
190
|
tag.primary_size = tag.sizes[0];
|
|
191
191
|
tag.ad_types = [];
|
|
192
192
|
tag.uuid = bid.bidId;
|
|
193
|
-
if (!
|
|
194
|
-
let keywords =
|
|
193
|
+
if (!isEmpty(bid.params.keywords)) {
|
|
194
|
+
let keywords = transformBidderParamKeywords(bid.params.keywords);
|
|
195
195
|
if (keywords.length > 0) {
|
|
196
196
|
keywords.forEach(deleteValues);
|
|
197
197
|
}
|