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
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
import * as utils from '../src/utils.js';
|
|
6
6
|
import { getStorageManager } from '../src/storageManager.js';
|
|
7
7
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
8
|
+
import { getPageTitle, getPageDescription, getPageKeywords, getConnectionDownLink, getReferrer } from '../libraries/fpdUtils/pageInfo.js';
|
|
9
|
+
import { getDevice } from '../libraries/fpdUtils/deviceInfo.js';
|
|
10
|
+
import { getBidFloor } from '../libraries/currencyUtils/floor.js';
|
|
11
|
+
import { transformSizes, normalAdSize } from '../libraries/sizeUtils/tranformSize.js';
|
|
12
|
+
|
|
8
13
|
// import { config } from '../src/config.js';
|
|
9
14
|
// import { isPubcidEnabled } from './pubCommonId.js';
|
|
10
15
|
|
|
@@ -34,64 +39,6 @@ export const COOKIE_KEY_MGUID = '__mguid_';
|
|
|
34
39
|
const COOKIE_KEY_PMGUID = '__pmguid_';
|
|
35
40
|
const COOKIE_RETENTION_TIME = 365 * 24 * 60 * 60 * 1000; // 1 year
|
|
36
41
|
let reqTimes = 0;
|
|
37
|
-
/**
|
|
38
|
-
* get page title
|
|
39
|
-
* @returns {string}
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
export function getPageTitle(win = window) {
|
|
43
|
-
try {
|
|
44
|
-
const ogTitle = win.top.document.querySelector('meta[property="og:title"]')
|
|
45
|
-
return win.top.document.title || (ogTitle && ogTitle.content) || '';
|
|
46
|
-
} catch (e) {
|
|
47
|
-
const ogTitle = document.querySelector('meta[property="og:title"]')
|
|
48
|
-
return document.title || (ogTitle && ogTitle.content) || '';
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* get page description
|
|
54
|
-
*
|
|
55
|
-
* @returns {string}
|
|
56
|
-
*/
|
|
57
|
-
export function getPageDescription(win = window) {
|
|
58
|
-
let element;
|
|
59
|
-
|
|
60
|
-
try {
|
|
61
|
-
element = win.top.document.querySelector('meta[name="description"]') ||
|
|
62
|
-
win.top.document.querySelector('meta[property="og:description"]')
|
|
63
|
-
} catch (e) {
|
|
64
|
-
element = document.querySelector('meta[name="description"]') ||
|
|
65
|
-
document.querySelector('meta[property="og:description"]')
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return (element && element.content) || '';
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* get page keywords
|
|
73
|
-
* @returns {string}
|
|
74
|
-
*/
|
|
75
|
-
export function getPageKeywords(win = window) {
|
|
76
|
-
let element;
|
|
77
|
-
|
|
78
|
-
try {
|
|
79
|
-
element = win.top.document.querySelector('meta[name="keywords"]');
|
|
80
|
-
} catch (e) {
|
|
81
|
-
element = document.querySelector('meta[name="keywords"]');
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return (element && element.content) || '';
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* get connection downlink
|
|
89
|
-
* @returns {number}
|
|
90
|
-
*/
|
|
91
|
-
export function getConnectionDownLink(win = window) {
|
|
92
|
-
const nav = win.navigator || {};
|
|
93
|
-
return nav && nav.connection && nav.connection.downlink >= 0 ? nav.connection.downlink.toString() : undefined;
|
|
94
|
-
}
|
|
95
42
|
|
|
96
43
|
/**
|
|
97
44
|
* get pmg uid
|
|
@@ -135,54 +82,6 @@ function getProperty(obj, ...keys) {
|
|
|
135
82
|
return o;
|
|
136
83
|
}
|
|
137
84
|
|
|
138
|
-
/**
|
|
139
|
-
* 是不是移动设备或者平板
|
|
140
|
-
* @return {boolean}
|
|
141
|
-
*/
|
|
142
|
-
function isMobileAndTablet() {
|
|
143
|
-
let check = false;
|
|
144
|
-
(function (a) {
|
|
145
|
-
let reg1 = new RegExp(
|
|
146
|
-
[
|
|
147
|
-
'(android|bbd+|meego)',
|
|
148
|
-
'.+mobile|avantgo|bada/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)',
|
|
149
|
-
'|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone',
|
|
150
|
-
'|p(ixi|re)/|plucker|pocket|psp|series(4|6)0|symbian|treo|up.(browser|link)|vodafone|wap',
|
|
151
|
-
'|windows ce|xda|xiino|android|ipad|playbook|silk'
|
|
152
|
-
].join(''),
|
|
153
|
-
'i'
|
|
154
|
-
);
|
|
155
|
-
let reg2 = new RegExp(
|
|
156
|
-
[
|
|
157
|
-
'1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)',
|
|
158
|
-
'|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )',
|
|
159
|
-
'|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55/|capi|ccwa|cdm-|cell',
|
|
160
|
-
'|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)',
|
|
161
|
-
'|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene',
|
|
162
|
-
'|gf-5|g-mo|go(.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c',
|
|
163
|
-
'|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|/)|ibro|idea|ig01|ikom',
|
|
164
|
-
'|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |/)|klon|kpt |kwc-|kyo(c|k)',
|
|
165
|
-
'|le(no|xi)|lg( g|/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50/|ma(te|ui|xo)|mc(01|21|ca)',
|
|
166
|
-
'|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]',
|
|
167
|
-
'|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)',
|
|
168
|
-
'|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio',
|
|
169
|
-
'|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55/|sa(ge|ma|mm|ms',
|
|
170
|
-
'|ny|va)|sc(01|h-|oo|p-)|sdk/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al',
|
|
171
|
-
'|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)',
|
|
172
|
-
'|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(.b|g1|si)|utst|',
|
|
173
|
-
'v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)',
|
|
174
|
-
'|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-',
|
|
175
|
-
'|your|zeto|zte-'
|
|
176
|
-
].join(''),
|
|
177
|
-
'i'
|
|
178
|
-
);
|
|
179
|
-
if (reg1.test(a) || reg2.test(a.substr(0, 4))) {
|
|
180
|
-
check = true;
|
|
181
|
-
}
|
|
182
|
-
})(navigator.userAgent || navigator.vendor || window.opera);
|
|
183
|
-
return check;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
85
|
/**
|
|
187
86
|
* 获取底价
|
|
188
87
|
* @param {*} bid
|
|
@@ -205,62 +104,9 @@ function isMobileAndTablet() {
|
|
|
205
104
|
// }
|
|
206
105
|
// return floor;
|
|
207
106
|
// }
|
|
208
|
-
function getBidFloor(bid) {
|
|
209
|
-
if (!utils.isFn(bid.getFloor)) {
|
|
210
|
-
return utils.deepAccess(bid, 'params.bidfloor', 0);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
try {
|
|
214
|
-
const bidFloor = bid.getFloor({
|
|
215
|
-
currency: 'USD',
|
|
216
|
-
mediaType: '*',
|
|
217
|
-
size: '*'
|
|
218
|
-
});
|
|
219
|
-
return bidFloor.floor;
|
|
220
|
-
} catch (_) {
|
|
221
|
-
return 0;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* 将尺寸转为RTB识别的尺寸
|
|
227
|
-
*
|
|
228
|
-
* @param {Array|Object} requestSizes 配置尺寸
|
|
229
|
-
* @return {Object}
|
|
230
|
-
*/
|
|
231
|
-
function transformSizes(requestSizes) {
|
|
232
|
-
let sizes = [];
|
|
233
|
-
let sizeObj = {};
|
|
234
|
-
|
|
235
|
-
if (utils.isArray(requestSizes) && requestSizes.length === 2 && !utils.isArray(requestSizes[0])) {
|
|
236
|
-
sizeObj.width = parseInt(requestSizes[0], 10);
|
|
237
|
-
sizeObj.height = parseInt(requestSizes[1], 10);
|
|
238
|
-
sizes.push(sizeObj);
|
|
239
|
-
} else if (typeof requestSizes === 'object') {
|
|
240
|
-
for (let i = 0; i < requestSizes.length; i++) {
|
|
241
|
-
let size = requestSizes[i];
|
|
242
|
-
sizeObj = {};
|
|
243
|
-
sizeObj.width = parseInt(size[0], 10);
|
|
244
|
-
sizeObj.height = parseInt(size[1], 10);
|
|
245
|
-
sizes.push(sizeObj);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
return sizes;
|
|
250
|
-
}
|
|
251
107
|
|
|
252
108
|
// 支持的广告尺寸
|
|
253
|
-
const mediagoAdSize =
|
|
254
|
-
{ w: 300, h: 250 },
|
|
255
|
-
{ w: 300, h: 600 },
|
|
256
|
-
{ w: 728, h: 90 },
|
|
257
|
-
{ w: 970, h: 250 },
|
|
258
|
-
{ w: 320, h: 50 },
|
|
259
|
-
{ w: 160, h: 600 },
|
|
260
|
-
{ w: 320, h: 180 },
|
|
261
|
-
{ w: 320, h: 100 },
|
|
262
|
-
{ w: 336, h: 280 }
|
|
263
|
-
];
|
|
109
|
+
const mediagoAdSize = normalAdSize;
|
|
264
110
|
|
|
265
111
|
/**
|
|
266
112
|
* 获取广告位配置
|
|
@@ -340,21 +186,6 @@ function getItems(validBidRequests, bidderRequest) {
|
|
|
340
186
|
return items;
|
|
341
187
|
}
|
|
342
188
|
|
|
343
|
-
/**
|
|
344
|
-
* @param {BidRequest} bidRequest
|
|
345
|
-
* @param bidderRequest
|
|
346
|
-
* @returns {string}
|
|
347
|
-
*/
|
|
348
|
-
function getReferrer(bidRequest = {}, bidderRequest = {}) {
|
|
349
|
-
let pageUrl;
|
|
350
|
-
if (bidRequest.params && bidRequest.params.referrer) {
|
|
351
|
-
pageUrl = bidRequest.params.referrer;
|
|
352
|
-
} else {
|
|
353
|
-
pageUrl = utils.deepAccess(bidderRequest, 'refererInfo.page');
|
|
354
|
-
}
|
|
355
|
-
return pageUrl;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
189
|
/**
|
|
359
190
|
* get current time to UTC string
|
|
360
191
|
* @returns utc string
|
|
@@ -386,7 +217,7 @@ function getParam(validBidRequests, bidderRequest) {
|
|
|
386
217
|
const cat = utils.deepAccess(bidderRequest, 'ortb2.site.cat');
|
|
387
218
|
reqTimes += 1;
|
|
388
219
|
|
|
389
|
-
let isMobile =
|
|
220
|
+
let isMobile = getDevice() ? 1 : 0;
|
|
390
221
|
// input test status by Publisher. more frequently for test true req
|
|
391
222
|
let isTest = validBidRequests[0].params.test || 0;
|
|
392
223
|
let auctionId = getProperty(bidderRequest, 'auctionId');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
buildUrl,
|
|
3
2
|
deepAccess,
|
|
3
|
+
formatQS,
|
|
4
4
|
getWindowTop,
|
|
5
5
|
isArray,
|
|
6
6
|
isEmpty,
|
|
@@ -8,7 +8,9 @@ import {
|
|
|
8
8
|
isStr,
|
|
9
9
|
logError,
|
|
10
10
|
logInfo,
|
|
11
|
-
|
|
11
|
+
safeJSONEncode,
|
|
12
|
+
deepClone,
|
|
13
|
+
deepSetValue
|
|
12
14
|
} from '../src/utils.js';
|
|
13
15
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
14
16
|
import {config} from '../src/config.js';
|
|
@@ -18,6 +20,7 @@ import {Renderer} from '../src/Renderer.js';
|
|
|
18
20
|
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
|
|
19
21
|
import {getGlobal} from '../src/prebidGlobal.js';
|
|
20
22
|
import {getGptSlotInfoForAdUnitCode} from '../libraries/gptUtils/gptUtils.js';
|
|
23
|
+
import {ajax} from '../src/ajax.js';
|
|
21
24
|
|
|
22
25
|
/**
|
|
23
26
|
* @typedef {import('../src/adapters/bidderFactory.js').BidRequest} BidRequest
|
|
@@ -35,27 +38,20 @@ const SLOT_VISIBILITY = {
|
|
|
35
38
|
ABOVE_THE_FOLD: 1,
|
|
36
39
|
BELOW_THE_FOLD: 2
|
|
37
40
|
};
|
|
38
|
-
const EVENTS = {
|
|
41
|
+
export const EVENTS = {
|
|
39
42
|
TIMEOUT_EVENT_NAME: 'client_timeout',
|
|
40
|
-
BID_WON_EVENT_NAME: 'client_bid_won'
|
|
43
|
+
BID_WON_EVENT_NAME: 'client_bid_won',
|
|
44
|
+
SET_TARGETING: 'client_set_targeting',
|
|
45
|
+
BIDDER_ERROR: 'client_bidder_error'
|
|
41
46
|
};
|
|
42
|
-
const EVENT_PIXEL_URL = '
|
|
47
|
+
export const EVENT_PIXEL_URL = 'https://navvy.media.net/log';
|
|
43
48
|
const OUTSTREAM = 'outstream';
|
|
44
49
|
|
|
45
|
-
|
|
46
|
-
let refererInfo = getRefererInfo();
|
|
47
|
-
|
|
48
|
-
let mnData = {};
|
|
50
|
+
let pageMeta;
|
|
49
51
|
|
|
50
52
|
window.mnet = window.mnet || {};
|
|
51
53
|
window.mnet.queue = window.mnet.queue || [];
|
|
52
54
|
|
|
53
|
-
mnData.urlData = {
|
|
54
|
-
domain: refererInfo.domain,
|
|
55
|
-
page: refererInfo.page,
|
|
56
|
-
isTop: refererInfo.reachedTop
|
|
57
|
-
};
|
|
58
|
-
|
|
59
55
|
const aliases = [
|
|
60
56
|
{ code: TRUSTEDSTACK_CODE, gvlid: 1288 },
|
|
61
57
|
];
|
|
@@ -85,20 +81,20 @@ function siteDetails(site, bidderRequest) {
|
|
|
85
81
|
}
|
|
86
82
|
|
|
87
83
|
function getPageMeta() {
|
|
88
|
-
if (
|
|
89
|
-
return
|
|
84
|
+
if (pageMeta) {
|
|
85
|
+
return pageMeta;
|
|
90
86
|
}
|
|
91
87
|
let canonicalUrl = getUrlFromSelector('link[rel="canonical"]', 'href');
|
|
92
88
|
let ogUrl = getUrlFromSelector('meta[property="og:url"]', 'content');
|
|
93
89
|
let twitterUrl = getUrlFromSelector('meta[name="twitter:url"]', 'content');
|
|
94
90
|
|
|
95
|
-
|
|
91
|
+
pageMeta = Object.assign({},
|
|
96
92
|
canonicalUrl && { 'canonical_url': canonicalUrl },
|
|
97
93
|
ogUrl && { 'og_url': ogUrl },
|
|
98
94
|
twitterUrl && { 'twitter_url': twitterUrl }
|
|
99
95
|
);
|
|
100
96
|
|
|
101
|
-
return
|
|
97
|
+
return pageMeta;
|
|
102
98
|
}
|
|
103
99
|
|
|
104
100
|
function getUrlFromSelector(selector, attribute) {
|
|
@@ -338,6 +334,15 @@ function getBidderURL(bidderCode, cid) {
|
|
|
338
334
|
return url + '?cid=' + encodeURIComponent(cid);
|
|
339
335
|
}
|
|
340
336
|
|
|
337
|
+
function ortb2Data(ortb2, bidRequests) {
|
|
338
|
+
const ortb2Object = deepClone(ortb2);
|
|
339
|
+
const eids = deepAccess(bidRequests, '0.userIdAsEids');
|
|
340
|
+
if (eids) {
|
|
341
|
+
deepSetValue(ortb2Object, 'user.ext.eids', eids)
|
|
342
|
+
}
|
|
343
|
+
return ortb2Object;
|
|
344
|
+
}
|
|
345
|
+
|
|
341
346
|
function generatePayload(bidRequests, bidderRequests) {
|
|
342
347
|
return {
|
|
343
348
|
site: siteDetails(bidRequests[0].params.site, bidderRequests),
|
|
@@ -345,7 +350,7 @@ function generatePayload(bidRequests, bidderRequests) {
|
|
|
345
350
|
// TODO: fix auctionId leak: https://github.com/prebid/Prebid.js/issues/9781
|
|
346
351
|
id: bidRequests[0].auctionId,
|
|
347
352
|
imp: bidRequests.map(request => slotParams(request, bidderRequests)),
|
|
348
|
-
ortb2: bidderRequests.ortb2,
|
|
353
|
+
ortb2: ortb2Data(bidderRequests.ortb2, bidRequests),
|
|
349
354
|
tmax: bidderRequests.timeout
|
|
350
355
|
}
|
|
351
356
|
}
|
|
@@ -363,38 +368,71 @@ function fetchCookieSyncUrls(response) {
|
|
|
363
368
|
return [];
|
|
364
369
|
}
|
|
365
370
|
|
|
366
|
-
function
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
let params = {};
|
|
371
|
+
function getEventData(event) {
|
|
372
|
+
const params = {};
|
|
373
|
+
const referrerInfo = getRefererInfo();
|
|
370
374
|
params.logid = 'kfk';
|
|
371
375
|
params.evtid = 'projectevents';
|
|
372
376
|
params.project = 'prebid';
|
|
373
|
-
params.
|
|
377
|
+
params.pbver = '$prebid.version$';
|
|
374
378
|
params.cid = getGlobal().medianetGlobals.cid || '';
|
|
375
|
-
params.
|
|
376
|
-
params.
|
|
377
|
-
params.dn = mnData.urlData.domain || '';
|
|
378
|
-
params.requrl = mnData.urlData.page || '';
|
|
379
|
-
params.istop = mnData.urlData.isTop || '';
|
|
379
|
+
params.dn = encodeURIComponent(referrerInfo.domain || '');
|
|
380
|
+
params.requrl = encodeURIComponent(referrerInfo.page || '');
|
|
380
381
|
params.event = event.name || '';
|
|
381
382
|
params.value = event.value || '';
|
|
382
383
|
params.rd = event.related_data || '';
|
|
384
|
+
return params;
|
|
385
|
+
}
|
|
383
386
|
|
|
387
|
+
function getBidData(bid) {
|
|
388
|
+
const params = {};
|
|
389
|
+
params.acid = bid.auctionId || '';
|
|
390
|
+
params.crid = deepAccess(bid, 'params.crid') || deepAccess(bid, 'params.0.crid') || bid.adUnitCode || '';
|
|
391
|
+
params.ext = safeJSONEncode(bid.ext) || '';
|
|
392
|
+
|
|
393
|
+
const rawobj = deepClone(bid);
|
|
394
|
+
delete rawobj.ad;
|
|
395
|
+
delete rawobj.vastXml;
|
|
396
|
+
params.rawobj = safeJSONEncode(rawobj);
|
|
384
397
|
return params;
|
|
385
398
|
}
|
|
386
399
|
|
|
387
|
-
function
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
400
|
+
function getLoggingData(event, bids) {
|
|
401
|
+
const logData = {};
|
|
402
|
+
if (!isArray(bids)) {
|
|
403
|
+
bids = [];
|
|
404
|
+
}
|
|
405
|
+
bids.forEach((bid) => {
|
|
406
|
+
let bidData = getBidData(bid);
|
|
407
|
+
Object.keys(bidData).forEach((key) => {
|
|
408
|
+
logData[key] = logData[key] || [];
|
|
409
|
+
logData[key].push(encodeURIComponent(bidData[key]));
|
|
410
|
+
});
|
|
411
|
+
});
|
|
412
|
+
return Object.assign({}, getEventData(event), logData)
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function fireAjaxLog(url, payload) {
|
|
416
|
+
ajax(url,
|
|
417
|
+
{
|
|
418
|
+
success: () => undefined,
|
|
419
|
+
error: () => undefined
|
|
420
|
+
},
|
|
421
|
+
payload,
|
|
422
|
+
{
|
|
423
|
+
method: 'POST',
|
|
424
|
+
keepalive: true
|
|
425
|
+
}
|
|
426
|
+
);
|
|
394
427
|
}
|
|
395
428
|
|
|
396
|
-
function
|
|
397
|
-
|
|
429
|
+
function logEvent(event, data) {
|
|
430
|
+
const logData = getLoggingData(event, data);
|
|
431
|
+
fireAjaxLog(EVENT_PIXEL_URL, formatQS(logData));
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
function clearPageMeta() {
|
|
435
|
+
pageMeta = undefined;
|
|
398
436
|
}
|
|
399
437
|
|
|
400
438
|
function addRenderer(bid) {
|
|
@@ -550,7 +588,30 @@ export const spec = {
|
|
|
550
588
|
} catch (e) {}
|
|
551
589
|
},
|
|
552
590
|
|
|
553
|
-
|
|
591
|
+
onSetTargeting: (bid) => {
|
|
592
|
+
try {
|
|
593
|
+
let eventData = {
|
|
594
|
+
name: EVENTS.SET_TARGETING,
|
|
595
|
+
value: bid.cpm
|
|
596
|
+
};
|
|
597
|
+
const enableSendAllBids = config.getConfig('enableSendAllBids');
|
|
598
|
+
if (!enableSendAllBids) {
|
|
599
|
+
logEvent(eventData, [bid]);
|
|
600
|
+
}
|
|
601
|
+
} catch (e) {}
|
|
602
|
+
},
|
|
603
|
+
|
|
604
|
+
onBidderError: ({error, bidderRequest}) => {
|
|
605
|
+
try {
|
|
606
|
+
let eventData = {
|
|
607
|
+
name: EVENTS.BIDDER_ERROR,
|
|
608
|
+
related_data: `timedOut:${error.timedOut}|status:${error.status}|message:${error.reason.message}`
|
|
609
|
+
};
|
|
610
|
+
logEvent(eventData, bidderRequest.bids);
|
|
611
|
+
} catch (e) {}
|
|
612
|
+
},
|
|
613
|
+
|
|
614
|
+
clearPageMeta,
|
|
554
615
|
|
|
555
616
|
getWindowSize,
|
|
556
617
|
};
|
|
@@ -86,7 +86,7 @@ _each(NATIVE_ASSETS, anAsset => { _NATIVE_ASSET_ID_TO_KEY_MAP[anAsset.ID] = anAs
|
|
|
86
86
|
_each(NATIVE_ASSETS, anAsset => { _NATIVE_ASSET_KEY_TO_ASSET_MAP[anAsset.KEY] = anAsset });
|
|
87
87
|
|
|
88
88
|
export const spec = {
|
|
89
|
-
VERSION: '1.
|
|
89
|
+
VERSION: '1.7',
|
|
90
90
|
code: BIDDER_CODE,
|
|
91
91
|
gvlid: GVLID,
|
|
92
92
|
supportedMediaTypes: [BANNER, NATIVE],
|
|
@@ -167,6 +167,8 @@ export const spec = {
|
|
|
167
167
|
tagid,
|
|
168
168
|
secure,
|
|
169
169
|
};
|
|
170
|
+
const gpid = deepAccess(bid, 'ortb2Imp.ext.gpid');
|
|
171
|
+
gpid && isStr(gpid) && deepSetValue(impObj, `ext.gpid`, gpid);
|
|
170
172
|
const floorData = getBidFloor(bid, cur);
|
|
171
173
|
if (floorData.floor) {
|
|
172
174
|
impObj.bidfloor = floorData.floor;
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module adds the Mobian RTD provider to the real time data module
|
|
3
|
+
* The {@link module:modules/realTimeData} module is required
|
|
4
|
+
* @module modules/anonymisedRtdProvider
|
|
5
|
+
* @requires module:modules/realTimeData
|
|
6
|
+
*/
|
|
1
7
|
import { submodule } from '../src/hook.js';
|
|
2
8
|
import { ajaxBuilder } from '../src/ajax.js';
|
|
9
|
+
import { deepSetValue } from '../src/utils.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {import('../modules/rtdModule/index.js').RtdSubmodule} RtdSubmodule
|
|
13
|
+
*/
|
|
14
|
+
|
|
3
15
|
export const MOBIAN_URL = 'https://impact-api-prod.themobian.com/brand_safety';
|
|
4
16
|
|
|
17
|
+
/** @type {RtdSubmodule} */
|
|
5
18
|
export const mobianBrandSafetySubmodule = {
|
|
6
19
|
name: 'mobianBrandSafety',
|
|
7
|
-
gvlid: null,
|
|
8
20
|
init: init,
|
|
9
21
|
getBidRequestData: getBidRequestData
|
|
10
22
|
};
|
|
@@ -36,10 +48,12 @@ function getBidRequestData(bidReqConfig, callback, config) {
|
|
|
36
48
|
'mobianGarmRisk': mobianGarmRisk
|
|
37
49
|
};
|
|
38
50
|
resolve(risk);
|
|
39
|
-
ortb2Site.ext.
|
|
51
|
+
deepSetValue(ortb2Site.ext, 'data.mobian', risk);
|
|
52
|
+
callback()
|
|
40
53
|
},
|
|
41
54
|
error: function () {
|
|
42
55
|
resolve({});
|
|
56
|
+
callback()
|
|
43
57
|
}
|
|
44
58
|
});
|
|
45
59
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
_each,
|
|
3
|
-
createTrackPixelHtml,
|
|
4
3
|
deepAccess,
|
|
5
4
|
deepSetValue,
|
|
6
5
|
getBidIdParameter,
|
|
@@ -12,6 +11,7 @@ import {
|
|
|
12
11
|
parseUrl,
|
|
13
12
|
triggerPixel,
|
|
14
13
|
} from '../src/utils.js';
|
|
14
|
+
import {getAd} from '../libraries/targetVideoUtils/bidderUtils.js';
|
|
15
15
|
|
|
16
16
|
import {getGlobal} from '../src/prebidGlobal.js';
|
|
17
17
|
import { EVENTS } from '../src/constants.js';
|
|
@@ -455,32 +455,6 @@ function getTopWindow(curWindow, nesting = 0) {
|
|
|
455
455
|
};
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
function getAd(bid) {
|
|
459
|
-
let ad, adUrl, vastXml, vastUrl;
|
|
460
|
-
|
|
461
|
-
switch (deepAccess(bid, 'ext.prebid.type')) {
|
|
462
|
-
case VIDEO:
|
|
463
|
-
if (bid.adm.substr(0, 4) === 'http') {
|
|
464
|
-
vastUrl = bid.adm;
|
|
465
|
-
} else {
|
|
466
|
-
vastXml = bid.adm;
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
break;
|
|
470
|
-
default:
|
|
471
|
-
if (bid.adm && bid.nurl) {
|
|
472
|
-
ad = bid.adm;
|
|
473
|
-
ad += createTrackPixelHtml(decodeURIComponent(bid.nurl));
|
|
474
|
-
} else if (bid.adm) {
|
|
475
|
-
ad = bid.adm;
|
|
476
|
-
} else if (bid.nurl) {
|
|
477
|
-
adUrl = bid.nurl;
|
|
478
|
-
};
|
|
479
|
-
};
|
|
480
|
-
|
|
481
|
-
return {ad, adUrl, vastXml, vastUrl};
|
|
482
|
-
}
|
|
483
|
-
|
|
484
458
|
function getSiteObj() {
|
|
485
459
|
const refInfo = (getRefererInfo && getRefererInfo()) || {};
|
|
486
460
|
|
|
@@ -3,7 +3,7 @@ import { config } from '../src/config.js';
|
|
|
3
3
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
4
4
|
import { BANNER, VIDEO } from '../src/mediaTypes.js';
|
|
5
5
|
import { getStorageManager } from '../src/storageManager.js';
|
|
6
|
-
import { hasPurpose1Consent } from '../src/utils/
|
|
6
|
+
import { hasPurpose1Consent } from '../src/utils/gdpr.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @typedef {import('../src/adapters/bidderFactory.js').BidRequest} BidRequest
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { deepAccess } from '../src/utils.js';
|
|
2
2
|
import {config} from '../src/config.js';
|
|
3
3
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
4
|
-
import {hasPurpose1Consent} from '../src/utils/
|
|
4
|
+
import {hasPurpose1Consent} from '../src/utils/gdpr.js';
|
|
5
5
|
|
|
6
6
|
const BIDDER_CODE = 'optout';
|
|
7
7
|
|
package/modules/paapi.js
CHANGED
|
@@ -54,6 +54,7 @@ export function init(cfg) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
getHook('addPaapiConfig').before(addPaapiConfigHook);
|
|
57
|
+
getHook('makeBidRequests').before(addPaapiData);
|
|
57
58
|
getHook('makeBidRequests').after(markForFledge);
|
|
58
59
|
events.on(EVENTS.AUCTION_END, onAuctionEnd);
|
|
59
60
|
|
|
@@ -332,38 +333,50 @@ function getRequestedSize(adUnit) {
|
|
|
332
333
|
})();
|
|
333
334
|
}
|
|
334
335
|
|
|
336
|
+
export function addPaapiData(next, adUnits, ...args) {
|
|
337
|
+
if (isFledgeSupported() && moduleConfig.enabled) {
|
|
338
|
+
adUnits.forEach(adUnit => {
|
|
339
|
+
// https://github.com/InteractiveAdvertisingBureau/openrtb/blob/main/extensions/community_extensions/Protected%20Audience%20Support.md
|
|
340
|
+
const igsAe = adUnit.ortb2Imp?.ext?.igs != null
|
|
341
|
+
? adUnit.ortb2Imp.ext.igs.ae || 1
|
|
342
|
+
: null;
|
|
343
|
+
const extAe = adUnit.ortb2Imp?.ext?.ae;
|
|
344
|
+
if (igsAe !== extAe && igsAe != null && extAe != null) {
|
|
345
|
+
logWarn(MODULE, `Ad unit defines conflicting ortb2Imp.ext.ae and ortb2Imp.ext.igs, using the latter`, adUnit);
|
|
346
|
+
}
|
|
347
|
+
const ae = igsAe ?? extAe ?? moduleConfig.defaultForSlots;
|
|
348
|
+
if (ae) {
|
|
349
|
+
deepSetValue(adUnit, 'ortb2Imp.ext.ae', ae);
|
|
350
|
+
adUnit.ortb2Imp.ext.igs = Object.assign({
|
|
351
|
+
ae: ae,
|
|
352
|
+
biddable: 1
|
|
353
|
+
}, adUnit.ortb2Imp.ext.igs);
|
|
354
|
+
const requestedSize = getRequestedSize(adUnit);
|
|
355
|
+
if (requestedSize) {
|
|
356
|
+
deepSetValue(adUnit, 'ortb2Imp.ext.paapi.requestedSize', requestedSize);
|
|
357
|
+
}
|
|
358
|
+
adUnit.bids.forEach(bidReq => {
|
|
359
|
+
if (!getFledgeConfig(bidReq.bidder).enabled) {
|
|
360
|
+
deepSetValue(bidReq, 'ortb2Imp.ext.ae', 0);
|
|
361
|
+
bidReq.ortb2Imp.ext.igs = {ae: 0, biddable: 0};
|
|
362
|
+
}
|
|
363
|
+
})
|
|
364
|
+
}
|
|
365
|
+
})
|
|
366
|
+
}
|
|
367
|
+
next(adUnits, ...args);
|
|
368
|
+
}
|
|
369
|
+
|
|
335
370
|
export function markForFledge(next, bidderRequests) {
|
|
336
371
|
if (isFledgeSupported()) {
|
|
337
372
|
bidderRequests.forEach((bidderReq) => {
|
|
338
|
-
const {enabled
|
|
373
|
+
const {enabled} = getFledgeConfig(bidderReq.bidderCode);
|
|
339
374
|
Object.assign(bidderReq, {
|
|
340
375
|
paapi: {
|
|
341
376
|
enabled,
|
|
342
377
|
componentSeller: !!moduleConfig.componentSeller?.auctionConfig
|
|
343
378
|
}
|
|
344
379
|
});
|
|
345
|
-
bidderReq.bids.forEach(bidReq => {
|
|
346
|
-
// https://github.com/InteractiveAdvertisingBureau/openrtb/blob/main/extensions/community_extensions/Protected%20Audience%20Support.md
|
|
347
|
-
const igsAe = bidReq.ortb2Imp?.ext?.igs != null
|
|
348
|
-
? bidReq.ortb2Imp.ext.igs.ae || 1
|
|
349
|
-
: null;
|
|
350
|
-
const extAe = bidReq.ortb2Imp?.ext?.ae;
|
|
351
|
-
if (igsAe !== extAe && igsAe != null && extAe != null) {
|
|
352
|
-
logWarn(MODULE, `Bid request defines conflicting ortb2Imp.ext.ae and ortb2Imp.ext.igs, using the latter`, bidReq);
|
|
353
|
-
}
|
|
354
|
-
const bidAe = igsAe ?? extAe ?? ae;
|
|
355
|
-
if (bidAe) {
|
|
356
|
-
deepSetValue(bidReq, 'ortb2Imp.ext.ae', bidAe);
|
|
357
|
-
bidReq.ortb2Imp.ext.igs = Object.assign({
|
|
358
|
-
ae: bidAe,
|
|
359
|
-
biddable: 1
|
|
360
|
-
}, bidReq.ortb2Imp.ext.igs);
|
|
361
|
-
const requestedSize = getRequestedSize(bidReq);
|
|
362
|
-
if (requestedSize) {
|
|
363
|
-
deepSetValue(bidReq, 'ortb2Imp.ext.paapi.requestedSize', requestedSize);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
});
|
|
367
380
|
});
|
|
368
381
|
}
|
|
369
382
|
next(bidderRequests);
|
|
@@ -378,18 +391,6 @@ export function setImpExtAe(imp, bidRequest, context) {
|
|
|
378
391
|
|
|
379
392
|
registerOrtbProcessor({type: IMP, name: 'impExtAe', fn: setImpExtAe});
|
|
380
393
|
|
|
381
|
-
function paapiResponseParser(configs, response, context) {
|
|
382
|
-
configs.forEach((config) => {
|
|
383
|
-
const impCtx = context.impContext[config.impid];
|
|
384
|
-
if (!impCtx?.imp?.ext?.ae) {
|
|
385
|
-
logWarn(MODULE, 'Received auction configuration for an impression that was not in the request or did not ask for it', config, impCtx?.imp);
|
|
386
|
-
} else {
|
|
387
|
-
impCtx.paapiConfigs = impCtx.paapiConfigs || [];
|
|
388
|
-
impCtx.paapiConfigs.push(config);
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
|
|
393
394
|
export function parseExtIgi(response, ortbResponse, context) {
|
|
394
395
|
paapiResponseParser(
|
|
395
396
|
(ortbResponse.ext?.igi || []).flatMap(igi => {
|
|
@@ -411,6 +412,18 @@ export function parseExtIgi(response, ortbResponse, context) {
|
|
|
411
412
|
)
|
|
412
413
|
}
|
|
413
414
|
|
|
415
|
+
function paapiResponseParser(configs, response, context) {
|
|
416
|
+
configs.forEach((config) => {
|
|
417
|
+
const impCtx = context.impContext[config.impid];
|
|
418
|
+
if (!impCtx?.imp?.ext?.ae) {
|
|
419
|
+
logWarn(MODULE, 'Received auction configuration for an impression that was not in the request or did not ask for it', config, impCtx?.imp);
|
|
420
|
+
} else {
|
|
421
|
+
impCtx.paapiConfigs = impCtx.paapiConfigs || [];
|
|
422
|
+
impCtx.paapiConfigs.push(config);
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
|
|
414
427
|
// to make it easier to share code between the PBS adapter and adapters whose backend is PBS, break up
|
|
415
428
|
// fledge response processing in two steps: first aggregate all the auction configs by their imp...
|
|
416
429
|
|