prebid.js 7.0.0 → 7.1.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/bundle-template.txt +2 -2
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/adWMGAnalyticsAdapter.js +1 -1
- package/dist/adagioAnalyticsAdapter.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/adlooxAnalyticsAdapter.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/adomikAnalyticsAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/aduptechBidAdapter.js +1 -1
- package/dist/adxcgAnalyticsAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adxpremiumAnalyticsAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.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/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/bidwatchAnalyticsAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/byDataAnalyticsAdapter.js +1 -1
- package/dist/concertAnalyticsAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consentManagement.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/datablocksAnalyticsAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningAnalyticsAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/fintezaAnalyticsAdapter.js +1 -1
- package/dist/getOrigin.js +1 -0
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hadronAnalyticsAdapter.js +1 -1
- package/dist/id5AnalyticsAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/invisiblyAnalyticsAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoAnalyticsAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/livewrappedAnalyticsAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.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/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +150 -147
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxAnalyticsAdapter.js +1 -1
- package/dist/optimonAnalyticsAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pianoDmpAnalyticsAdapter.js +1 -0
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/prebidmanagerAnalyticsAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubperfAnalyticsAdapter.js +1 -1
- package/dist/pubstackAnalyticsAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubxaiAnalyticsAdapter.js +1 -1
- package/dist/pulsepointAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/realvuAnalyticsAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/relevantAnalyticsAdapter.js +1 -1
- package/dist/resetdigitalBidAdapter.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/rtbhouseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.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/sigmoidAnalyticsAdapter.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/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/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/terceptAnalyticsAdapter.js +1 -1
- package/dist/trafficgateBidAdapter.js +1 -0
- 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/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/vidazooBidAdapter.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/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/gulpHelpers.js +53 -16
- package/gulpfile.js +1 -0
- package/integrationExamples/gpt/gdpr_hello_world.html +14 -77
- package/karma.conf.maker.js +6 -0
- package/libraries/getOrigin/index.js +11 -0
- package/modules/.submodules.json +83 -69
- package/modules/aduptechBidAdapter.js +30 -0
- package/modules/adxpremiumAnalyticsAdapter.js +1 -0
- package/modules/consentManagement.js +15 -6
- package/modules/cwireBidAdapter.js +8 -2
- package/modules/cwireBidAdapter.md +3 -3
- package/modules/ooloAnalyticsAdapter.js +2 -1
- package/modules/pianoDmpAnalyticcsAdapter.md +13 -0
- package/modules/pianoDmpAnalyticsAdapter.js +38 -0
- package/modules/resetdigitalBidAdapter.js +2 -1
- package/modules/rtbhouseBidAdapter.js +2 -1
- package/modules/synacormediaBidAdapter.js +7 -0
- package/modules/trafficgateBidAdapter.js +92 -0
- package/modules/trafficgateBidAdapter.md +30 -0
- package/modules/tripleliftBidAdapter.js +27 -0
- package/package.json +1 -1
- package/src/AnalyticsAdapter.js +13 -6
- package/src/utils.js +0 -11
- package/test/spec/AnalyticsAdapter_spec.js +8 -0
- package/test/spec/modules/aduptechBidAdapter_spec.js +65 -0
- package/test/spec/modules/consentManagement_spec.js +75 -16
- package/test/spec/modules/cwireBidAdapter_spec.js +24 -11
- package/test/spec/modules/pianoDmpAnalyticsAdapter_spec.js +66 -0
- package/test/spec/modules/synacormediaBidAdapter_spec.js +44 -0
- package/test/spec/modules/trafficgateBidAdapter_spec.js +223 -0
- package/test/spec/modules/tripleliftBidAdapter_spec.js +70 -1
- package/webpack.conf.js +14 -1
- package/integrationExamples/gpt/gdpr_indefinite_timeout_exampe.html +0 -151
package/modules/.submodules.json
CHANGED
|
@@ -1,71 +1,85 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
2
|
+
"parentModules": {
|
|
3
|
+
"userId": [
|
|
4
|
+
"33acrossIdSystem",
|
|
5
|
+
"admixerIdSystem",
|
|
6
|
+
"adtelligentIdSystem",
|
|
7
|
+
"amxIdSystem",
|
|
8
|
+
"britepoolIdSystem",
|
|
9
|
+
"connectIdSystem",
|
|
10
|
+
"cpexIdSystem",
|
|
11
|
+
"criteoIdSystem",
|
|
12
|
+
"dacIdSystem",
|
|
13
|
+
"deepintentDpesIdSystem",
|
|
14
|
+
"dmdIdSystem",
|
|
15
|
+
"fabrickIdSystem",
|
|
16
|
+
"hadronIdSystem",
|
|
17
|
+
"id5IdSystem",
|
|
18
|
+
"ftrackIdSystem",
|
|
19
|
+
"identityLinkIdSystem",
|
|
20
|
+
"idxIdSystem",
|
|
21
|
+
"imuIdSystem",
|
|
22
|
+
"intentIqIdSystem",
|
|
23
|
+
"justIdSystem",
|
|
24
|
+
"kinessoIdSystem",
|
|
25
|
+
"liveIntentIdSystem",
|
|
26
|
+
"lotamePanoramaIdSystem",
|
|
27
|
+
"merkleIdSystem",
|
|
28
|
+
"mwOpenLinkIdSystem",
|
|
29
|
+
"naveggIdSystem",
|
|
30
|
+
"netIdSystem",
|
|
31
|
+
"novatiqIdSystem",
|
|
32
|
+
"parrableIdSystem",
|
|
33
|
+
"pubProvidedIdSystem",
|
|
34
|
+
"publinkIdSystem",
|
|
35
|
+
"quantcastIdSystem",
|
|
36
|
+
"sharedIdSystem",
|
|
37
|
+
"tapadIdSystem",
|
|
38
|
+
"trustpidSystem",
|
|
39
|
+
"uid2IdSystem",
|
|
40
|
+
"unifiedIdSystem",
|
|
41
|
+
"verizonMediaIdSystem",
|
|
42
|
+
"zeotapIdPlusIdSystem",
|
|
43
|
+
"adqueryIdSystem",
|
|
44
|
+
"gravitoIdSystem"
|
|
45
|
+
],
|
|
46
|
+
"adpod": [
|
|
47
|
+
"freeWheelAdserverVideo",
|
|
48
|
+
"dfpAdServerVideo"
|
|
49
|
+
],
|
|
50
|
+
"rtdModule": [
|
|
51
|
+
"airgridRtdProvider",
|
|
52
|
+
"akamaiDapRtdProvider",
|
|
53
|
+
"browsiRtdProvider",
|
|
54
|
+
"dgkeywordRtdProvider",
|
|
55
|
+
"geoedgeRtdProvider",
|
|
56
|
+
"hadronRtdProvider",
|
|
57
|
+
"haloRtdProvider",
|
|
58
|
+
"iasRtdProvider",
|
|
59
|
+
"jwplayerRtdProvider",
|
|
60
|
+
"medianetRtdProvider",
|
|
61
|
+
"optimeraRtdProvider",
|
|
62
|
+
"permutiveRtdProvider",
|
|
63
|
+
"reconciliationRtdProvider",
|
|
64
|
+
"sirdataRtdProvider",
|
|
65
|
+
"timeoutRtdProvider",
|
|
66
|
+
"weboramaRtdProvider"
|
|
67
|
+
],
|
|
68
|
+
"fpdModule": [
|
|
69
|
+
"enrichmentFpdModule",
|
|
70
|
+
"validationFpdModule"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"libraries": {
|
|
74
|
+
"getOrigin": {
|
|
75
|
+
"files": [
|
|
76
|
+
"./index.js"
|
|
77
|
+
],
|
|
78
|
+
"dependants": [
|
|
79
|
+
"ooloAnalyticsAdapter",
|
|
80
|
+
"resetdigitalBidAdapter",
|
|
81
|
+
"rtbhouseBidAdapter.js"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
71
85
|
}
|
|
@@ -94,6 +94,30 @@ export const internal = {
|
|
|
94
94
|
return null;
|
|
95
95
|
},
|
|
96
96
|
|
|
97
|
+
/**
|
|
98
|
+
* Extracts the floor price params from given bidRequest
|
|
99
|
+
*
|
|
100
|
+
* @param {BidRequest} bidRequest
|
|
101
|
+
* @returns {undefined|float}
|
|
102
|
+
*/
|
|
103
|
+
extractFloorPrice: (bidRequest) => {
|
|
104
|
+
let floorPrice;
|
|
105
|
+
if (bidRequest && bidRequest.params && bidRequest.params.floor) {
|
|
106
|
+
// if there is a manual floorPrice set
|
|
107
|
+
floorPrice = !isNaN(parseInt(bidRequest.params.floor)) ? bidRequest.params.floor : undefined;
|
|
108
|
+
}
|
|
109
|
+
if (typeof bidRequest.getFloor === 'function') {
|
|
110
|
+
// use prebid floor module
|
|
111
|
+
let floorInfo;
|
|
112
|
+
try {
|
|
113
|
+
floorInfo = bidRequest.getFloor();
|
|
114
|
+
} catch (e) {}
|
|
115
|
+
floorPrice = typeof floorInfo === 'object' && !isNaN(parseInt(floorInfo.floor)) ? floorInfo.floor : floorPrice;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return floorPrice;
|
|
119
|
+
},
|
|
120
|
+
|
|
97
121
|
/**
|
|
98
122
|
* Group given array of bidRequests by params.publisher
|
|
99
123
|
*
|
|
@@ -229,6 +253,12 @@ export const spec = {
|
|
|
229
253
|
bid.native = nativeConfig;
|
|
230
254
|
}
|
|
231
255
|
|
|
256
|
+
// add floor price
|
|
257
|
+
const floorPrice = internal.extractFloorPrice(bidRequest);
|
|
258
|
+
if (floorPrice) {
|
|
259
|
+
bid.floorPrice = floorPrice;
|
|
260
|
+
}
|
|
261
|
+
|
|
232
262
|
request.data.imp.push(bid);
|
|
233
263
|
});
|
|
234
264
|
|
|
@@ -20,6 +20,7 @@ export let staticConsentData;
|
|
|
20
20
|
|
|
21
21
|
let consentData;
|
|
22
22
|
let addedConsentHook = false;
|
|
23
|
+
let provisionalConsent;
|
|
23
24
|
|
|
24
25
|
// add new CMPs here, with their dedicated lookup function
|
|
25
26
|
const cmpCallMap = {
|
|
@@ -78,6 +79,8 @@ function lookupIabConsent({onSuccess, onError}) {
|
|
|
78
79
|
if (success) {
|
|
79
80
|
if (tcfData.gdprApplies === false || tcfData.eventStatus === 'tcloaded' || tcfData.eventStatus === 'useractioncomplete') {
|
|
80
81
|
processCmpData(tcfData, {onSuccess, onError});
|
|
82
|
+
} else {
|
|
83
|
+
provisionalConsent = tcfData;
|
|
81
84
|
}
|
|
82
85
|
} else {
|
|
83
86
|
onError('CMP unable to register callback function. Please check CMP setup.');
|
|
@@ -185,13 +188,19 @@ function loadConsentData(cb) {
|
|
|
185
188
|
cmpCallMap[userCMP](callbacks);
|
|
186
189
|
|
|
187
190
|
if (!isDone) {
|
|
191
|
+
const onTimeout = () => {
|
|
192
|
+
const continueToAuction = (data) => {
|
|
193
|
+
done(data, false, 'CMP did not load, continuing auction...');
|
|
194
|
+
}
|
|
195
|
+
processCmpData(provisionalConsent, {
|
|
196
|
+
onSuccess: continueToAuction,
|
|
197
|
+
onError: () => continueToAuction(storeConsentData(undefined))
|
|
198
|
+
})
|
|
199
|
+
}
|
|
188
200
|
if (consentTimeout === 0) {
|
|
189
|
-
|
|
201
|
+
onTimeout();
|
|
190
202
|
} else {
|
|
191
|
-
timer = setTimeout(
|
|
192
|
-
// on timeout, allow the auction to continue
|
|
193
|
-
done(storeConsentData(undefined), false, `No response from CMP, continuing auction...`)
|
|
194
|
-
}, consentTimeout);
|
|
203
|
+
timer = setTimeout(onTimeout, consentTimeout);
|
|
195
204
|
}
|
|
196
205
|
}
|
|
197
206
|
}
|
|
@@ -253,7 +262,7 @@ function processCmpData(consentObject, {onSuccess, onError}) {
|
|
|
253
262
|
const tcString = consentObject && consentObject.tcString;
|
|
254
263
|
return !!(
|
|
255
264
|
(typeof gdprApplies !== 'boolean') ||
|
|
256
|
-
(gdprApplies === true && !isStr(tcString))
|
|
265
|
+
(gdprApplies === true && (!tcString || !isStr(tcString)))
|
|
257
266
|
);
|
|
258
267
|
}
|
|
259
268
|
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
getValue,
|
|
11
11
|
isArray,
|
|
12
12
|
isNumber,
|
|
13
|
+
isStr,
|
|
13
14
|
logError,
|
|
14
15
|
logWarn,
|
|
15
16
|
parseSizesInput,
|
|
@@ -129,6 +130,11 @@ export const spec = {
|
|
|
129
130
|
isBidRequestValid: function(bid) {
|
|
130
131
|
bid.params = bid.params || {};
|
|
131
132
|
|
|
133
|
+
if (bid.params.cwcreative && !isStr(bid.params.cwcreative)) {
|
|
134
|
+
logError('cwcreative must be of type string!');
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
|
|
132
138
|
if (!bid.params.placementId || !isNumber(bid.params.placementId)) {
|
|
133
139
|
logError('placementId not provided or invalid');
|
|
134
140
|
return false;
|
|
@@ -177,7 +183,7 @@ export const spec = {
|
|
|
177
183
|
|
|
178
184
|
let refgroups = [];
|
|
179
185
|
|
|
180
|
-
const
|
|
186
|
+
const cwCreative = getQueryVariable(CW_CREATIVE_QUERY) || null;
|
|
181
187
|
const cwCreativeIdFromConfig = this.getFirstValueOrNull(slots, 'cwcreative');
|
|
182
188
|
const refGroupsFromConfig = this.getFirstValueOrNull(slots, 'refgroups');
|
|
183
189
|
const cwApiKeyFromConfig = this.getFirstValueOrNull(slots, 'cwapikey');
|
|
@@ -198,7 +204,7 @@ export const spec = {
|
|
|
198
204
|
const payload = {
|
|
199
205
|
cwid: localStorageCWID,
|
|
200
206
|
refgroups,
|
|
201
|
-
cwcreative:
|
|
207
|
+
cwcreative: cwCreative || cwCreativeIdFromConfig,
|
|
202
208
|
slots: slots,
|
|
203
209
|
cwapikey: cwApiKeyFromConfig,
|
|
204
210
|
httpRef: referer || '',
|
|
@@ -13,12 +13,12 @@ Connects to C-WIRE demand source to fetch bids.
|
|
|
13
13
|
|
|
14
14
|
Below, the list of C-WIRE params and where they can be set.
|
|
15
15
|
|
|
16
|
-
| Param name | Global config | AdUnit config | Type
|
|
17
|
-
| ---------- | ------------- | -------------
|
|
16
|
+
| Param name | Global config | AdUnit config | Type | Required |
|
|
17
|
+
| ---------- | ------------- | ------------- |--------| ---------|
|
|
18
18
|
| pageId | | x | number | YES |
|
|
19
19
|
| placementId | | x | number | YES |
|
|
20
20
|
| refgroups | | x | string | NO |
|
|
21
|
-
| cwcreative | | x |
|
|
21
|
+
| cwcreative | | x | string | NO |
|
|
22
22
|
| cwapikey | | x | string | NO |
|
|
23
23
|
|
|
24
24
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { _each, deepClone, pick, deepSetValue,
|
|
1
|
+
import { _each, deepClone, pick, deepSetValue, logError, logInfo } from '../src/utils.js';
|
|
2
|
+
import { getOrigin } from '../libraries/getOrigin/index.js';
|
|
2
3
|
import adapter from '../src/AnalyticsAdapter.js'
|
|
3
4
|
import adapterManager from '../src/adapterManager.js'
|
|
4
5
|
import CONSTANTS from '../src/constants.json'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
Module Name: Piano DMP Analytics Adapter
|
|
4
|
+
|
|
5
|
+
Module Type: Analytics Adapter
|
|
6
|
+
|
|
7
|
+
Maintainer: [support@piano.com](mailto:support@piano.com)
|
|
8
|
+
|
|
9
|
+
# Description
|
|
10
|
+
|
|
11
|
+
Analytics adapter to be used with cx.js
|
|
12
|
+
|
|
13
|
+
Visit [https://piano.io/product/dmp/](https://piano.io/product/dmp/) for more information.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import adapter from '../src/AnalyticsAdapter.js';
|
|
2
|
+
import adapterManager from '../src/adapterManager.js';
|
|
3
|
+
|
|
4
|
+
const pianoDmpAnalytics = adapter({ analyticsType: 'bundle', handler: 'on' });
|
|
5
|
+
|
|
6
|
+
const { enableAnalytics: _enableAnalytics } = pianoDmpAnalytics;
|
|
7
|
+
|
|
8
|
+
Object.assign(pianoDmpAnalytics, {
|
|
9
|
+
/**
|
|
10
|
+
* Save event in the global array that will be consumed later by cx.js
|
|
11
|
+
*/
|
|
12
|
+
track: ({ eventType, args: params }) => {
|
|
13
|
+
window.cX.callQueue.push([
|
|
14
|
+
'prebid',
|
|
15
|
+
{ eventType, params, time: Date.now() },
|
|
16
|
+
]);
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Before forwarding the call to the original enableAnalytics function -
|
|
21
|
+
* create (if needed) the global array that is used to pass events to the cx.js library
|
|
22
|
+
* by the 'track' function above.
|
|
23
|
+
*/
|
|
24
|
+
enableAnalytics: function (...args) {
|
|
25
|
+
window.cX = window.cX || {};
|
|
26
|
+
window.cX.callQueue = window.cX.callQueue || [];
|
|
27
|
+
|
|
28
|
+
return _enableAnalytics.call(this, ...args);
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
adapterManager.registerAnalyticsAdapter({
|
|
33
|
+
adapter: pianoDmpAnalytics,
|
|
34
|
+
code: 'pianoDmp',
|
|
35
|
+
gvlid: 412,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export default pianoDmpAnalytics;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { timestamp, deepAccess
|
|
2
|
+
import { timestamp, deepAccess } from '../src/utils.js';
|
|
3
|
+
import { getOrigin } from '../libraries/getOrigin/index.js';
|
|
3
4
|
import { config } from '../src/config.js';
|
|
4
5
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
5
6
|
const BIDDER_CODE = 'resetdigital';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {deepAccess,
|
|
1
|
+
import {deepAccess, isArray, logError} from '../src/utils.js';
|
|
2
|
+
import { getOrigin } from '../libraries/getOrigin/index.js';
|
|
2
3
|
import {BANNER, NATIVE} from '../src/mediaTypes.js';
|
|
3
4
|
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
4
5
|
import {includes} from '../src/polyfill.js';
|
|
@@ -49,6 +49,13 @@ export const spec = {
|
|
|
49
49
|
imp: []
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
+
const callbackTimeout = bidderRequest.timeout;
|
|
53
|
+
const globalTimeout = config.getConfig('bidderTimeout');
|
|
54
|
+
const tmax = globalTimeout ? Math.min(globalTimeout, callbackTimeout) : callbackTimeout;
|
|
55
|
+
if (tmax) {
|
|
56
|
+
openRtbBidRequest.tmax = tmax;
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
const schain = validBidReqs[0].schain;
|
|
53
60
|
if (schain) {
|
|
54
61
|
openRtbBidRequest.source = { ext: { schain } };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { getWindowLocation, deepAccess } from '../src/utils.js';
|
|
2
|
+
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
|
+
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
4
|
+
|
|
5
|
+
const BIDDER_CODE = 'trafficgate';
|
|
6
|
+
const URL = 'https://[HOST].bc-plugin.com/?c=o&m=multi'
|
|
7
|
+
|
|
8
|
+
export const spec = {
|
|
9
|
+
code: BIDDER_CODE,
|
|
10
|
+
supportedMediaTypes: [BANNER, VIDEO, NATIVE],
|
|
11
|
+
|
|
12
|
+
isBidRequestValid: function (bid) {
|
|
13
|
+
return !!(bid.bidId && bid.params && parseInt(bid.params.placementId) && bid.params.host)
|
|
14
|
+
},
|
|
15
|
+
/**
|
|
16
|
+
* Make a server request from the list of BidRequests.
|
|
17
|
+
*
|
|
18
|
+
* @param {BidRequest[]} validBidRequests A non-empty list of valid bid requests that should be sent to the Server.
|
|
19
|
+
* @return ServerRequest Info describing the request to the server.
|
|
20
|
+
*/
|
|
21
|
+
buildRequests: function (validBidRequests) {
|
|
22
|
+
if (validBidRequests && validBidRequests.length === 0) return [];
|
|
23
|
+
|
|
24
|
+
const location = getWindowLocation()
|
|
25
|
+
const placements = []
|
|
26
|
+
|
|
27
|
+
validBidRequests.forEach((bidReq) => {
|
|
28
|
+
placements.push({
|
|
29
|
+
placementId: bidReq.params.placementId,
|
|
30
|
+
bidId: bidReq.bidId,
|
|
31
|
+
traffic: getMediatype(bidReq)
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
method: 'POST',
|
|
37
|
+
url: URL.replace('[HOST]', validBidRequests[0].params.host),
|
|
38
|
+
data: {
|
|
39
|
+
language: (navigator && navigator.language) ? navigator.language : '',
|
|
40
|
+
secure: +(location.protocol === 'https:'),
|
|
41
|
+
host: location.hostname,
|
|
42
|
+
page: location.pathname,
|
|
43
|
+
placements: placements
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
interpretResponse: function (opts) {
|
|
49
|
+
const body = opts.body
|
|
50
|
+
const response = []
|
|
51
|
+
|
|
52
|
+
for (let i = 0; i < body.length; i++) {
|
|
53
|
+
const item = body[i]
|
|
54
|
+
if (isBidResponseValid(item)) {
|
|
55
|
+
response.push(item)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return response
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
registerBidder(spec)
|
|
64
|
+
|
|
65
|
+
function isBidResponseValid (bid) {
|
|
66
|
+
if (!bid.requestId || !bid.cpm || !bid.creativeId ||
|
|
67
|
+
!bid.ttl || !bid.currency) {
|
|
68
|
+
return false
|
|
69
|
+
}
|
|
70
|
+
switch (bid['mediaType']) {
|
|
71
|
+
case BANNER:
|
|
72
|
+
return Boolean(bid.width && bid.height && bid.ad)
|
|
73
|
+
case VIDEO:
|
|
74
|
+
return Boolean(bid.vastUrl)
|
|
75
|
+
case NATIVE:
|
|
76
|
+
return Boolean(bid.title && bid.image && bid.impressionTrackers)
|
|
77
|
+
default:
|
|
78
|
+
return false
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function getMediatype(bidRequest) {
|
|
83
|
+
if (deepAccess(bidRequest, 'mediaTypes.banner')) {
|
|
84
|
+
return BANNER;
|
|
85
|
+
}
|
|
86
|
+
if (deepAccess(bidRequest, 'mediaTypes.video')) {
|
|
87
|
+
return VIDEO;
|
|
88
|
+
}
|
|
89
|
+
if (deepAccess(bidRequest, 'mediaTypes.native')) {
|
|
90
|
+
return NATIVE;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
Module Name: TrafficGate Bidder Adapter
|
|
5
|
+
Module Type: Bidder Adapter
|
|
6
|
+
Maintainer: publishers@bidscube.com
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
# Description
|
|
10
|
+
|
|
11
|
+
Module that connects to TrafficGate demand sources
|
|
12
|
+
|
|
13
|
+
# Test Parameters
|
|
14
|
+
```
|
|
15
|
+
var adUnits = [{
|
|
16
|
+
code: 'placementId_0',
|
|
17
|
+
mediaTypes: {
|
|
18
|
+
banner: {
|
|
19
|
+
sizes: [[300, 250]]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
bids: [{
|
|
23
|
+
bidder: 'trafficgate',
|
|
24
|
+
params: {
|
|
25
|
+
placementId: 0,
|
|
26
|
+
host: 'example'
|
|
27
|
+
}
|
|
28
|
+
}]
|
|
29
|
+
}];
|
|
30
|
+
```
|
|
@@ -2,6 +2,7 @@ import { tryAppendQueryString, logMessage, logError, isEmpty, isStr, isPlainObje
|
|
|
2
2
|
import { BANNER, VIDEO } from '../src/mediaTypes.js';
|
|
3
3
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
4
4
|
import { config } from '../src/config.js';
|
|
5
|
+
import { getStorageManager } from '../src/storageManager.js';
|
|
5
6
|
|
|
6
7
|
const GVLID = 28;
|
|
7
8
|
const BIDDER_CODE = 'triplelift';
|
|
@@ -10,6 +11,7 @@ const BANNER_TIME_TO_LIVE = 300;
|
|
|
10
11
|
const INSTREAM_TIME_TO_LIVE = 3600;
|
|
11
12
|
let gdprApplies = true;
|
|
12
13
|
let consentString = null;
|
|
14
|
+
export const storage = getStorageManager({gvlid: GVLID, bidderCode: BIDDER_CODE});
|
|
13
15
|
|
|
14
16
|
export const tripleliftAdapterSpec = {
|
|
15
17
|
gvlid: GVLID,
|
|
@@ -197,10 +199,23 @@ function _getGlobalFpd(bidderRequest) {
|
|
|
197
199
|
const context = {}
|
|
198
200
|
const user = {};
|
|
199
201
|
const ortbData = bidderRequest.ortb2 || {};
|
|
202
|
+
const opeCloudStorage = _fetchOpeCloud();
|
|
200
203
|
|
|
201
204
|
const fpdContext = Object.assign({}, ortbData.site);
|
|
202
205
|
const fpdUser = Object.assign({}, ortbData.user);
|
|
203
206
|
|
|
207
|
+
if (opeCloudStorage) {
|
|
208
|
+
fpdUser.data = fpdUser.data || []
|
|
209
|
+
try {
|
|
210
|
+
fpdUser.data.push({
|
|
211
|
+
name: 'www.1plusx.com',
|
|
212
|
+
ext: opeCloudStorage
|
|
213
|
+
})
|
|
214
|
+
} catch (err) {
|
|
215
|
+
logError('Triplelift: error adding 1plusX segments: ', err);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
204
219
|
_addEntries(context, fpdContext);
|
|
205
220
|
_addEntries(user, fpdUser);
|
|
206
221
|
|
|
@@ -213,6 +228,18 @@ function _getGlobalFpd(bidderRequest) {
|
|
|
213
228
|
return fpd;
|
|
214
229
|
}
|
|
215
230
|
|
|
231
|
+
function _fetchOpeCloud() {
|
|
232
|
+
const opeCloud = storage.getDataFromLocalStorage('opecloud_ctx');
|
|
233
|
+
if (!opeCloud) return null;
|
|
234
|
+
try {
|
|
235
|
+
const parsedJson = JSON.parse(opeCloud);
|
|
236
|
+
return parsedJson
|
|
237
|
+
} catch (err) {
|
|
238
|
+
logError('Triplelift: error parsing JSON: ', err);
|
|
239
|
+
return null
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
216
243
|
function _getAdUnitFpd(adUnitFpd) {
|
|
217
244
|
const fpd = {};
|
|
218
245
|
const context = {};
|
package/package.json
CHANGED
package/src/AnalyticsAdapter.js
CHANGED
|
@@ -34,16 +34,17 @@ const BUNDLE = 'bundle';
|
|
|
34
34
|
var _sampled = true;
|
|
35
35
|
|
|
36
36
|
export default function AnalyticsAdapter({ url, analyticsType, global, handler }) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
const _queue = [];
|
|
38
|
+
let _eventCount = 0;
|
|
39
|
+
let _enableCheck = true;
|
|
40
|
+
let _handlers;
|
|
41
|
+
let _enabled = false;
|
|
41
42
|
|
|
42
43
|
if (analyticsType === ENDPOINT || BUNDLE) {
|
|
43
44
|
_emptyQueue();
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
return {
|
|
47
|
+
return Object.defineProperties({
|
|
47
48
|
track: _track,
|
|
48
49
|
enqueue: _enqueue,
|
|
49
50
|
enableAnalytics: _enable,
|
|
@@ -52,7 +53,11 @@ export default function AnalyticsAdapter({ url, analyticsType, global, handler }
|
|
|
52
53
|
getGlobal: () => global,
|
|
53
54
|
getHandler: () => handler,
|
|
54
55
|
getUrl: () => url
|
|
55
|
-
}
|
|
56
|
+
}, {
|
|
57
|
+
enabled: {
|
|
58
|
+
get: () => _enabled
|
|
59
|
+
}
|
|
60
|
+
});
|
|
56
61
|
|
|
57
62
|
function _track({ eventType, args }) {
|
|
58
63
|
if (this.getAdapterType() === BUNDLE) {
|
|
@@ -140,6 +145,7 @@ export default function AnalyticsAdapter({ url, analyticsType, global, handler }
|
|
|
140
145
|
this.enableAnalytics = function _enable() {
|
|
141
146
|
return logMessage(`Analytics adapter for "${global}" already enabled, unnecessary call to \`enableAnalytics\`.`);
|
|
142
147
|
};
|
|
148
|
+
_enabled = true;
|
|
143
149
|
}
|
|
144
150
|
|
|
145
151
|
function _disable() {
|
|
@@ -147,6 +153,7 @@ export default function AnalyticsAdapter({ url, analyticsType, global, handler }
|
|
|
147
153
|
events.off(event, handler);
|
|
148
154
|
});
|
|
149
155
|
this.enableAnalytics = this._oldEnable ? this._oldEnable : _enable;
|
|
156
|
+
_enabled = false;
|
|
150
157
|
}
|
|
151
158
|
|
|
152
159
|
function _emptyQueue() {
|
package/src/utils.js
CHANGED
|
@@ -925,17 +925,6 @@ export function getUserConfiguredParams(adUnits, adUnitCode, bidder) {
|
|
|
925
925
|
.filter((bidderData) => bidderData.bidder === bidder)
|
|
926
926
|
.map((bidderData) => bidderData.params || {});
|
|
927
927
|
}
|
|
928
|
-
/**
|
|
929
|
-
* Returns the origin
|
|
930
|
-
*/
|
|
931
|
-
export function getOrigin() {
|
|
932
|
-
// IE10 does not have this property. https://gist.github.com/hbogs/7908703
|
|
933
|
-
if (!window.location.origin) {
|
|
934
|
-
return window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
|
|
935
|
-
} else {
|
|
936
|
-
return window.location.origin;
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
928
|
|
|
940
929
|
/**
|
|
941
930
|
* Returns Do Not Track state
|