prebid.js 8.7.0 → 8.9.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/dist/1plusXRtdProvider.js +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/a1MediaRtdProvider.js +1 -1
- package/dist/adWMGAnalyticsAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adkernelAdnAnalyticsAdapter.js +1 -1
- package/dist/adlooxAdServerVideo.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/admaticBidAdapter.js +1 -1
- package/dist/admixerIdSystem.js +1 -1
- package/dist/adnuntiusRtdProvider.js +1 -1
- package/dist/adpartnerBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adqueryIdSystem.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adriverIdSystem.js +1 -1
- package/dist/adtelligentIdSystem.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgAnalyticsAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adxpremiumAnalyticsAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/aidemBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/akamaiDapRtdProvider.js +1 -1
- package/dist/alkimiBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/analyticsAdapter.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/atsAnalyticsAdapter.js +1 -1
- package/dist/automatadBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidViewability.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/bidwatchAnalyticsAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/brandmetricsRtdProvider.js +1 -1
- package/dist/bridBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/brightcomSSPBidAdapter.js +1 -1
- package/dist/britepoolIdSystem.js +1 -1
- package/dist/browsiRtdProvider.js +1 -1
- package/dist/byDataAnalyticsAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/categoryTranslation.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/colossussspBidAdapter.js +1 -1
- package/dist/concertAnalyticsAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectIdSystem.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.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/criteoIdSystem.js +1 -1
- package/dist/currency.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dacIdSystem.js +1 -1
- package/dist/dailyhuntBidAdapter.js +1 -1
- package/dist/datablocksBidAdapter.js +1 -1
- package/dist/dependencies.json +4 -1
- package/dist/dgkeywordRtdProvider.js +1 -1
- package/dist/dmdIdSystem.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningAnalyticsAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/fabrickIdSystem.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/fintezaAnalyticsAdapter.js +1 -1
- package/dist/fledgeForGpt.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/genericAnalyticsAdapter.js +1 -1
- package/dist/geoedgeRtdProvider.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/gnetBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.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/growthCodeIdSystem.js +1 -1
- package/dist/growthCodeRtdProvider.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hadronAnalyticsAdapter.js +1 -1
- package/dist/hadronIdSystem.js +1 -1
- package/dist/hadronRtdProvider.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/iasRtdProvider.js +1 -1
- package/dist/id5AnalyticsAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/idImportLibrary.js +1 -1
- package/dist/identityLinkIdSystem.js +1 -1
- package/dist/imRtdProvider.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/impactifyBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/imuIdSystem.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/intentIqIdSystem.js +1 -1
- package/dist/invisiblyAnalyticsAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/jwplayerRtdProvider.js +1 -1
- package/dist/kargoAnalyticsAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/kinessoIdSystem.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/konduitWrapper.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/kulturemediaBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/limelightDigitalBidAdapter.js +1 -1
- package/dist/liveIntentAnalyticsAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/livewrappedAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/lotamePanoramaIdSystem.js +1 -1
- package/dist/luponmediaBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/mantisBidAdapter.js +1 -1
- package/dist/marsmediaAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/medianetAnalyticsAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/merkleIdSystem.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/mgidRtdProvider.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/mspa.js +1 -1
- package/dist/mwOpenLinkIdSystem.js +1 -1
- package/dist/nativoBidAdapter.js +1 -1
- package/dist/naveggIdSystem.js +1 -1
- package/dist/neuwoRtdProvider.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +248 -247
- package/dist/novatiqIdSystem.js +1 -1
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/open8BidAdapter.js +1 -1
- package/dist/operaadsBidAdapter.js +1 -1
- package/dist/operaadsIdSystem.js +1 -0
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/optimeraRtdProvider.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/oxxionAnalyticsAdapter.js +1 -1
- package/dist/oxxionRtdProvider.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +2 -2
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/prebidmanagerAnalyticsAdapter.js +1 -1
- package/dist/priceFloors.js +1 -1
- package/dist/prismaBidAdapter.js +1 -1
- package/dist/pubgeniusBidAdapter.js +1 -1
- package/dist/publinkIdSystem.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/qwarryBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/reconciliationRtdProvider.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/relevadRtdProvider.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rivrAnalyticsAdapter.js +1 -1
- package/dist/roxotAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/scaleableAnalyticsAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/silverpushBidAdapter.js +1 -1
- package/dist/sirdataRtdProvider.js +1 -1
- package/dist/slimcutBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smartyadsBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/snigelBidAdapter.js +1 -1
- package/dist/sonobiAnalyticsAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/staqAnalyticsAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/talkadsBidAdapter.js +1 -1
- package/dist/tapadIdSystem.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/teadsIdSystem.js +1 -1
- package/dist/terceptAnalyticsAdapter.js +1 -1
- package/dist/timeoutRtdProvider.js +1 -1
- package/dist/topicsFpdModule.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/unifiedIdSystem.js +1 -1
- package/dist/verizonMediaIdSystem.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vrtcalBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/weboramaRtdProvider.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/dist/yuktamediaAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspBidAdapter.js +1 -1
- package/integrationExamples/gpt/growthcode.html +3 -12
- package/integrationExamples/topics/topics-server.js +72 -0
- package/libraries/mspa/activityControls.js +3 -1
- package/modules/.submodules.json +2 -1
- package/modules/a1MediaRtdProvider.js +1 -1
- package/modules/adagioBidAdapter.js +11 -3
- package/modules/admaticBidAdapter.js +5 -0
- package/modules/adqueryBidAdapter.js +23 -21
- package/modules/adqueryIdSystem.js +45 -30
- package/modules/adrelevantisBidAdapter.js +2 -0
- package/modules/bidViewability.js +7 -0
- package/modules/bidViewability.md +9 -8
- package/modules/brandmetricsRtdProvider.js +30 -27
- package/modules/concertBidAdapter.js +1 -0
- package/modules/criteoBidAdapter.js +66 -43
- package/modules/fledgeForGpt.js +17 -4
- package/modules/fledgeForGpt.md +17 -10
- package/modules/geoedgeRtdProvider.js +44 -18
- package/modules/geoedgeRtdProvider.md +2 -1
- package/modules/growthCodeAnalyticsAdapter.js +7 -4
- package/modules/growthCodeAnalyticsAdapter.md +1 -7
- package/modules/liveIntentIdSystem.js +16 -1
- package/modules/nativoBidAdapter.js +21 -3
- package/modules/nexx360BidAdapter.js +7 -1
- package/modules/onetagBidAdapter.js +3 -0
- package/modules/operaadsBidAdapter.js +5 -0
- package/modules/operaadsBidAdapter.md +5 -5
- package/modules/operaadsIdSystem.js +106 -0
- package/modules/operaadsIdSystem.md +52 -0
- package/modules/oxxionAnalyticsAdapter.js +22 -5
- package/modules/prebidServerBidAdapter/index.js +8 -2
- package/modules/pubmaticAnalyticsAdapter.js +16 -3
- package/modules/rubiconBidAdapter.js +2 -2
- package/modules/smartyadsBidAdapter.js +18 -1
- package/modules/snigelBidAdapter.js +69 -16
- package/modules/snigelBidAdapter.md +9 -3
- package/modules/topicsFpdModule.js +35 -9
- package/modules/visxBidAdapter.js +51 -1
- package/package.json +2 -2
- package/src/adapters/bidderFactory.js +14 -5
- package/src/adloader.js +1 -0
- package/src/ajax.js +126 -87
- package/src/constants.json +8 -2
- package/src/native.js +14 -3
- package/test/mocks/xhr.js +256 -9
- package/test/spec/libraries/mspa/activityControls_spec.js +6 -0
- package/test/spec/modules/adagioBidAdapter_spec.js +15 -0
- package/test/spec/modules/adlooxAdServerVideo_spec.js +1 -5
- package/test/spec/modules/adlooxRtdProvider_spec.js +1 -5
- package/test/spec/modules/admaticBidAdapter_spec.js +5 -0
- package/test/spec/modules/adqueryIdSystem_spec.js +13 -24
- package/test/spec/modules/bidViewability_spec.js +32 -1
- package/test/spec/modules/brandmetricsRtdProvider_spec.js +6 -0
- package/test/spec/modules/categoryTranslation_spec.js +7 -9
- package/test/spec/modules/concertBidAdapter_spec.js +1 -1
- package/test/spec/modules/conversantAnalyticsAdapter_spec.js +3 -5
- package/test/spec/modules/criteoBidAdapter_spec.js +228 -0
- package/test/spec/modules/currency_spec.js +2 -2
- package/test/spec/modules/dmdIdSystem_spec.js +2 -2
- package/test/spec/modules/eids_spec.js +48 -0
- package/test/spec/modules/euidIdSystem_spec.js +10 -9
- package/test/spec/modules/feedadBidAdapter_spec.js +1 -1
- package/test/spec/modules/fledge_spec.js +117 -43
- package/test/spec/modules/geoedgeRtdProvider_spec.js +52 -39
- package/test/spec/modules/greenbidsRtdProvider_spec.js +3 -12
- package/test/spec/modules/growthCodeAnalyticsAdapter_spec.js +0 -1
- package/test/spec/modules/hadronIdSystem_spec.js +1 -1
- package/test/spec/modules/id5AnalyticsAdapter_spec.js +1 -7
- package/test/spec/modules/id5IdSystem_spec.js +25 -25
- package/test/spec/modules/identityLinkIdSystem_spec.js +0 -2
- package/test/spec/modules/intentIqIdSystem_spec.js +0 -2
- package/test/spec/modules/invisiblyAnalyticsAdapter_spec.js +2 -6
- package/test/spec/modules/jwplayerRtdProvider_spec.js +26 -28
- package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +5 -0
- package/test/spec/modules/liveIntentIdSystem_spec.js +5 -0
- package/test/spec/modules/magniteAnalyticsAdapter_spec.js +2 -2
- package/test/spec/modules/mgidRtdProvider_spec.js +1 -5
- package/test/spec/modules/nativoBidAdapter_spec.js +6 -1
- package/test/spec/modules/nexx360BidAdapter_spec.js +48 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +5 -19
- package/test/spec/modules/onetagBidAdapter_spec.js +69 -0
- package/test/spec/modules/ooloAnalyticsAdapter_spec.js +1 -1
- package/test/spec/modules/operaadsIdSystem_spec.js +53 -0
- package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +6 -1
- package/test/spec/modules/prebidServerBidAdapter_spec.js +33 -2
- package/test/spec/modules/priceFloors_spec.js +33 -37
- package/test/spec/modules/publinkIdSystem_spec.js +1 -1
- package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +102 -18
- package/test/spec/modules/pubwiseAnalyticsAdapter_spec.js +2 -8
- package/test/spec/modules/rubiconBidAdapter_spec.js +24 -0
- package/test/spec/modules/smartyadsBidAdapter_spec.js +49 -0
- package/test/spec/modules/snigelBidAdapter_spec.js +57 -6
- package/test/spec/modules/teadsIdSystem_spec.js +1 -1
- package/test/spec/modules/topicsFpdModule_spec.js +102 -1
- package/test/spec/modules/uid2IdSystem_helpers.js +5 -5
- package/test/spec/modules/uid2IdSystem_spec.js +24 -24
- package/test/spec/modules/userId_spec.js +1 -1
- package/test/spec/modules/visxBidAdapter_spec.js +151 -1
- package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +2 -5
- package/test/spec/native_spec.js +20 -5
- package/test/spec/unit/core/ajax_spec.js +403 -0
- package/test/spec/unit/core/bidderFactory_spec.js +80 -8
- package/test/spec/videoCache_spec.js +4 -4
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import {ajax} from '../src/ajax.js';
|
|
9
9
|
import {getStorageManager} from '../src/storageManager.js';
|
|
10
10
|
import {submodule} from '../src/hook.js';
|
|
11
|
-
import {
|
|
11
|
+
import {isFn, isPlainObject, isStr, logError, logInfo} from '../src/utils.js';
|
|
12
12
|
import {MODULE_TYPE_UID} from '../src/activities/modules.js';
|
|
13
13
|
|
|
14
14
|
const MODULE_NAME = 'qid';
|
|
@@ -51,11 +51,7 @@ export const adqueryIdSubmodule = {
|
|
|
51
51
|
* @returns {{qid:Object}}
|
|
52
52
|
*/
|
|
53
53
|
decode(value) {
|
|
54
|
-
|
|
55
|
-
if (isStr(qid)) {
|
|
56
|
-
return {qid: qid};
|
|
57
|
-
}
|
|
58
|
-
return (value && typeof value['qid'] === 'string') ? { 'qid': value['qid'] } : undefined;
|
|
54
|
+
return {qid: value}
|
|
59
55
|
},
|
|
60
56
|
/**
|
|
61
57
|
* performs action to obtain id and return a value in the callback's response argument
|
|
@@ -64,38 +60,57 @@ export const adqueryIdSubmodule = {
|
|
|
64
60
|
* @returns {IdResponse|undefined}
|
|
65
61
|
*/
|
|
66
62
|
getId(config) {
|
|
63
|
+
logInfo('adqueryIdSubmodule getId');
|
|
67
64
|
if (!isPlainObject(config.params)) {
|
|
68
65
|
config.params = {};
|
|
69
66
|
}
|
|
70
|
-
|
|
67
|
+
|
|
68
|
+
const url = paramOrDefault(
|
|
69
|
+
config.params.url,
|
|
71
70
|
`https://bidder.adquery.io/prebid/qid`,
|
|
72
|
-
config.params.urlArg
|
|
71
|
+
config.params.urlArg
|
|
72
|
+
);
|
|
73
73
|
|
|
74
74
|
const resp = function (callback) {
|
|
75
|
-
let qid =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
75
|
+
let qid = window.qid;
|
|
76
|
+
|
|
77
|
+
if (!qid) {
|
|
78
|
+
const ramdomValues = window.crypto.getRandomValues(new Uint32Array(4));
|
|
79
|
+
qid = (ramdomValues[0].toString(36) +
|
|
80
|
+
ramdomValues[1].toString(36) +
|
|
81
|
+
ramdomValues[2].toString(36) +
|
|
82
|
+
ramdomValues[3].toString(36))
|
|
83
|
+
.substring(0, 20);
|
|
84
|
+
|
|
85
|
+
const randomValues = Array.from(window.crypto.getRandomValues(new Uint32Array(4)));
|
|
86
|
+
qid = randomValues.map(it => it.toString(36)).join().substring(20);
|
|
87
|
+
logInfo('adqueryIdSubmodule ID QID GENERTAED:', qid);
|
|
88
|
+
}
|
|
89
|
+
logInfo('adqueryIdSubmodule ID QID:', qid);
|
|
90
|
+
|
|
91
|
+
const callbacks = {
|
|
92
|
+
success: response => {
|
|
93
|
+
let responseObj;
|
|
94
|
+
if (response) {
|
|
95
|
+
try {
|
|
96
|
+
responseObj = JSON.parse(response);
|
|
97
|
+
} catch (error) {
|
|
98
|
+
logError(error);
|
|
89
99
|
}
|
|
90
|
-
callback(responseObj);
|
|
91
|
-
},
|
|
92
|
-
error: error => {
|
|
93
|
-
logError(`${MODULE_NAME}: ID fetch encountered an error`, error);
|
|
94
|
-
callback();
|
|
95
100
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
if (responseObj.qid) {
|
|
102
|
+
let myQid = responseObj.qid;
|
|
103
|
+
storage.setDataInLocalStorage('qid', myQid);
|
|
104
|
+
return callback(myQid);
|
|
105
|
+
}
|
|
106
|
+
callback();
|
|
107
|
+
},
|
|
108
|
+
error: error => {
|
|
109
|
+
logError(`${MODULE_NAME}: ID fetch encountered an error`, error);
|
|
110
|
+
callback();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
ajax(url + '?qid=' + qid, callbacks, undefined, {method: 'GET'});
|
|
99
114
|
};
|
|
100
115
|
return {callback: resp};
|
|
101
116
|
},
|
|
@@ -67,6 +67,8 @@ export let logWinningBidNotFound = (slot) => {
|
|
|
67
67
|
|
|
68
68
|
export let impressionViewableHandler = (globalModuleConfig, slot, event) => {
|
|
69
69
|
let respectiveBid = getMatchingWinningBidForGPTSlot(globalModuleConfig, slot);
|
|
70
|
+
let respectiveDeferredAdUnit = getGlobal().adUnits.find(adUnit => adUnit.deferBilling && respectiveBid.adUnitCode === adUnit.code);
|
|
71
|
+
|
|
70
72
|
if (respectiveBid === null) {
|
|
71
73
|
logWinningBidNotFound(slot);
|
|
72
74
|
} else {
|
|
@@ -74,6 +76,11 @@ export let impressionViewableHandler = (globalModuleConfig, slot, event) => {
|
|
|
74
76
|
fireViewabilityPixels(globalModuleConfig, respectiveBid);
|
|
75
77
|
// trigger respective bidder's onBidViewable handler
|
|
76
78
|
adapterManager.callBidViewableBidder(respectiveBid.adapterCode || respectiveBid.bidder, respectiveBid);
|
|
79
|
+
|
|
80
|
+
if (respectiveDeferredAdUnit) {
|
|
81
|
+
adapterManager.callBidBillableBidder(respectiveBid);
|
|
82
|
+
}
|
|
83
|
+
|
|
77
84
|
// emit the BID_VIEWABLE event with bid details, this event can be consumed by bidders and analytics pixels
|
|
78
85
|
events.emit(CONSTANTS.EVENTS.BID_VIEWABLE, respectiveBid);
|
|
79
86
|
}
|
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Module Name: bidViewability
|
|
4
4
|
|
|
5
|
-
Purpose: Track when a bid is viewable
|
|
5
|
+
Purpose: Track when a bid is viewable (and also ready for billing)
|
|
6
6
|
|
|
7
7
|
Maintainer: harshad.mane@pubmatic.com
|
|
8
8
|
|
|
9
9
|
# Description
|
|
10
|
-
- This module, when included, will trigger a BID_VIEWABLE event which can be consumed by Analytics adapters, bidders will need to implement `onBidViewable` method to capture this event
|
|
11
|
-
-
|
|
10
|
+
- This module, when included, will trigger a BID_VIEWABLE event which can be consumed by Analytics adapters, bidders will need to implement the `onBidViewable` method to capture this event
|
|
11
|
+
- Bidders can check if this module is part of the final build and whether it is enabled or not by accessing ```pbjs.getConfig('bidViewability')```
|
|
12
12
|
- GPT API is used to find when a bid is viewable, https://developers.google.com/publisher-tag/reference#googletag.events.impressionviewableevent . This event is fired when an impression becomes viewable, according to the Active View criteria.
|
|
13
13
|
Refer: https://support.google.com/admanager/answer/4524488
|
|
14
|
-
-
|
|
14
|
+
- This module does not work with any adserver's other than GAM with GPT integration
|
|
15
15
|
- Logic used to find a matching pbjs-bid for a GPT slot is ``` (slot.getAdUnitPath() === bid.adUnitCode || slot.getSlotElementId() === bid.adUnitCode) ``` this logic can be changed by using param ```customMatchFunction```
|
|
16
|
-
- When a rendered PBJS bid is viewable the module will trigger BID_VIEWABLE event, which can be consumed by bidders and analytics adapters
|
|
17
|
-
-
|
|
16
|
+
- When a rendered PBJS bid is viewable the module will trigger a BID_VIEWABLE event, which can be consumed by bidders and analytics adapters
|
|
17
|
+
- If the viewable bid contains a ```vurls``` param containing URL's and the Bid Viewability module is configured with ``` firePixels: true ``` then the URLs mentioned in bid.vurls will be called. Please note that GDPR and USP related parameters will be added to the given URLs
|
|
18
|
+
- This module is also compatible with Prebid core's billing deferral logic, this means that bids linked to an ad unit marked with `deferBilling: true` will trigger a bid adapter's `onBidBillable` function (if present) indicating an ad slot was viewed and also billing ready (if it were deferred).
|
|
18
19
|
|
|
19
20
|
# Params
|
|
20
21
|
- enabled [required] [type: boolean, default: false], when set to true, the module will emit BID_VIEWABLE when applicable
|
|
@@ -44,6 +45,6 @@ Refer: https://support.google.com/admanager/answer/4524488
|
|
|
44
45
|
```
|
|
45
46
|
|
|
46
47
|
# Please Note:
|
|
47
|
-
-
|
|
48
|
-
- Works with Banner, Outsteam
|
|
48
|
+
- This module doesn't seem to work with Instream Video, https://docs.prebid.org/dev-docs/examples/instream-banner-mix.html as GPT's impressionViewable event is not triggered for instream-video-creative
|
|
49
|
+
- Works with Banner, Outsteam and Native creatives
|
|
49
50
|
|
|
@@ -21,13 +21,14 @@ let billableEventsInitialized = false
|
|
|
21
21
|
|
|
22
22
|
function init (config, userConsent) {
|
|
23
23
|
const hasConsent = checkConsent(userConsent)
|
|
24
|
+
const initialize = hasConsent !== false
|
|
24
25
|
|
|
25
|
-
if (
|
|
26
|
+
if (initialize) {
|
|
26
27
|
const moduleConfig = getMergedConfig(config)
|
|
27
28
|
initializeBrandmetrics(moduleConfig.params.scriptId)
|
|
28
29
|
initializeBillableEvents()
|
|
29
30
|
}
|
|
30
|
-
return
|
|
31
|
+
return initialize
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
/**
|
|
@@ -36,33 +37,35 @@ function init (config, userConsent) {
|
|
|
36
37
|
* @returns {boolean}
|
|
37
38
|
*/
|
|
38
39
|
function checkConsent (userConsent) {
|
|
39
|
-
let consent
|
|
40
|
-
|
|
41
|
-
if (userConsent
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
let consent
|
|
41
|
+
|
|
42
|
+
if (userConsent) {
|
|
43
|
+
if (userConsent.gdpr && userConsent.gdpr.gdprApplies) {
|
|
44
|
+
const gdpr = userConsent.gdpr
|
|
45
|
+
|
|
46
|
+
if (gdpr.vendorData) {
|
|
47
|
+
const vendor = gdpr.vendorData.vendor
|
|
48
|
+
const purpose = gdpr.vendorData.purpose
|
|
49
|
+
|
|
50
|
+
let vendorConsent = false
|
|
51
|
+
if (vendor.consents) {
|
|
52
|
+
vendorConsent = vendor.consents[GVL_ID]
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (vendor.legitimateInterests) {
|
|
56
|
+
vendorConsent = vendorConsent || vendor.legitimateInterests[GVL_ID]
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const purposes = TCF_PURPOSES.map(id => {
|
|
60
|
+
return (purpose.consents && purpose.consents[id]) || (purpose.legitimateInterests && purpose.legitimateInterests[id])
|
|
61
|
+
})
|
|
62
|
+
const purposesValid = purposes.filter(p => p === true).length === TCF_PURPOSES.length
|
|
63
|
+
consent = vendorConsent && purposesValid
|
|
51
64
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const purposes = TCF_PURPOSES.map(id => {
|
|
58
|
-
return (purpose.consents && purpose.consents[id]) || (purpose.legitimateInterests && purpose.legitimateInterests[id])
|
|
59
|
-
})
|
|
60
|
-
const purposesValid = purposes.filter(p => p === true).length === TCF_PURPOSES.length
|
|
61
|
-
consent = vendorConsent && purposesValid
|
|
65
|
+
} else if (userConsent.usp) {
|
|
66
|
+
const usp = userConsent.usp
|
|
67
|
+
consent = usp[1] !== 'N' && usp[2] !== 'Y'
|
|
62
68
|
}
|
|
63
|
-
} else if (userConsent.usp) {
|
|
64
|
-
const usp = userConsent.usp
|
|
65
|
-
consent = usp[1] !== 'N' && usp[2] !== 'Y'
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
return consent
|
|
@@ -41,6 +41,7 @@ export const spec = {
|
|
|
41
41
|
prebidVersion: '$prebid.version$',
|
|
42
42
|
pageUrl: bidderRequest.refererInfo.page,
|
|
43
43
|
screen: [window.screen.width, window.screen.height].join('x'),
|
|
44
|
+
browserLanguage: window.navigator.language,
|
|
44
45
|
debug: debugTurnedOn(),
|
|
45
46
|
uid: getUid(bidderRequest, validBidRequests),
|
|
46
47
|
optedOut: hasOptedOutOfPersonalization(),
|
|
@@ -3,7 +3,6 @@ import { loadExternalScript } from '../src/adloader.js';
|
|
|
3
3
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
4
4
|
import { config } from '../src/config.js';
|
|
5
5
|
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
6
|
-
import { find } from '../src/polyfill.js';
|
|
7
6
|
import { verify } from 'criteo-direct-rsa-validate/build/verify.js'; // ref#2
|
|
8
7
|
import { getStorageManager } from '../src/storageManager.js';
|
|
9
8
|
import { getRefererInfo } from '../src/refererDetection.js';
|
|
@@ -29,7 +28,7 @@ const LOG_PREFIX = 'Criteo: ';
|
|
|
29
28
|
Unminified source code can be found in the privately shared repo: https://github.com/Prebid-org/prebid-js-external-js-criteo/blob/master/dist/prod.js
|
|
30
29
|
*/
|
|
31
30
|
const FAST_BID_VERSION_PLACEHOLDER = '%FAST_BID_VERSION%';
|
|
32
|
-
export const FAST_BID_VERSION_CURRENT =
|
|
31
|
+
export const FAST_BID_VERSION_CURRENT = 139;
|
|
33
32
|
const FAST_BID_VERSION_LATEST = 'latest';
|
|
34
33
|
const FAST_BID_VERSION_NONE = 'none';
|
|
35
34
|
const PUBLISHER_TAG_URL_TEMPLATE = 'https://static.criteo.net/js/ld/publishertag.prebid' + FAST_BID_VERSION_PLACEHOLDER + '.js';
|
|
@@ -219,51 +218,53 @@ export const spec = {
|
|
|
219
218
|
|
|
220
219
|
if (body && body.slots && isArray(body.slots)) {
|
|
221
220
|
body.slots.forEach(slot => {
|
|
222
|
-
const bidRequest =
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
if (body.ext?.paf?.transmission && slot.ext?.paf?.content_id) {
|
|
236
|
-
const pafResponseMeta = {
|
|
237
|
-
content_id: slot.ext.paf.content_id,
|
|
238
|
-
transmission: response.ext.paf.transmission
|
|
221
|
+
const bidRequest = getAssociatedBidRequest(request.bidRequests, slot);
|
|
222
|
+
if (bidRequest) {
|
|
223
|
+
const bidId = bidRequest.bidId;
|
|
224
|
+
const bid = {
|
|
225
|
+
requestId: bidId,
|
|
226
|
+
cpm: slot.cpm,
|
|
227
|
+
currency: slot.currency,
|
|
228
|
+
netRevenue: true,
|
|
229
|
+
ttl: slot.ttl || 60,
|
|
230
|
+
creativeId: slot.creativecode,
|
|
231
|
+
width: slot.width,
|
|
232
|
+
height: slot.height,
|
|
233
|
+
dealId: slot.deal,
|
|
239
234
|
};
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
bid.meta = Object.assign({}, bid.meta, { networkName: slot.ext.meta.networkName })
|
|
247
|
-
}
|
|
248
|
-
if (slot.native) {
|
|
249
|
-
if (bidRequest.params.nativeCallback) {
|
|
250
|
-
bid.ad = createNativeAd(bidId, slot.native, bidRequest.params.nativeCallback);
|
|
251
|
-
} else {
|
|
252
|
-
bid.native = createPrebidNativeAd(slot.native);
|
|
253
|
-
bid.mediaType = NATIVE;
|
|
235
|
+
if (body.ext?.paf?.transmission && slot.ext?.paf?.content_id) {
|
|
236
|
+
const pafResponseMeta = {
|
|
237
|
+
content_id: slot.ext.paf.content_id,
|
|
238
|
+
transmission: response.ext.paf.transmission
|
|
239
|
+
};
|
|
240
|
+
bid.meta = Object.assign({}, bid.meta, { paf: pafResponseMeta });
|
|
254
241
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
bid.mediaType = VIDEO;
|
|
258
|
-
const context = deepAccess(bidRequest, 'mediaTypes.video.context');
|
|
259
|
-
// if outstream video, add a default render for it.
|
|
260
|
-
if (context === OUTSTREAM) {
|
|
261
|
-
bid.renderer = createOutstreamVideoRenderer(slot);
|
|
242
|
+
if (slot.adomain) {
|
|
243
|
+
bid.meta = Object.assign({}, bid.meta, { advertiserDomains: [slot.adomain].flat() });
|
|
262
244
|
}
|
|
263
|
-
|
|
264
|
-
|
|
245
|
+
if (slot.ext?.meta?.networkName) {
|
|
246
|
+
bid.meta = Object.assign({}, bid.meta, { networkName: slot.ext.meta.networkName })
|
|
247
|
+
}
|
|
248
|
+
if (slot.native) {
|
|
249
|
+
if (bidRequest.params.nativeCallback) {
|
|
250
|
+
bid.ad = createNativeAd(bidId, slot.native, bidRequest.params.nativeCallback);
|
|
251
|
+
} else {
|
|
252
|
+
bid.native = createPrebidNativeAd(slot.native);
|
|
253
|
+
bid.mediaType = NATIVE;
|
|
254
|
+
}
|
|
255
|
+
} else if (slot.video) {
|
|
256
|
+
bid.vastUrl = slot.displayurl;
|
|
257
|
+
bid.mediaType = VIDEO;
|
|
258
|
+
const context = deepAccess(bidRequest, 'mediaTypes.video.context');
|
|
259
|
+
// if outstream video, add a default render for it.
|
|
260
|
+
if (context === OUTSTREAM) {
|
|
261
|
+
bid.renderer = createOutstreamVideoRenderer(slot);
|
|
262
|
+
}
|
|
263
|
+
} else {
|
|
264
|
+
bid.ad = slot.creative;
|
|
265
|
+
}
|
|
266
|
+
bids.push(bid);
|
|
265
267
|
}
|
|
266
|
-
bids.push(bid);
|
|
267
268
|
});
|
|
268
269
|
}
|
|
269
270
|
|
|
@@ -462,6 +463,7 @@ function buildCdbRequest(context, bidRequests, bidderRequest) {
|
|
|
462
463
|
networkId = bidRequest.params.networkId || networkId;
|
|
463
464
|
schain = bidRequest.schain || schain;
|
|
464
465
|
const slot = {
|
|
466
|
+
slotid: bidRequest.bidId,
|
|
465
467
|
impid: bidRequest.adUnitCode,
|
|
466
468
|
transactionid: bidRequest.ortb2Imp?.ext?.tid
|
|
467
469
|
};
|
|
@@ -786,6 +788,27 @@ function createOutstreamVideoRenderer(slot) {
|
|
|
786
788
|
return renderer;
|
|
787
789
|
}
|
|
788
790
|
|
|
791
|
+
function getAssociatedBidRequest(bidRequests, slot) {
|
|
792
|
+
for (const request of bidRequests) {
|
|
793
|
+
if (request.adUnitCode === slot.impid) {
|
|
794
|
+
if (request.params.zoneId && parseInt(request.params.zoneId) === slot.zoneid) {
|
|
795
|
+
return request;
|
|
796
|
+
} else if (slot.native) {
|
|
797
|
+
if (request.mediaTypes?.native || request.nativeParams) {
|
|
798
|
+
return request;
|
|
799
|
+
}
|
|
800
|
+
} else if (slot.video) {
|
|
801
|
+
if (request.mediaTypes?.video) {
|
|
802
|
+
return request;
|
|
803
|
+
}
|
|
804
|
+
} else if (request.mediaTypes?.banner || request.sizes) {
|
|
805
|
+
return request;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
return undefined;
|
|
810
|
+
}
|
|
811
|
+
|
|
789
812
|
export function tryGetCriteoFastBid() {
|
|
790
813
|
// begin ref#1
|
|
791
814
|
try {
|
package/modules/fledgeForGpt.js
CHANGED
|
@@ -20,12 +20,14 @@ export function init(cfg) {
|
|
|
20
20
|
if (cfg && cfg.enabled === true) {
|
|
21
21
|
if (!isEnabled) {
|
|
22
22
|
getHook('addComponentAuction').before(addComponentAuctionHook);
|
|
23
|
+
getHook('makeBidRequests').after(markForFledge);
|
|
23
24
|
isEnabled = true;
|
|
24
25
|
}
|
|
25
26
|
logInfo(`${MODULE} enabled (browser ${isFledgeSupported() ? 'supports' : 'does NOT support'} fledge)`, cfg);
|
|
26
27
|
} else {
|
|
27
28
|
if (isEnabled) {
|
|
28
29
|
getHook('addComponentAuction').getHooks({hook: addComponentAuctionHook}).remove();
|
|
30
|
+
getHook('makeBidRequests').getHooks({hook: markForFledge}).remove()
|
|
29
31
|
isEnabled = false;
|
|
30
32
|
}
|
|
31
33
|
logInfo(`${MODULE} disabled`, cfg);
|
|
@@ -56,16 +58,27 @@ function isFledgeSupported() {
|
|
|
56
58
|
|
|
57
59
|
export function markForFledge(next, bidderRequests) {
|
|
58
60
|
if (isFledgeSupported()) {
|
|
61
|
+
const globalFledgeConfig = config.getConfig('fledgeForGpt');
|
|
62
|
+
const bidders = globalFledgeConfig?.bidders ?? [];
|
|
59
63
|
bidderRequests.forEach((req) => {
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
const useGlobalConfig = globalFledgeConfig?.enabled && (bidders.length == 0 || bidders.includes(req.bidderCode));
|
|
65
|
+
Object.assign(req, config.runWithBidder(req.bidderCode, () => {
|
|
66
|
+
return {
|
|
67
|
+
fledgeEnabled: config.getConfig('fledgeEnabled') ?? (useGlobalConfig ? globalFledgeConfig.enabled : undefined),
|
|
68
|
+
defaultForSlots: config.getConfig('defaultForSlots') ?? (useGlobalConfig ? globalFledgeConfig?.defaultForSlots : undefined)
|
|
69
|
+
}
|
|
70
|
+
}));
|
|
71
|
+
});
|
|
62
72
|
}
|
|
63
73
|
next(bidderRequests);
|
|
64
74
|
}
|
|
65
|
-
getHook('makeBidRequests').after(markForFledge);
|
|
66
75
|
|
|
67
76
|
export function setImpExtAe(imp, bidRequest, context) {
|
|
68
|
-
if (
|
|
77
|
+
if (context.bidderRequest.fledgeEnabled) {
|
|
78
|
+
imp.ext = Object.assign(imp.ext || {}, {
|
|
79
|
+
ae: imp.ext?.ae ?? context.bidderRequest.defaultForSlots
|
|
80
|
+
})
|
|
81
|
+
} else {
|
|
69
82
|
delete imp.ext?.ae;
|
|
70
83
|
}
|
|
71
84
|
}
|
package/modules/fledgeForGpt.md
CHANGED
|
@@ -15,8 +15,8 @@ This is accomplished by adding the `fledgeForGpt` module to the list of modules
|
|
|
15
15
|
gulp build --modules=fledgeForGpt,...
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Second, they must enable FLEDGE in their Prebid.js configuration.
|
|
19
|
-
|
|
18
|
+
Second, they must enable FLEDGE in their Prebid.js configuration.
|
|
19
|
+
This is done through module level configuration, but to provide a high degree of flexiblity for testing, FLEDGE settings also exist at the bidder level and slot level.
|
|
20
20
|
|
|
21
21
|
### Module Configuration
|
|
22
22
|
This module exposes the following settings:
|
|
@@ -24,15 +24,20 @@ This module exposes the following settings:
|
|
|
24
24
|
|Name |Type |Description |Notes |
|
|
25
25
|
| :------------ | :------------ | :------------ |:------------ |
|
|
26
26
|
|enabled | Boolean |Enable/disable the module |Defaults to `false` |
|
|
27
|
+
|bidders | Array[String] |Optional list of bidders |Defaults to all bidders |
|
|
28
|
+
|defaultForSlots | Number |Default value for `imp.ext.ae` in requests for specified bidders |Should be 1 |
|
|
27
29
|
|
|
28
|
-
As noted above, FLEDGE support is disabled by default. To enable it, set the `enabled` value to `true` for this module
|
|
29
|
-
using the `setConfig` method of Prebid.js
|
|
30
|
+
As noted above, FLEDGE support is disabled by default. To enable it, set the `enabled` value to `true` for this module and configure `defaultForSlots` to be `1` (meaning _Client-side auction_).
|
|
31
|
+
using the `setConfig` method of Prebid.js. Optionally, a list of
|
|
32
|
+
bidders to apply these settings to may be provided:
|
|
30
33
|
|
|
31
34
|
```js
|
|
32
35
|
pbjs.que.push(function() {
|
|
33
36
|
pbjs.setConfig({
|
|
34
37
|
fledgeForGpt: {
|
|
35
|
-
enabled: true
|
|
38
|
+
enabled: true,
|
|
39
|
+
bidders: ['openx', 'rtbhouse'],
|
|
40
|
+
defaultForSlots: 1
|
|
36
41
|
}
|
|
37
42
|
});
|
|
38
43
|
});
|
|
@@ -44,23 +49,25 @@ This module adds the following setting for bidders:
|
|
|
44
49
|
|Name |Type |Description |Notes |
|
|
45
50
|
| :------------ | :------------ | :------------ |:------------ |
|
|
46
51
|
| fledgeEnabled | Boolean | Enable/disable a bidder to participate in FLEDGE | Defaults to `false` |
|
|
52
|
+
|defaultForSlots | Number |Default value for `imp.ext.ae` in requests for specified bidders |Should be 1|
|
|
47
53
|
|
|
48
|
-
|
|
49
|
-
selectively test with one or more bidders as they desire. To enable one or more bidders, use the `setBidderConfig` method
|
|
54
|
+
Individual bidders may be further included or excluded here using the `setBidderConfig` method
|
|
50
55
|
of Prebid.js:
|
|
51
56
|
|
|
52
57
|
```js
|
|
53
58
|
pbjs.setBidderConfig({
|
|
54
59
|
bidders: ["openx"],
|
|
55
60
|
config: {
|
|
56
|
-
fledgeEnabled: true
|
|
61
|
+
fledgeEnabled: true,
|
|
62
|
+
defaultForSlots: 1
|
|
57
63
|
}
|
|
58
64
|
});
|
|
59
65
|
```
|
|
60
66
|
|
|
61
67
|
### AdUnit Configuration
|
|
62
|
-
|
|
63
|
-
|
|
68
|
+
All adunits can be opted-in to FLEDGE in the global config via the `defaultForSlots` parameter.
|
|
69
|
+
If needed, adunits can be configured individually by setting an attribute of the `ortb2Imp` object for that
|
|
70
|
+
adunit. This attribute will take precedence over `defaultForSlots` setting.
|
|
64
71
|
|
|
65
72
|
|Name |Type |Description |Notes |
|
|
66
73
|
| :------------ | :------------ | :------------ |:------------ |
|
|
@@ -20,6 +20,8 @@ import { ajax } from '../src/ajax.js';
|
|
|
20
20
|
import { generateUUID, insertElement, isEmpty, logError } from '../src/utils.js';
|
|
21
21
|
import * as events from '../src/events.js';
|
|
22
22
|
import CONSTANTS from '../src/constants.json';
|
|
23
|
+
import { loadExternalScript } from '../src/adloader.js';
|
|
24
|
+
import { auctionManager } from '../src/auctionManager.js';
|
|
23
25
|
|
|
24
26
|
/** @type {string} */
|
|
25
27
|
const SUBMODULE_NAME = 'geoedge';
|
|
@@ -33,9 +35,13 @@ const PV_ID = generateUUID();
|
|
|
33
35
|
/** @type {string} */
|
|
34
36
|
const HOST_NAME = 'https://rumcdn.geoedge.be';
|
|
35
37
|
/** @type {string} */
|
|
36
|
-
const
|
|
38
|
+
const FILE_NAME_CLIENT = 'grumi.js';
|
|
39
|
+
/** @type {string} */
|
|
40
|
+
const FILE_NAME_INPAGE = 'grumi-ip.js';
|
|
41
|
+
/** @type {function} */
|
|
42
|
+
export let getClientUrl = (key) => `${HOST_NAME}/${key}/${FILE_NAME_CLIENT}`;
|
|
37
43
|
/** @type {function} */
|
|
38
|
-
export let
|
|
44
|
+
export let getInPageUrl = (key) => `${HOST_NAME}/${key}/${FILE_NAME_INPAGE}`;
|
|
39
45
|
/** @type {string} */
|
|
40
46
|
export let wrapper
|
|
41
47
|
/** @type {boolean} */;
|
|
@@ -177,7 +183,8 @@ function isSupportedBidder(bidder, paramsBidders) {
|
|
|
177
183
|
function shouldWrap(bid, params) {
|
|
178
184
|
let supportedBidder = isSupportedBidder(bid.bidderCode, params.bidders);
|
|
179
185
|
let donePreload = params.wap ? preloaded : true;
|
|
180
|
-
|
|
186
|
+
let isGPT = params.gpt;
|
|
187
|
+
return wrapperReady && supportedBidder && donePreload && !isGPT;
|
|
181
188
|
}
|
|
182
189
|
|
|
183
190
|
function conditionallyWrap(bidResponse, config, userConsent) {
|
|
@@ -187,31 +194,55 @@ function conditionallyWrap(bidResponse, config, userConsent) {
|
|
|
187
194
|
}
|
|
188
195
|
}
|
|
189
196
|
|
|
197
|
+
function isBillingMessage(data, params) {
|
|
198
|
+
return data.key === params.key && data.impression;
|
|
199
|
+
}
|
|
200
|
+
|
|
190
201
|
/**
|
|
191
|
-
* Fire billable events
|
|
202
|
+
* Fire billable events when our client sends a message
|
|
203
|
+
* Messages will be sent only when:
|
|
204
|
+
* a. applicable bids are wrapped
|
|
205
|
+
* b. our code laoded and executed sucesfully
|
|
192
206
|
*/
|
|
193
207
|
function fireBillableEventsForApplicableBids(params) {
|
|
194
|
-
|
|
195
|
-
|
|
208
|
+
window.addEventListener('message', function (message) {
|
|
209
|
+
let data = message.data;
|
|
210
|
+
if (isBillingMessage(data, params)) {
|
|
211
|
+
let winningBid = auctionManager.findBidByAdId(data.adId);
|
|
196
212
|
events.emit(CONSTANTS.EVENTS.BILLABLE_EVENT, {
|
|
197
213
|
vendor: SUBMODULE_NAME,
|
|
198
|
-
billingId:
|
|
199
|
-
type: 'impression',
|
|
200
|
-
transactionId: winningBid.transactionId,
|
|
201
|
-
auctionId: winningBid.auctionId,
|
|
202
|
-
bidId: winningBid.requestId
|
|
214
|
+
billingId: data.impressionId,
|
|
215
|
+
type: winningBid ? 'impression' : data.type,
|
|
216
|
+
transactionId: winningBid?.transactionId || data.transactionId,
|
|
217
|
+
auctionId: winningBid?.auctionId || data.auctionId,
|
|
218
|
+
bidId: winningBid?.requestId || data.requestId
|
|
203
219
|
});
|
|
204
220
|
}
|
|
205
221
|
});
|
|
206
222
|
}
|
|
207
223
|
|
|
224
|
+
/**
|
|
225
|
+
* Loads Geoedge in page script that monitors all ad slots created by GPT
|
|
226
|
+
* @param {Object} params
|
|
227
|
+
*/
|
|
228
|
+
function setupInPage(params) {
|
|
229
|
+
window.grumi = params;
|
|
230
|
+
window.grumi.fromPrebid = true;
|
|
231
|
+
loadExternalScript(getInPageUrl(params.key), SUBMODULE_NAME);
|
|
232
|
+
}
|
|
233
|
+
|
|
208
234
|
function init(config, userConsent) {
|
|
209
235
|
let params = config.params;
|
|
210
236
|
if (!params || !params.key) {
|
|
211
237
|
logError('missing key for geoedge RTD module provider');
|
|
212
238
|
return false;
|
|
213
239
|
}
|
|
214
|
-
|
|
240
|
+
if (params.gpt) {
|
|
241
|
+
setupInPage(params);
|
|
242
|
+
} else {
|
|
243
|
+
fetchWrapper(setWrapper);
|
|
244
|
+
preloadClient(params.key);
|
|
245
|
+
}
|
|
215
246
|
fireBillableEventsForApplicableBids(params);
|
|
216
247
|
return true;
|
|
217
248
|
}
|
|
@@ -227,9 +258,4 @@ export const geoedgeSubmodule = {
|
|
|
227
258
|
onBidResponseEvent: conditionallyWrap
|
|
228
259
|
};
|
|
229
260
|
|
|
230
|
-
|
|
231
|
-
fetchWrapper(setWrapper);
|
|
232
|
-
submodule('realTimeData', geoedgeSubmodule);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
beforeInit();
|
|
261
|
+
submodule('realTimeData', geoedgeSubmodule);
|
|
@@ -5,7 +5,7 @@ Module Type: Rtd Provider
|
|
|
5
5
|
Maintainer: guy.books@geoedge.com
|
|
6
6
|
|
|
7
7
|
The Geoedge Realtime module lets publishers block bad ads such as automatic redirects, malware, offensive creatives and landing pages.
|
|
8
|
-
To use this module, you'll need to work with [Geoedge](https://www.geoedge.com/publishers-real-time-protection/) to get an account and
|
|
8
|
+
To use this module, you'll need to work with [Geoedge](https://www.geoedge.com/publishers-real-time-protection/) to get an account and customer key.
|
|
9
9
|
|
|
10
10
|
## Integration
|
|
11
11
|
|
|
@@ -49,6 +49,7 @@ Parameters details:
|
|
|
49
49
|
|params.key | String | Customer key |Required, contact Geoedge to get your key |
|
|
50
50
|
|params.bidders | Object | Bidders to monitor |Optional, list of bidder to include / exclude from monitoring. Omitting this will monitor bids from all bidders. |
|
|
51
51
|
|params.wap |Boolean |Wrap after preload |Optional, defaults to `false`. Set to `true` if you want to monitor only after the module has preloaded the monitoring client. |
|
|
52
|
+
|params.gpt |Boolean |Wrap all GPT ad slots |Optional, defaults to `false`. Set to `true` if you want to monitor all Google Publisher Tag ad slots, regaedless if the winning bid comes from Prebid or Google Ad Manager (Direct, Adx, Adesnse, Open Bidding, etc). |
|
|
52
53
|
|
|
53
54
|
## Example
|
|
54
55
|
|