prebid.js 6.24.0 → 6.26.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/33acrossBidAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtelligentBidAdapter.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/audiencerunBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/beopBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bluebillywigBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/cpexIdSystem.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/currency.js +1 -1
- package/dist/dfpAdServerVideo.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gravitoIdSystem.js +1 -0
- 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/id5IdSystem.js +1 -1
- package/dist/impactifyBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/invibesBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/liveIntentIdSystem.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/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediakeysBidAdapter.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 +123 -121
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/oneVideoBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +3 -3
- 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/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.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/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/sortableBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.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/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/trustpidSystem.js +1 -1
- package/dist/trustxBidAdapter.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/userId.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/videoheroesBidAdapter.js +1 -0
- package/dist/vidoomyBidAdapter.js +1 -1
- package/dist/visxBidAdapter.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/zeta_global_sspBidAdapter.js +1 -1
- package/integrationExamples/gpt/userId_example.html +3 -0
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +65 -11
- package/modules/.submodules.json +2 -1
- package/modules/adagioBidAdapter.js +2 -0
- package/modules/adtelligentBidAdapter.js +3 -1
- package/modules/alkimiBidAdapter.md +10 -4
- package/modules/appnexusBidAdapter.js +13 -2
- package/modules/beopBidAdapter.js +51 -6
- package/modules/cpexIdSystem.js +1 -2
- package/modules/currency.js +4 -13
- package/modules/dacIdSystem.md +4 -4
- package/modules/dfpAdServerVideo.js +8 -0
- package/modules/gravitoIdSystem.js +57 -0
- package/modules/gravitoIdSystem.md +28 -0
- package/modules/improvedigitalBidAdapter.js +100 -43
- package/modules/invibesBidAdapter.js +55 -34
- package/modules/ixBidAdapter.js +62 -26
- package/modules/ixBidAdapter.md +42 -42
- package/modules/jixieBidAdapter.js +2 -0
- package/modules/kargoBidAdapter.js +23 -8
- package/modules/oguryBidAdapter.js +27 -1
- package/modules/trustpidSystem.js +9 -28
- package/modules/trustpidSystem.md +11 -34
- package/modules/userId/eids.js +6 -0
- package/modules/userId/index.js +30 -55
- package/modules/userId/userId.md +3 -11
- package/modules/videoheroesBidAdapter.js +267 -0
- package/modules/videoheroesBidAdapter.md +134 -0
- package/modules/vidoomyBidAdapter.js +2 -6
- package/modules/weboramaRtdProvider.js +515 -241
- package/modules/weboramaRtdProvider.md +488 -51
- package/modules/zeta_global_sspBidAdapter.js +1 -1
- package/package.json +4 -4
- package/src/adserver.js +7 -0
- package/src/hook.js +19 -1
- package/src/utils/promise.js +36 -0
- package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +37 -10
- package/test/spec/modules/beopBidAdapter_spec.js +15 -2
- package/test/spec/modules/dfpAdServerVideo_spec.js +45 -0
- package/test/spec/modules/gravitoIdSystem_spec.js +51 -0
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +289 -72
- package/test/spec/modules/invibesBidAdapter_spec.js +98 -7
- package/test/spec/modules/ixBidAdapter_spec.js +132 -26
- package/test/spec/modules/jixieBidAdapter_spec.js +17 -0
- package/test/spec/modules/kargoBidAdapter_spec.js +45 -3
- package/test/spec/modules/liveIntentIdSystem_spec.js +2 -2
- package/test/spec/modules/loglyliftBidAdapter_spec.js +8 -0
- package/test/spec/modules/oguryBidAdapter_spec.js +181 -3
- package/test/spec/modules/trustpidSystem_spec.js +42 -19
- package/test/spec/modules/userId_spec.js +18 -0
- package/test/spec/modules/videoheroesBidAdapter_spec.js +363 -0
- package/test/spec/modules/weboramaRtdProvider_spec.js +2333 -266
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +37 -24
- package/test/spec/unit/utils/promise_spec.js +49 -0
- package/test/spec/modules/medianetRtdProvider_spec.js +0 -146
package/modules/ixBidAdapter.md
CHANGED
|
@@ -70,10 +70,10 @@ object are detailed here.
|
|
|
70
70
|
| siteId | Required | String | An IX-specific identifier that is associated with this ad unit. It will be associated to the single size, if the size is provided. This is similar to a placement ID or an ad unit ID that some other modules have. Examples: `'3723'`, `'6482'`, `'3639'`
|
|
71
71
|
| size | Optional (Deprecated)| Number[] | The single size associated with the site ID. It should be one of the sizes listed in the ad unit under `adUnits[].sizes` or `adUnits[].mediaTypes.video.playerSize`. Examples: `[300, 250]`, `[300, 600]`
|
|
72
72
|
| video | Optional | Hash | The video object will serve as the properties of the video ad. You can create any field under the video object that is mentioned in the `OpenRTB Spec v2.5`. Some fields like `mimes, protocols, minduration, maxduration` are required. Properties not defined at this level, will be pulled from the Adunit level.
|
|
73
|
-
|video.w| Required | Integer | The video player
|
|
74
|
-
|video.h| Required | Integer | The video player
|
|
75
|
-
|video.playerSize| Optional* | Integer | The video player size that will be passed to demand partners
|
|
76
|
-
| video.mimes | Required | String[] |
|
|
73
|
+
|video.w| Required | Integer | The width of the video player in pixels that will be passed to demand partners.<br /> *If you are using Index’s outstream player and have placed the `video` object at the `bidder` level, this is a required field. You must define the size of the video player using the `video.w` and `video.h` parameters, with a minimum video player size of 300 x 250.
|
|
74
|
+
|video.h| Required | Integer | The height of the video player in pixels that will be passed to demand partners. <br />*If you are using Index’s outstream player and have placed the `video` object at the `bidder` level, this is a required field. You must define the size of the video player using the `video.w` and `video.h` parameters, with a minimum video player size of 300 x 250.
|
|
75
|
+
|video.playerSize| Optional* | Array[Integer,Integer] | The video player size that will be passed to demand partners.</br /> *If you are using Index’s outstream player and have placed the `video` object at the `adUnit` level, this is a required field. You must define the size of the video player using this parameter, with a minimum video player size of 300 x 250.
|
|
76
|
+
| video.mimes | Required | String[] | If you are using Index’s outstream video player and want to learn more about what is supported, see [List of supported OpenRTB bid request fields for Sellers](https://kb.indexexchange.com/publishers/openrtb_integration/list_of_supported_openrtb_bid_request_fields_for_sellers.htm#Video).
|
|
77
77
|
|video.minduration| Required | Integer | Minimum video ad duration in seconds.
|
|
78
78
|
|video.maxduration| Required | Integer | Maximum video ad duration in seconds.
|
|
79
79
|
|video.protocol / video.protocols| Required | Integer / Integer[] | Either a single protocol provided as an integer, or protocols provided as a list of integers. `2` - VAST 2.0, `3` - VAST 3.0, `5` - VAST 2.0 Wrapper, `6` - VAST 3.0 Wrapper
|
|
@@ -111,9 +111,7 @@ Both video and banner params will be read from the `adUnits[].mediaTypes.video`
|
|
|
111
111
|
The examples in this guide assume the following starting configuration (you may remove banner or video, if either does not apply).
|
|
112
112
|
|
|
113
113
|
|
|
114
|
-
In regards to video, `context` can either be `'instream'` or `'outstream'`.
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
In regards to video, `context` can either be `'instream'` or `'outstream'`.
|
|
117
115
|
|
|
118
116
|
```javascript
|
|
119
117
|
var adUnits = [{
|
|
@@ -195,9 +193,9 @@ var adUnits = [{
|
|
|
195
193
|
context: 'instream',
|
|
196
194
|
playerSize: [300, 250],
|
|
197
195
|
mimes: [
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
196
|
+
'video/mp4',
|
|
197
|
+
'video/webm'
|
|
198
|
+
],
|
|
201
199
|
minduration: 0,
|
|
202
200
|
maxduration: 60,
|
|
203
201
|
protocols: [6]
|
|
@@ -224,45 +222,47 @@ Please note that you can re-use the existing `siteId` within the same flex
|
|
|
224
222
|
position.
|
|
225
223
|
|
|
226
224
|
**Video (Outstream):**
|
|
227
|
-
|
|
225
|
+
|
|
226
|
+
Publishers have two options to receive outstream video demand from Index:
|
|
227
|
+
* Using Index’s outstream video player
|
|
228
|
+
* In an outstream video configuration set up by the publisher. For more information, see [Prebid’s documentation on how to show video ads.](https://docs.prebid.org/dev-docs/show-outstream-video-ads.html)
|
|
229
|
+
|
|
230
|
+
**Index’s outstream video player**
|
|
231
|
+
Publishers who are using Index as a bidding adapter in Prebid.js can show outstream video ads on their site from us by using Index’s outstream video player. This allows a video ad to display inside of a video player and can be placed anywhere on a publisher’s site, such as in-article, in-feed, and more.
|
|
232
|
+
|
|
233
|
+
Define a new `video` object for our outstream video player at either the adUnit level or the `bidder` level. If you are setting it at the bidder level, define the size of the video player using the parameters `video.h` and `video.w`. If you are setting it at the `adUnit` level, define the size using video.playerSize.
|
|
234
|
+
|
|
235
|
+
For more information on how to structure the `video` object, refer to the following code example:
|
|
236
|
+
|
|
228
237
|
|
|
229
238
|
```javascript
|
|
230
239
|
var adUnits = [{
|
|
231
|
-
code: '
|
|
240
|
+
code: 'div-gpt-ad-1571167646410-1',
|
|
232
241
|
mediaTypes: {
|
|
233
242
|
video: {
|
|
243
|
+
playerSize: [640, 360],
|
|
234
244
|
context: 'outstream',
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
maxduration: 60,
|
|
242
|
-
protocols: [6]
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
|
-
renderer: {
|
|
246
|
-
url: 'https://test.com/my-video-player.js',
|
|
247
|
-
render: function (bid) {
|
|
248
|
-
...
|
|
245
|
+
api: [2],
|
|
246
|
+
protocols: [2, 3, 5, 6],
|
|
247
|
+
minduration: 5,
|
|
248
|
+
maxduration: 30,
|
|
249
|
+
mimes: ['video/mp4', 'application/javascript'],
|
|
250
|
+
placement: 3
|
|
249
251
|
}
|
|
250
252
|
},
|
|
251
253
|
bids: [{
|
|
252
254
|
bidder: 'ix',
|
|
253
255
|
params: {
|
|
254
|
-
siteId: '
|
|
255
|
-
video: {
|
|
256
|
-
// If required, use this to override mediaTypes.video.XX properties
|
|
257
|
-
}
|
|
256
|
+
siteId: '715964'
|
|
258
257
|
}
|
|
259
258
|
}]
|
|
260
259
|
}];
|
|
261
260
|
```
|
|
261
|
+
<em>Please note that your use of the outstream video player will be governed by and subject to the terms and conditions of i) any master services or license agreement entered into by you and Index Exchange; ii) the information provided on our knowledge base linked [here](https://kb.indexexchange.com/publishers/prebid_integration/outstream_video_prebidjs.htm) and [here](https://kb.indexexchange.com/publishers/guidelines/standard_contractual_clauses.htm), and iii) our [Privacy Policy](https://www.indexexchange.com/privacy/). Your use of Index’s outstream video player constitutes your acknowledgement and acceptance of the foregoing. </em>
|
|
262
262
|
|
|
263
263
|
#### Video Caching
|
|
264
264
|
|
|
265
|
-
Note that the IX adapter expects a client-side Prebid Cache to be enabled for video bidding.
|
|
265
|
+
Note that the IX adapter expects a client-side Prebid Cache to be enabled for instream video bidding.
|
|
266
266
|
|
|
267
267
|
```
|
|
268
268
|
pbjs.setConfig({
|
|
@@ -293,21 +293,21 @@ pbjs.setConfig({
|
|
|
293
293
|
By default, the IX bidding adapter bids on all banner sizes available in the ad unit when configured to at least one banner size. If you want the IX bidding adapter to only bid on the banner size it’s configured to, switch off this feature using `detectMissingSizes`.
|
|
294
294
|
```
|
|
295
295
|
pbjs.setConfig({
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
296
|
+
ix: {
|
|
297
|
+
detectMissingSizes: false
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
300
|
```
|
|
301
301
|
OR
|
|
302
302
|
```
|
|
303
303
|
pbjs.setBidderConfig({
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
304
|
+
bidders: ["ix"],
|
|
305
|
+
config: {
|
|
306
|
+
ix: {
|
|
307
|
+
detectMissingSizes: false
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
311
|
```
|
|
312
312
|
|
|
313
313
|
### 2. Include `ixBidAdapter` in your build process
|
|
@@ -184,6 +184,7 @@ export const spec = {
|
|
|
184
184
|
let ids = fetchIds_();
|
|
185
185
|
let eids = [];
|
|
186
186
|
let miscDims = internal.getMiscDims();
|
|
187
|
+
let schain = deepAccess(validBidRequests[0], 'schain');
|
|
187
188
|
|
|
188
189
|
// all available user ids are sent to our backend in the standard array layout:
|
|
189
190
|
if (validBidRequests[0].userId) {
|
|
@@ -209,6 +210,7 @@ export const spec = {
|
|
|
209
210
|
mkeywords: miscDims.mkeywords,
|
|
210
211
|
bids: bids,
|
|
211
212
|
eids: eids,
|
|
213
|
+
schain: schain,
|
|
212
214
|
pricegranularity: pg,
|
|
213
215
|
cfg: jixieCfgBlob
|
|
214
216
|
}, ids);
|
|
@@ -70,27 +70,42 @@ export const spec = {
|
|
|
70
70
|
const bidResponses = [];
|
|
71
71
|
for (let bidId in bids) {
|
|
72
72
|
let adUnit = bids[bidId];
|
|
73
|
-
let meta
|
|
73
|
+
let meta = {
|
|
74
|
+
mediaType: BANNER
|
|
75
|
+
};
|
|
76
|
+
|
|
74
77
|
if (adUnit.metadata && adUnit.metadata.landingPageDomain) {
|
|
75
|
-
meta =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
meta.clickUrl = adUnit.metadata.landingPageDomain[0];
|
|
79
|
+
meta.advertiserDomains = adUnit.metadata.landingPageDomain;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (adUnit.mediaType && SUPPORTED_MEDIA_TYPES.includes(adUnit.mediaType)) {
|
|
83
|
+
meta.mediaType = adUnit.mediaType;
|
|
79
84
|
}
|
|
80
|
-
|
|
85
|
+
|
|
86
|
+
const bidResponse = {
|
|
81
87
|
requestId: bidId,
|
|
82
88
|
cpm: Number(adUnit.cpm),
|
|
83
89
|
width: adUnit.width,
|
|
84
90
|
height: adUnit.height,
|
|
85
|
-
ad: adUnit.adm,
|
|
86
91
|
ttl: 300,
|
|
87
92
|
creativeId: adUnit.id,
|
|
88
93
|
dealId: adUnit.targetingCustom,
|
|
89
94
|
netRevenue: true,
|
|
90
95
|
currency: adUnit.currency || bidRequest.currency,
|
|
96
|
+
mediaType: meta.mediaType,
|
|
91
97
|
meta: meta
|
|
92
|
-
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
if (meta.mediaType == VIDEO) {
|
|
101
|
+
bidResponse.vastXml = adUnit.adm;
|
|
102
|
+
} else {
|
|
103
|
+
bidResponse.ad = adUnit.adm;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
bidResponses.push(bidResponse);
|
|
93
107
|
}
|
|
108
|
+
|
|
94
109
|
return bidResponses;
|
|
95
110
|
},
|
|
96
111
|
getUserSyncs: function(syncOptions, responses, gdprConsent, usPrivacy) {
|
|
@@ -10,7 +10,29 @@ const DEFAULT_TIMEOUT = 1000;
|
|
|
10
10
|
const BID_HOST = 'https://mweb-hb.presage.io/api/header-bidding-request';
|
|
11
11
|
const TIMEOUT_MONITORING_HOST = 'https://ms-ads-monitoring-events.presage.io';
|
|
12
12
|
const MS_COOKIE_SYNC_DOMAIN = 'https://ms-cookie-sync.presage.io';
|
|
13
|
-
const ADAPTER_VERSION = '1.2.
|
|
13
|
+
const ADAPTER_VERSION = '1.2.12';
|
|
14
|
+
|
|
15
|
+
function getClientWidth() {
|
|
16
|
+
const documentElementClientWidth = window.top.document.documentElement.clientWidth
|
|
17
|
+
? window.top.document.documentElement.clientWidth
|
|
18
|
+
: 0
|
|
19
|
+
const innerWidth = window.top.innerWidth ? window.top.innerWidth : 0
|
|
20
|
+
const outerWidth = window.top.outerWidth ? window.top.outerWidth : 0
|
|
21
|
+
const screenWidth = window.top.screen.width ? window.top.screen.width : 0
|
|
22
|
+
|
|
23
|
+
return documentElementClientWidth || innerWidth || outerWidth || screenWidth
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function getClientHeight() {
|
|
27
|
+
const documentElementClientHeight = window.top.document.documentElement.clientHeight
|
|
28
|
+
? window.top.document.documentElement.clientHeight
|
|
29
|
+
: 0
|
|
30
|
+
const innerHeight = window.top.innerHeight ? window.top.innerHeight : 0
|
|
31
|
+
const outerHeight = window.top.outerHeight ? window.top.outerHeight : 0
|
|
32
|
+
const screenHeight = window.top.screen.height ? window.top.screen.height : 0
|
|
33
|
+
|
|
34
|
+
return documentElementClientHeight || innerHeight || outerHeight || screenHeight
|
|
35
|
+
}
|
|
14
36
|
|
|
15
37
|
function isBidRequestValid(bid) {
|
|
16
38
|
const adUnitSizes = getAdUnitSizes(bid);
|
|
@@ -60,6 +82,10 @@ function buildRequests(validBidRequests, bidderRequest) {
|
|
|
60
82
|
ext: {
|
|
61
83
|
adapterversion: ADAPTER_VERSION,
|
|
62
84
|
prebidversion: '$prebid.version$'
|
|
85
|
+
},
|
|
86
|
+
device: {
|
|
87
|
+
w: getClientWidth(),
|
|
88
|
+
h: getClientHeight()
|
|
63
89
|
}
|
|
64
90
|
};
|
|
65
91
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @module modules/trustpidSystem
|
|
5
5
|
* @requires module:modules/userId
|
|
6
6
|
*/
|
|
7
|
-
import { logInfo
|
|
7
|
+
import { logInfo } from '../src/utils.js';
|
|
8
8
|
import { submodule } from '../src/hook.js';
|
|
9
9
|
import { getStorageManager } from '../src/storageManager.js';
|
|
10
10
|
|
|
@@ -22,10 +22,9 @@ export const storage = getStorageManager({gvlid: null, moduleName: MODULE_NAME})
|
|
|
22
22
|
* @param event
|
|
23
23
|
*/
|
|
24
24
|
function messageHandler(event) {
|
|
25
|
-
let msg;
|
|
26
25
|
try {
|
|
27
|
-
if (event && event.data && typeof event.data === 'string'
|
|
28
|
-
msg = JSON.parse(event.data);
|
|
26
|
+
if (event && event.data && typeof event.data === 'string') {
|
|
27
|
+
const msg = JSON.parse(event.data);
|
|
29
28
|
if (msg.msgType === 'MNOSELECTOR' && msg.body && msg.body.url) {
|
|
30
29
|
let URL = msg.body.url.split('//');
|
|
31
30
|
let domainURL = URL[1].split('/');
|
|
@@ -35,7 +34,7 @@ function messageHandler(event) {
|
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
} catch (e) {
|
|
38
|
-
|
|
37
|
+
logInfo(`${LOG_PREFIX}: Unsupported message caught. Origin: ${event.origin}, data: ${event.data}.`);
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
|
|
@@ -44,31 +43,13 @@ function messageHandler(event) {
|
|
|
44
43
|
* @param domain
|
|
45
44
|
*/
|
|
46
45
|
function getDomainAcronym(domain) {
|
|
47
|
-
let acronym = '';
|
|
48
46
|
const prefix = '-';
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
case 'tmi.vodafone.de':
|
|
54
|
-
acronym = 'pqnx';
|
|
55
|
-
break;
|
|
56
|
-
case 'tmi.telekom.de':
|
|
57
|
-
acronym = 'avgw';
|
|
58
|
-
break;
|
|
59
|
-
case 'tmi.tmid.es':
|
|
60
|
-
acronym = 'kjws';
|
|
61
|
-
break;
|
|
62
|
-
case 'uat.mno.link':
|
|
63
|
-
acronym = 'xxxx';
|
|
64
|
-
break;
|
|
65
|
-
case 'es.tmiservice.orange.com':
|
|
66
|
-
acronym = 'aplw';
|
|
67
|
-
break;
|
|
68
|
-
default:
|
|
69
|
-
return 'none';
|
|
47
|
+
const acronym = window.FC_CONF?.TELCO_ACRONYM?.[domain];
|
|
48
|
+
if (!acronym) {
|
|
49
|
+
logInfo(`${LOG_PREFIX}: No acronym found for domain: ${domain}`);
|
|
50
|
+
return;
|
|
70
51
|
}
|
|
71
|
-
|
|
52
|
+
mnoAcronym = prefix + acronym;
|
|
72
53
|
}
|
|
73
54
|
|
|
74
55
|
// Set a listener to handle the iframe response message.
|
|
@@ -5,41 +5,18 @@ trustpid User Id Module.
|
|
|
5
5
|
First, make sure to add the trustpid submodule to your Prebid.js package with:
|
|
6
6
|
|
|
7
7
|
```
|
|
8
|
-
gulp build --modules=userId,adfBidAdapter,trustpidSystem
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
The following configuration parameters are available:
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
pbjs.setConfig({
|
|
15
|
-
userSync: {
|
|
16
|
-
userIds: [
|
|
17
|
-
{
|
|
18
|
-
name: 'trustpid',
|
|
19
|
-
params: {
|
|
20
|
-
maxDelayTime: 1000,
|
|
21
|
-
},
|
|
22
|
-
bidders: ["adf"],
|
|
23
|
-
storage: {
|
|
24
|
-
type: "html5",
|
|
25
|
-
name: "trustpid",
|
|
26
|
-
expires: 1, //days
|
|
27
|
-
},
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
});
|
|
8
|
+
gulp build --modules=userId,adfBidAdapter,ixBidAdapter,prebidServerBidAdapter,trustpidSystem
|
|
32
9
|
```
|
|
33
10
|
|
|
34
11
|
## Parameter Descriptions
|
|
35
12
|
|
|
36
|
-
|
|
|
37
|
-
| --- | --- | --- | --- |
|
|
38
|
-
| name |
|
|
39
|
-
| params |
|
|
40
|
-
| params.maxDelayTime |
|
|
41
|
-
| bidders |
|
|
42
|
-
| storage |
|
|
43
|
-
| storage.type |
|
|
44
|
-
| storage.name |
|
|
45
|
-
| storage.expires |
|
|
13
|
+
| Params under userSync.userIds[] | Type | Description | Example |
|
|
14
|
+
| --- | --- | --- | --- |
|
|
15
|
+
| name | String | The name of the module | `"trustpid"` |
|
|
16
|
+
| params | Object | Object with configuration parameters for trustpid User Id submodule | - |
|
|
17
|
+
| params.maxDelayTime | Integer | Max amount of time (in seconds) before looking into storage for data | 2500 |
|
|
18
|
+
| bidders | Array of Strings | An array of bidder codes to which this user ID may be sent. Currently required and supporting AdformOpenRTB | [`"adf"`, `"adformPBS"`, `"ix"`] |
|
|
19
|
+
| storage | Object | Local storage configuration object | - |
|
|
20
|
+
| storage.type | String | Type of the storage that would be used to store user ID. Must be `"html5"` to utilise HTML5 local storage. | `"html5"` |
|
|
21
|
+
| storage.name | String | The name of the key in local storage where the user ID will be stored. | `"trustpid"` |
|
|
22
|
+
| storage.expires | Integer | How long (in days) the user ID information will be stored. For safety reasons, this information is required.| `1` |
|
package/modules/userId/eids.js
CHANGED
|
@@ -314,6 +314,12 @@ export const USER_IDS_CONFIG = {
|
|
|
314
314
|
return data.envelope;
|
|
315
315
|
}
|
|
316
316
|
},
|
|
317
|
+
|
|
318
|
+
// Gravito MP ID
|
|
319
|
+
'gravitompId': {
|
|
320
|
+
source: 'gravito.net',
|
|
321
|
+
atype: 1
|
|
322
|
+
},
|
|
317
323
|
};
|
|
318
324
|
|
|
319
325
|
// this function will create an eid object for the given UserId sub-module
|
package/modules/userId/index.js
CHANGED
|
@@ -131,7 +131,7 @@ import * as events from '../../src/events.js';
|
|
|
131
131
|
import {getGlobal} from '../../src/prebidGlobal.js';
|
|
132
132
|
import {gdprDataHandler} from '../../src/adapterManager.js';
|
|
133
133
|
import CONSTANTS from '../../src/constants.json';
|
|
134
|
-
import {hook, module} from '../../src/hook.js';
|
|
134
|
+
import {hook, module, ready as hooksReady} from '../../src/hook.js';
|
|
135
135
|
import {buildEidPermissions, createEidsArray, USER_IDS_CONFIG} from './eids.js';
|
|
136
136
|
import {getCoreStorageManager} from '../../src/storageManager.js';
|
|
137
137
|
import {
|
|
@@ -151,6 +151,8 @@ import {
|
|
|
151
151
|
timestamp,
|
|
152
152
|
isEmpty
|
|
153
153
|
} from '../../src/utils.js';
|
|
154
|
+
import {getPPID as coreGetPPID} from '../../src/adserver.js';
|
|
155
|
+
import {promiseControls} from '../../src/utils/promise.js';
|
|
154
156
|
|
|
155
157
|
const MODULE_NAME = 'User ID';
|
|
156
158
|
const COOKIE = 'cookie';
|
|
@@ -528,42 +530,8 @@ function delayFor(ms) {
|
|
|
528
530
|
const INIT_CANCELED = {};
|
|
529
531
|
|
|
530
532
|
function idSystemInitializer({delay = delayFor} = {}) {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
*/
|
|
534
|
-
function breakpoint() {
|
|
535
|
-
const [SUCCESS, FAIL, RESULT] = [0, 1, 2];
|
|
536
|
-
const status = {};
|
|
537
|
-
|
|
538
|
-
function finisher(slot) {
|
|
539
|
-
return function (val) {
|
|
540
|
-
if (status[slot] != null) {
|
|
541
|
-
status[slot](val);
|
|
542
|
-
} else {
|
|
543
|
-
status[slot] = true;
|
|
544
|
-
status[RESULT] = val;
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
return {
|
|
550
|
-
promise: new Promise((resolve, reject) => {
|
|
551
|
-
if (status[SUCCESS] != null) {
|
|
552
|
-
resolve(status[RESULT]);
|
|
553
|
-
} else if (status[FAIL] != null) {
|
|
554
|
-
reject(status[RESULT]);
|
|
555
|
-
} else {
|
|
556
|
-
status[SUCCESS] = resolve;
|
|
557
|
-
status[FAIL] = reject;
|
|
558
|
-
}
|
|
559
|
-
}),
|
|
560
|
-
resolve: finisher(SUCCESS),
|
|
561
|
-
reject: finisher(FAIL)
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
const startInit = breakpoint();
|
|
566
|
-
const startCallbacks = breakpoint();
|
|
533
|
+
const startInit = promiseControls();
|
|
534
|
+
const startCallbacks = promiseControls();
|
|
567
535
|
let cancel;
|
|
568
536
|
let initialized = false;
|
|
569
537
|
|
|
@@ -571,7 +539,7 @@ function idSystemInitializer({delay = delayFor} = {}) {
|
|
|
571
539
|
if (cancel != null) {
|
|
572
540
|
cancel.reject(INIT_CANCELED);
|
|
573
541
|
}
|
|
574
|
-
cancel =
|
|
542
|
+
cancel = promiseControls();
|
|
575
543
|
return Promise.race([promise, cancel.promise]);
|
|
576
544
|
}
|
|
577
545
|
|
|
@@ -591,7 +559,7 @@ function idSystemInitializer({delay = delayFor} = {}) {
|
|
|
591
559
|
}
|
|
592
560
|
|
|
593
561
|
let done = cancelAndTry(
|
|
594
|
-
startInit.promise
|
|
562
|
+
Promise.all([hooksReady, startInit.promise])
|
|
595
563
|
.then(() => gdprDataHandler.promise)
|
|
596
564
|
.then(checkRefs((consentData) => {
|
|
597
565
|
initSubmodules(initModules, allModules, consentData);
|
|
@@ -650,6 +618,19 @@ function idSystemInitializer({delay = delayFor} = {}) {
|
|
|
650
618
|
|
|
651
619
|
let initIdSystem;
|
|
652
620
|
|
|
621
|
+
function getPPID() {
|
|
622
|
+
// userSync.ppid should be one of the 'source' values in getUserIdsAsEids() eg pubcid.org or id5-sync.com
|
|
623
|
+
const matchingUserId = ppidSource && (getUserIdsAsEids() || []).find(userID => userID.source === ppidSource);
|
|
624
|
+
if (matchingUserId && typeof deepAccess(matchingUserId, 'uids.0.id') === 'string') {
|
|
625
|
+
const ppidValue = matchingUserId.uids[0].id.replace(/[\W_]/g, '');
|
|
626
|
+
if (ppidValue.length >= 32 && ppidValue.length <= 150) {
|
|
627
|
+
return ppidValue;
|
|
628
|
+
} else {
|
|
629
|
+
logWarn(`User ID - Googletag Publisher Provided ID for ${ppidSource} is not between 32 and 150 characters - ${ppidValue}`);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
653
634
|
/**
|
|
654
635
|
* Hook is executed before adapters, but after consentManagement. Consent data is requied because
|
|
655
636
|
* this module requires GDPR consent with Purpose #1 to save data locally.
|
|
@@ -666,23 +647,16 @@ export function requestBidsHook(fn, reqBidsConfigObj, {delay = delayFor} = {}) {
|
|
|
666
647
|
]).then(() => {
|
|
667
648
|
// pass available user id data to bid adapters
|
|
668
649
|
addIdDataToAdUnitBids(reqBidsConfigObj.adUnits || getGlobal().adUnits, initializedSubmodules);
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
const ppidValue = matchingUserId.uids[0].id.replace(/[\W_]/g, '');
|
|
674
|
-
if (ppidValue.length >= 32 && ppidValue.length <= 150) {
|
|
675
|
-
if (isGptPubadsDefined()) {
|
|
676
|
-
window.googletag.pubads().setPublisherProvidedId(ppidValue);
|
|
677
|
-
} else {
|
|
678
|
-
window.googletag = window.googletag || {};
|
|
679
|
-
window.googletag.cmd = window.googletag.cmd || [];
|
|
680
|
-
window.googletag.cmd.push(function() {
|
|
681
|
-
window.googletag.pubads().setPublisherProvidedId(ppidValue);
|
|
682
|
-
});
|
|
683
|
-
}
|
|
650
|
+
const ppid = getPPID();
|
|
651
|
+
if (ppid) {
|
|
652
|
+
if (isGptPubadsDefined()) {
|
|
653
|
+
window.googletag.pubads().setPublisherProvidedId(ppid);
|
|
684
654
|
} else {
|
|
685
|
-
|
|
655
|
+
window.googletag = window.googletag || {};
|
|
656
|
+
window.googletag.cmd = window.googletag.cmd || [];
|
|
657
|
+
window.googletag.cmd.push(function() {
|
|
658
|
+
window.googletag.pubads().setPublisherProvidedId(ppid);
|
|
659
|
+
});
|
|
686
660
|
}
|
|
687
661
|
}
|
|
688
662
|
|
|
@@ -980,6 +954,7 @@ function updateSubmodules() {
|
|
|
980
954
|
if (!addedUserIdHook && submodules.length) {
|
|
981
955
|
// priority value 40 will load after consentManagement with a priority of 50
|
|
982
956
|
getGlobal().requestBids.before(requestBidsHook, 40);
|
|
957
|
+
coreGetPPID.after((next) => next(getPPID()));
|
|
983
958
|
logInfo(`${MODULE_NAME} - usersync config updated for ${submodules.length} submodules: `, submodules.map(a => a.submodule.name));
|
|
984
959
|
addedUserIdHook = true;
|
|
985
960
|
}
|
package/modules/userId/userId.md
CHANGED
|
@@ -166,6 +166,9 @@ pbjs.setConfig({
|
|
|
166
166
|
},
|
|
167
167
|
{
|
|
168
168
|
name: "dacId"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: "gravitompId"
|
|
169
172
|
}
|
|
170
173
|
],
|
|
171
174
|
syncDelay: 5000,
|
|
@@ -190,17 +193,6 @@ pbjs.setConfig({
|
|
|
190
193
|
params: {
|
|
191
194
|
pid: "0010b00002GYU4eBAH" // Example ID
|
|
192
195
|
}
|
|
193
|
-
}, {
|
|
194
|
-
name: 'trustpid',
|
|
195
|
-
params: {
|
|
196
|
-
maxDelayTime: 2500
|
|
197
|
-
},
|
|
198
|
-
bidders: ['adform'],
|
|
199
|
-
storage: {
|
|
200
|
-
type: 'html5',
|
|
201
|
-
name: 'trustpid',
|
|
202
|
-
expires: 60
|
|
203
|
-
}
|
|
204
196
|
}, {
|
|
205
197
|
name: "unifiedId",
|
|
206
198
|
params: {
|