prebid.js 8.0.0 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devcontainer/devcontainer.json +3 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/admanBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.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/axonixBidAdapter.js +1 -1
- package/dist/bedigitechBidAdapter.js +1 -1
- package/dist/beopBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/bidwatchAnalyticsAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridBidAdapter.js +1 -0
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/categoryTranslation.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/cmp.js +1 -0
- package/dist/colossussspBidAdapter.js +1 -1
- package/dist/conceptxBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consentManagement.js +1 -1
- package/dist/consentManagementGpp.js +1 -1
- package/dist/consentManagementUsp.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/cwireBidAdapter.js +1 -1
- package/dist/dependencies.json +15 -0
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freepassBidAdapter.js +1 -0
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gppControl_usnat.js +1 -0
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hypelabBidAdapter.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/intentIqIdSystem.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/kiviadsBidAdapter.js +1 -0
- package/dist/konduitAnalyticsAdapter.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/liveIntentIdSystem.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.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/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/mgidXBidAdapter.js +1 -0
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/mspa.js +1 -0
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +146 -139
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.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 +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.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/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rtbhouseBidAdapter.js +1 -1
- package/dist/rubiconBidAdapter.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/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.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/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.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/userId.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/libraries/cmp/cmpClient.js +139 -0
- package/libraries/mspa/activityControls.js +91 -0
- package/modules/admanBidAdapter.js +5 -0
- package/modules/amxBidAdapter.js +11 -12
- package/modules/bedigitechBidAdapter.js +15 -12
- package/modules/bedigitechBidAdapter.md +2 -2
- package/modules/beopBidAdapter.js +0 -4
- package/modules/bidwatchAnalyticsAdapter.js +33 -5
- package/modules/bridBidAdapter.js +223 -0
- package/modules/categoryTranslation.js +3 -2
- package/modules/colossussspBidAdapter.js +9 -0
- package/modules/conceptxBidAdapter.js +6 -3
- package/modules/consentManagement.js +12 -86
- package/modules/consentManagementGpp.js +47 -126
- package/modules/consentManagementUsp.js +19 -97
- package/modules/freepassBidAdapter.js +98 -0
- package/modules/freepassBidAdapter.md +31 -0
- package/modules/freepassIdSystem.md +1 -1
- package/modules/gppControl_usnat.js +11 -0
- package/modules/greenbidsAnalyticsAdapter.js +7 -13
- package/modules/gridBidAdapter.js +3 -4
- package/modules/intentIqIdSystem.js +11 -9
- package/modules/ixBidAdapter.js +284 -55
- package/modules/kiviadsBidAdapter.js +212 -0
- package/modules/kiviadsBidAdapter.md +79 -0
- package/modules/liveIntentIdSystem.js +8 -3
- package/modules/mediasquareBidAdapter.js +19 -23
- package/modules/mgidXBidAdapter.js +263 -0
- package/modules/mgidXBidAdapter.md +79 -0
- package/modules/oxxionAnalyticsAdapter.js +33 -5
- package/modules/oxxionRtdProvider.js +124 -11
- package/modules/oxxionRtdProvider.md +19 -4
- package/modules/pubmaticBidAdapter.js +18 -2
- package/modules/rtbhouseBidAdapter.js +9 -2
- package/modules/rtbhouseBidAdapter.md +27 -8
- package/modules/rubiconBidAdapter.js +13 -1
- package/modules/sharethroughBidAdapter.js +14 -0
- package/modules/sonobiBidAdapter.js +4 -7
- package/modules/tripleliftBidAdapter.js +21 -1
- package/modules/userId/eids.js +29 -0
- package/modules/userId/eids.md +19 -2
- package/modules/userId/index.js +78 -29
- package/modules/userId/userId.md +3 -0
- package/package.json +1 -1
- package/src/activities/params.js +4 -1
- package/test/spec/libraries/cmp/cmpClient_spec.js +233 -0
- package/test/spec/libraries/mspa/activityControls_spec.js +315 -0
- package/test/spec/modules/admanBidAdapter_spec.js +8 -2
- package/test/spec/modules/adqueryBidAdapter_spec.js +5 -1
- package/test/spec/modules/amxBidAdapter_spec.js +6 -3
- package/test/spec/modules/bedigitechBidAdapter_spec.js +25 -36
- package/test/spec/modules/bidwatchAnalyticsAdapter_spec.js +21 -1
- package/test/spec/modules/bridBidAdapter_spec.js +129 -0
- package/test/spec/modules/byDataAnalyticsAdapter_spec.js +9 -7
- package/test/spec/modules/chtnwBidAdapter_spec.js +4 -1
- package/test/spec/modules/colossussspBidAdapter_spec.js +29 -0
- package/test/spec/modules/consentManagementGpp_spec.js +84 -7
- package/test/spec/modules/consentManagement_spec.js +8 -18
- package/test/spec/modules/datablocksBidAdapter_spec.js +7 -3
- package/test/spec/modules/eids_spec.js +87 -0
- package/test/spec/modules/freepassBidAdapter_spec.js +161 -0
- package/test/spec/modules/greenbidsAnalyticsAdapter_spec.js +0 -15
- package/test/spec/modules/gridBidAdapter_spec.js +29 -28
- package/test/spec/modules/insticatorBidAdapter_spec.js +6 -2
- package/test/spec/modules/intentIqIdSystem_spec.js +36 -2
- package/test/spec/modules/ixBidAdapter_spec.js +785 -15
- package/test/spec/modules/kiviadsBidAdapter_spec.js +404 -0
- package/test/spec/modules/lassoBidAdapter_spec.js +6 -4
- package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +17 -2
- package/test/spec/modules/liveIntentIdSystem_spec.js +11 -6
- package/test/spec/modules/mediasquareBidAdapter_spec.js +3 -0
- package/test/spec/modules/mgidXBidAdapter_spec.js +426 -0
- package/test/spec/modules/onetagBidAdapter_spec.js +81 -75
- package/test/spec/modules/orbidderBidAdapter_spec.js +6 -3
- package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +21 -2
- package/test/spec/modules/oxxionRtdProvider_spec.js +113 -1
- package/test/spec/modules/pubmaticBidAdapter_spec.js +25 -0
- package/test/spec/modules/relaidoBidAdapter_spec.js +4 -3
- package/test/spec/modules/rtbhouseBidAdapter_spec.js +35 -0
- package/test/spec/modules/rubiconBidAdapter_spec.js +41 -0
- package/test/spec/modules/sharethroughBidAdapter_spec.js +75 -0
- package/test/spec/modules/sonobiBidAdapter_spec.js +15 -15
- package/test/spec/modules/tripleliftBidAdapter_spec.js +20 -1
- package/test/spec/modules/ucfunnelBidAdapter_spec.js +37 -16
- package/test/spec/modules/userId_spec.js +393 -6
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
* information and make it available for any USP (CCPA) supported adapters to
|
|
5
5
|
* read/pass this information to their system.
|
|
6
6
|
*/
|
|
7
|
-
import {deepSetValue,
|
|
7
|
+
import {deepSetValue, isNumber, isPlainObject, isStr, logError, logInfo, logWarn} from '../src/utils.js';
|
|
8
8
|
import {config} from '../src/config.js';
|
|
9
9
|
import adapterManager, {uspDataHandler} from '../src/adapterManager.js';
|
|
10
10
|
import {timedAuctionHook} from '../src/utils/perfMetrics.js';
|
|
11
11
|
import {getHook} from '../src/hook.js';
|
|
12
12
|
import {enrichFPD} from '../src/fpd/enrichment.js';
|
|
13
|
+
import {cmpClient} from '../libraries/cmp/cmpClient.js';
|
|
13
14
|
|
|
14
15
|
const DEFAULT_CONSENT_API = 'iab';
|
|
15
16
|
const DEFAULT_CONSENT_TIMEOUT = 50;
|
|
@@ -41,35 +42,6 @@ function lookupStaticConsentData({onSuccess, onError}) {
|
|
|
41
42
|
* based on the appropriate result.
|
|
42
43
|
*/
|
|
43
44
|
function lookupUspConsent({onSuccess, onError}) {
|
|
44
|
-
function findUsp() {
|
|
45
|
-
let f = window;
|
|
46
|
-
let uspapiFrame;
|
|
47
|
-
let uspapiFunction;
|
|
48
|
-
|
|
49
|
-
while (true) {
|
|
50
|
-
try {
|
|
51
|
-
if (typeof f.__uspapi === 'function') {
|
|
52
|
-
uspapiFunction = f.__uspapi;
|
|
53
|
-
uspapiFrame = f;
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
} catch (e) {}
|
|
57
|
-
|
|
58
|
-
try {
|
|
59
|
-
if (f.frames['__uspapiLocator']) {
|
|
60
|
-
uspapiFrame = f;
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
} catch (e) {}
|
|
64
|
-
if (f === window.top) break;
|
|
65
|
-
f = f.parent;
|
|
66
|
-
}
|
|
67
|
-
return {
|
|
68
|
-
uspapiFrame,
|
|
69
|
-
uspapiFunction,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
45
|
function handleUspApiResponseCallbacks() {
|
|
74
46
|
const uspResponse = {};
|
|
75
47
|
|
|
@@ -92,86 +64,36 @@ function lookupUspConsent({onSuccess, onError}) {
|
|
|
92
64
|
}
|
|
93
65
|
|
|
94
66
|
let callbackHandler = handleUspApiResponseCallbacks();
|
|
95
|
-
let uspapiCallbacks = {};
|
|
96
67
|
|
|
97
|
-
|
|
68
|
+
const cmp = cmpClient({
|
|
69
|
+
apiName: '__uspapi',
|
|
70
|
+
apiVersion: USPAPI_VERSION,
|
|
71
|
+
apiArgs: ['command', 'version', 'callback'],
|
|
72
|
+
});
|
|
98
73
|
|
|
99
|
-
if (!
|
|
74
|
+
if (!cmp) {
|
|
100
75
|
return onError('USP CMP not found.');
|
|
101
76
|
}
|
|
102
77
|
|
|
103
|
-
|
|
104
|
-
try {
|
|
105
|
-
invoker('registerDeletion', arg2, adapterManager.callDataDeletionRequest);
|
|
106
|
-
} catch (e) {
|
|
107
|
-
logError('Error invoking CMP `registerDeletion`:', e);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// to collect the consent information from the user, we perform a call to USPAPI
|
|
112
|
-
// to collect the user's consent choices represented as a string (via getUSPData)
|
|
113
|
-
|
|
114
|
-
// the following code also determines where the USPAPI is located and uses the proper workflow to communicate with it:
|
|
115
|
-
// - use the USPAPI locator code to see if USP's located in the current window or an ancestor window.
|
|
116
|
-
// - else assume prebid is in an iframe, and use the locator to see if the CMP is located in a higher parent window. This works in cross domain iframes.
|
|
117
|
-
// - if USPAPI is not found, the iframe function will call the uspError exit callback to abort the rest of the USPAPI workflow
|
|
118
|
-
|
|
119
|
-
if (isFn(uspapiFunction)) {
|
|
78
|
+
if (cmp.isDirect) {
|
|
120
79
|
logInfo('Detected USP CMP is directly accessible, calling it now...');
|
|
121
|
-
uspapiFunction(
|
|
122
|
-
'getUSPData',
|
|
123
|
-
USPAPI_VERSION,
|
|
124
|
-
callbackHandler.consentDataCallback
|
|
125
|
-
);
|
|
126
|
-
registerDataDelHandler(uspapiFunction, USPAPI_VERSION);
|
|
127
80
|
} else {
|
|
128
81
|
logInfo(
|
|
129
82
|
'Detected USP CMP is outside the current iframe where Prebid.js is located, calling it now...'
|
|
130
83
|
);
|
|
131
|
-
callUspApiWhileInIframe(
|
|
132
|
-
'getUSPData',
|
|
133
|
-
uspapiFrame,
|
|
134
|
-
callbackHandler.consentDataCallback
|
|
135
|
-
);
|
|
136
|
-
registerDataDelHandler(callUspApiWhileInIframe, uspapiFrame);
|
|
137
84
|
}
|
|
138
85
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
let callId = Math.random() + '';
|
|
144
|
-
let msg = {
|
|
145
|
-
__uspapiCall: {
|
|
146
|
-
command: cmd,
|
|
147
|
-
version: ver,
|
|
148
|
-
callId: callId,
|
|
149
|
-
},
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
uspapiCallbacks[callId] = callback;
|
|
153
|
-
uspapiFrame.postMessage(msg, '*');
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
/** when we get the return message, call the stashed callback */
|
|
157
|
-
if (!listening) {
|
|
158
|
-
window.addEventListener('message', readPostMessageResponse, false);
|
|
159
|
-
listening = true;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// call uspapi
|
|
163
|
-
callUsp(commandName, USPAPI_VERSION, moduleCallback);
|
|
86
|
+
cmp({
|
|
87
|
+
command: 'getUSPData',
|
|
88
|
+
callback: callbackHandler.consentDataCallback
|
|
89
|
+
});
|
|
164
90
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
91
|
+
cmp({
|
|
92
|
+
command: 'registerDeletion',
|
|
93
|
+
callback: adapterManager.callDataDeletionRequest
|
|
94
|
+
}).catch(e => {
|
|
95
|
+
logError('Error invoking CMP `registerDeletion`:', e);
|
|
96
|
+
});
|
|
175
97
|
}
|
|
176
98
|
|
|
177
99
|
/**
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
2
|
+
import {logMessage} from '../src/utils.js';
|
|
3
|
+
import {BANNER} from '../src/mediaTypes.js';
|
|
4
|
+
import {ortbConverter} from '../libraries/ortbConverter/converter.js'
|
|
5
|
+
|
|
6
|
+
const BIDDER_SERVICE_URL = 'https://bidding-dsp.ad-m.asia/dsp/api/bid/s/s/freepass';
|
|
7
|
+
|
|
8
|
+
const converter = ortbConverter({
|
|
9
|
+
context: {
|
|
10
|
+
netRevenue: true,
|
|
11
|
+
ttl: 30
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
function prepareUserInfo(user, freepassId) {
|
|
16
|
+
let userInfo = user || {};
|
|
17
|
+
let extendedUserInfo = userInfo.ext || {};
|
|
18
|
+
|
|
19
|
+
if (freepassId.userId) {
|
|
20
|
+
userInfo.id = freepassId.userId;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (freepassId.commonId) {
|
|
24
|
+
extendedUserInfo.fuid = freepassId.commonId;
|
|
25
|
+
}
|
|
26
|
+
userInfo.ext = extendedUserInfo;
|
|
27
|
+
|
|
28
|
+
return userInfo;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function prepareDeviceInfo(device, freepassId) {
|
|
32
|
+
let deviceInfo = device || {};
|
|
33
|
+
let extendedDeviceInfo = deviceInfo.ext || {};
|
|
34
|
+
|
|
35
|
+
extendedDeviceInfo.is_accurate_ip = 0;
|
|
36
|
+
if (freepassId.userIp) {
|
|
37
|
+
deviceInfo.ip = freepassId.userIp;
|
|
38
|
+
extendedDeviceInfo.is_accurate_ip = 1;
|
|
39
|
+
}
|
|
40
|
+
deviceInfo.ext = extendedDeviceInfo;
|
|
41
|
+
|
|
42
|
+
return deviceInfo;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const spec = {
|
|
46
|
+
code: 'freepass',
|
|
47
|
+
supportedMediaTypes: [BANNER],
|
|
48
|
+
|
|
49
|
+
isBidRequestValid(bid) {
|
|
50
|
+
logMessage('Validating bid: ', bid);
|
|
51
|
+
return !!bid.adUnitCode;
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
buildRequests(validBidRequests, bidderRequest) {
|
|
55
|
+
if (validBidRequests.length === 0) {
|
|
56
|
+
logMessage('FreePass BidAdapter has no valid bid requests');
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
logMessage('FreePass BidAdapter is preparing bid request: ', validBidRequests);
|
|
61
|
+
logMessage('FreePass BidAdapter is using bidder request: ', bidderRequest);
|
|
62
|
+
|
|
63
|
+
const data = converter.toORTB({
|
|
64
|
+
bidderRequest: bidderRequest,
|
|
65
|
+
bidRequests: validBidRequests,
|
|
66
|
+
context: { mediaType: BANNER }
|
|
67
|
+
});
|
|
68
|
+
logMessage('FreePass BidAdapter interpreted ORTB bid request as ', data);
|
|
69
|
+
|
|
70
|
+
// Only freepassId is supported
|
|
71
|
+
let freepassId = (validBidRequests[0].userId && validBidRequests[0].userId.freepassId) || {};
|
|
72
|
+
data.user = prepareUserInfo(data.user, freepassId);
|
|
73
|
+
data.device = prepareDeviceInfo(data.device, freepassId);
|
|
74
|
+
|
|
75
|
+
data.test = validBidRequests[0].test || 0;
|
|
76
|
+
|
|
77
|
+
logMessage('FreePass BidAdapter augmented ORTB bid request user: ', data.user);
|
|
78
|
+
logMessage('FreePass BidAdapter augmented ORTB bid request device: ', data.device);
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
method: 'POST',
|
|
82
|
+
url: BIDDER_SERVICE_URL,
|
|
83
|
+
data,
|
|
84
|
+
options: { withCredentials: false }
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
interpretResponse(serverResponse, bidRequest) {
|
|
89
|
+
logMessage('FreePass BidAdapter is interpreting server response: ', serverResponse);
|
|
90
|
+
logMessage('FreePass BidAdapter is using bid request: ', bidRequest);
|
|
91
|
+
const bids = converter.fromORTB({response: serverResponse.body, request: bidRequest.data}).bids;
|
|
92
|
+
logMessage('FreePass BidAdapter interpreted ORTB bids as ', bids);
|
|
93
|
+
|
|
94
|
+
return bids;
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
registerBidder(spec);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
Module Name: FreePass Bidder Adapter
|
|
5
|
+
Module Type: Bidder Adapter
|
|
6
|
+
Maintainer: fp-hbidding@freebit.net
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
# Description
|
|
10
|
+
|
|
11
|
+
Connects to FreePass service for bids. Only BANNER is currently supported.
|
|
12
|
+
|
|
13
|
+
This BidAdapter requires the FreePass IdSystem to be configured. Please contact FreePass for proper setup.
|
|
14
|
+
|
|
15
|
+
# Test Parameters
|
|
16
|
+
```javascript
|
|
17
|
+
let adUnits = [
|
|
18
|
+
{
|
|
19
|
+
code: 'ad-banner-1', // ad slot HTML element ID
|
|
20
|
+
mediaTypes: {
|
|
21
|
+
banner: {
|
|
22
|
+
sizes: [[1024, 1024]]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
bids: [{
|
|
26
|
+
bidder: 'freepass'
|
|
27
|
+
}]
|
|
28
|
+
}
|
|
29
|
+
];
|
|
30
|
+
```
|
|
31
|
+
|
|
@@ -9,7 +9,7 @@ Please contact FreePass before using this ID.
|
|
|
9
9
|
```
|
|
10
10
|
Module Name: FreePass Id System
|
|
11
11
|
Module Type: User Id System
|
|
12
|
-
Maintainer:
|
|
12
|
+
Maintainer: fp-hbidding@freebit.net
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Building Prebid with FreePass ID Support
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {config} from '../src/config.js';
|
|
2
|
+
import {setupRules} from '../libraries/mspa/activityControls.js';
|
|
3
|
+
|
|
4
|
+
let setupDone = false;
|
|
5
|
+
|
|
6
|
+
config.getConfig('consentManagement', (cfg) => {
|
|
7
|
+
if (cfg?.consentManagement?.gpp != null && !setupDone) {
|
|
8
|
+
setupRules('usnat', [7]);
|
|
9
|
+
setupDone = true;
|
|
10
|
+
}
|
|
11
|
+
})
|
|
@@ -44,10 +44,6 @@ export const greenbidsAnalyticsAdapter = Object.assign(adapter({ANALYTICS_SERVER
|
|
|
44
44
|
logError('"options.pbuid" is required.');
|
|
45
45
|
return false;
|
|
46
46
|
}
|
|
47
|
-
analyticsOptions.sampled = true;
|
|
48
|
-
if (typeof config.options.sampling === 'number') {
|
|
49
|
-
analyticsOptions.sampled = Math.random() < parseFloat(config.options.sampling);
|
|
50
|
-
}
|
|
51
47
|
|
|
52
48
|
analyticsOptions.pbuid = config.options.pbuid
|
|
53
49
|
analyticsOptions.server = ANALYTICS_SERVER;
|
|
@@ -149,15 +145,13 @@ export const greenbidsAnalyticsAdapter = Object.assign(adapter({ANALYTICS_SERVER
|
|
|
149
145
|
});
|
|
150
146
|
},
|
|
151
147
|
track({eventType, args}) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
148
|
+
switch (eventType) {
|
|
149
|
+
case BID_TIMEOUT:
|
|
150
|
+
this.handleBidTimeout(args);
|
|
151
|
+
break;
|
|
152
|
+
case AUCTION_END:
|
|
153
|
+
this.handleAuctionEnd(args);
|
|
154
|
+
break;
|
|
161
155
|
}
|
|
162
156
|
},
|
|
163
157
|
getAnalyticsOptions() {
|
|
@@ -26,10 +26,9 @@ const RENDERER_URL = 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js
|
|
|
26
26
|
export const storage = getStorageManager({ bidderCode: BIDDER_CODE });
|
|
27
27
|
|
|
28
28
|
const LOG_ERROR_MESS = {
|
|
29
|
-
|
|
29
|
+
noAdid: 'Bid from response has no adid parameter - ',
|
|
30
30
|
noAdm: 'Bid from response has no adm parameter - ',
|
|
31
31
|
noBid: 'Array of bid objects is empty',
|
|
32
|
-
noPlacementCode: 'Can\'t find in requested bids the bid with auid - ',
|
|
33
32
|
emptyUids: 'Uids should be not empty',
|
|
34
33
|
emptySeatbid: 'Seatbid array from response has empty item',
|
|
35
34
|
emptyResponse: 'Response is empty',
|
|
@@ -507,7 +506,7 @@ function _getBidFromResponse(respItem) {
|
|
|
507
506
|
function _addBidResponse(serverBid, bidRequest, bidResponses, RendererConst, bidderCode) {
|
|
508
507
|
if (!serverBid) return;
|
|
509
508
|
let errorMessage;
|
|
510
|
-
if (!serverBid.
|
|
509
|
+
if (!serverBid.adid) errorMessage = LOG_ERROR_MESS.noAdid + JSON.stringify(serverBid);
|
|
511
510
|
if (!errorMessage && !serverBid.adm && !serverBid.nurl) errorMessage = LOG_ERROR_MESS.noAdm + JSON.stringify(serverBid);
|
|
512
511
|
else {
|
|
513
512
|
const bidObject = bidRequest.bidsMap ? bidRequest.bidsMap[serverBid.impid] : bidRequest.bidObject;
|
|
@@ -518,7 +517,7 @@ function _addBidResponse(serverBid, bidRequest, bidResponses, RendererConst, bid
|
|
|
518
517
|
cpm: serverBid.price,
|
|
519
518
|
width: serverBid.w,
|
|
520
519
|
height: serverBid.h,
|
|
521
|
-
creativeId: serverBid.
|
|
520
|
+
creativeId: serverBid.adid,
|
|
522
521
|
currency: 'USD',
|
|
523
522
|
netRevenue: true,
|
|
524
523
|
ttl: TIME_TO_LIVE,
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
import { logError, logInfo } from '../src/utils.js';
|
|
9
9
|
import { ajax } from '../src/ajax.js';
|
|
10
10
|
import { submodule } from '../src/hook.js'
|
|
11
|
-
import {getStorageManager} from '../src/storageManager.js';
|
|
12
|
-
import {MODULE_TYPE_UID} from '../src/activities/modules.js';
|
|
11
|
+
import { getStorageManager } from '../src/storageManager.js';
|
|
12
|
+
import { MODULE_TYPE_UID } from '../src/activities/modules.js';
|
|
13
13
|
|
|
14
14
|
const PCID_EXPIRY = 365;
|
|
15
15
|
|
|
@@ -59,7 +59,7 @@ export function readData(key) {
|
|
|
59
59
|
* @param key
|
|
60
60
|
* @param {string} value IntentIQ ID value to sintentIqIdSystem_spec.jstore
|
|
61
61
|
*/
|
|
62
|
-
function storeData(key, value) {
|
|
62
|
+
function storeData(key, value, cookieStorageEnabled = false) {
|
|
63
63
|
try {
|
|
64
64
|
logInfo(MODULE_NAME + ': storing data: key=' + key + ' value=' + value);
|
|
65
65
|
|
|
@@ -68,7 +68,7 @@ function storeData(key, value) {
|
|
|
68
68
|
storage.setDataInLocalStorage(key, value);
|
|
69
69
|
}
|
|
70
70
|
const expiresStr = (new Date(Date.now() + (PCID_EXPIRY * (60 * 60 * 24 * 1000)))).toUTCString();
|
|
71
|
-
if (storage.cookiesAreEnabled()) {
|
|
71
|
+
if (storage.cookiesAreEnabled() && cookieStorageEnabled) {
|
|
72
72
|
storage.setCookie(key, value, expiresStr, 'LAX');
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -119,15 +119,16 @@ export const intentIqIdSubmodule = {
|
|
|
119
119
|
logError('User ID - intentIqId submodule requires a valid partner to be defined');
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
|
+
const cookieStorageEnabled = typeof configParams.enableCookieStorage === 'boolean' ? configParams.enableCookieStorage : false
|
|
122
123
|
if (!FIRST_PARTY_DATA_KEY.includes(configParams.partner)) { FIRST_PARTY_DATA_KEY += '_' + configParams.partner; }
|
|
123
124
|
let rrttStrtTime = 0;
|
|
124
125
|
|
|
125
126
|
// Read Intent IQ 1st party id or generate it if none exists
|
|
126
127
|
let firstPartyData = tryParse(readData(FIRST_PARTY_KEY));
|
|
127
|
-
if (!firstPartyData || !firstPartyData.pcid) {
|
|
128
|
+
if (!firstPartyData || !firstPartyData.pcid || firstPartyData.pcidDate) {
|
|
128
129
|
const firstPartyId = generateGUID();
|
|
129
|
-
firstPartyData = { 'pcid': firstPartyId };
|
|
130
|
-
storeData(FIRST_PARTY_KEY, JSON.stringify(firstPartyData));
|
|
130
|
+
firstPartyData = { 'pcid': firstPartyId, 'pcidDate': Date.now() };
|
|
131
|
+
storeData(FIRST_PARTY_KEY, JSON.stringify(firstPartyData), cookieStorageEnabled);
|
|
131
132
|
}
|
|
132
133
|
|
|
133
134
|
let partnerData = tryParse(readData(FIRST_PARTY_DATA_KEY));
|
|
@@ -141,6 +142,7 @@ export const intentIqIdSubmodule = {
|
|
|
141
142
|
url += firstPartyData.pid ? '&pid=' + encodeURIComponent(firstPartyData.pid) : '';
|
|
142
143
|
url += (partnerData.cttl) ? '&cttl=' + encodeURIComponent(partnerData.cttl) : '';
|
|
143
144
|
url += (partnerData.rrtt) ? '&rrtt=' + encodeURIComponent(partnerData.rrtt) : '';
|
|
145
|
+
url += firstPartyData.pcidDate ? '&iiqpciddate=' + encodeURIComponent(firstPartyData.pcidDate) : '';
|
|
144
146
|
|
|
145
147
|
const resp = function (callback) {
|
|
146
148
|
const callbacks = {
|
|
@@ -171,8 +173,8 @@ export const intentIqIdSubmodule = {
|
|
|
171
173
|
}
|
|
172
174
|
if (shouldUpdateLs === true) {
|
|
173
175
|
partnerData.date = Date.now();
|
|
174
|
-
storeData(FIRST_PARTY_KEY, JSON.stringify(firstPartyData));
|
|
175
|
-
storeData(FIRST_PARTY_DATA_KEY, JSON.stringify(partnerData));
|
|
176
|
+
storeData(FIRST_PARTY_KEY, JSON.stringify(firstPartyData), cookieStorageEnabled);
|
|
177
|
+
storeData(FIRST_PARTY_DATA_KEY, JSON.stringify(partnerData), cookieStorageEnabled);
|
|
176
178
|
}
|
|
177
179
|
callback(respJson.data);
|
|
178
180
|
} else {
|