prebid.js 6.7.0 → 6.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +8 -1
- package/integrationExamples/gpt/{haloRtdProvider_example.html → hadronRtdProvider_example.html} +9 -9
- package/integrationExamples/gpt/idImportLibrary_example.html +2 -2
- package/integrationExamples/gpt/userId_example.html +2 -2
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +154 -115
- package/integrationExamples/gpt/x-domain/creative.html +63 -29
- package/modules/.submodules.json +3 -0
- package/modules/adagioBidAdapter.js +0 -8
- package/modules/adagioBidAdapter.md +1 -1
- package/modules/adkernelBidAdapter.js +2 -1
- package/modules/adnuntiusRtdProvider.js +96 -0
- package/modules/adnuntiusRtdProvider.md +41 -0
- package/modules/adotBidAdapter.js +516 -567
- package/modules/adotBidAdapter.md +6 -44
- package/modules/adpod.js +12 -14
- package/modules/adyoulikeBidAdapter.js +2 -0
- package/modules/appnexusBidAdapter.js +14 -2
- package/modules/asealBidAdapter.js +58 -0
- package/modules/asealBidAdapter.md +52 -0
- package/modules/brandmetricsRtdProvider.js +168 -0
- package/modules/brandmetricsRtdProvider.md +40 -0
- package/modules/conversantBidAdapter.js +7 -0
- package/modules/criteoBidAdapter.js +9 -0
- package/modules/currency.js +27 -5
- package/modules/displayioBidAdapter.js +157 -0
- package/modules/displayioBidAdapter.md +148 -0
- package/modules/dspxBidAdapter.js +69 -29
- package/modules/dspxBidAdapter.md +2 -1
- package/modules/e_volutionBidAdapter.js +158 -0
- package/modules/gridBidAdapter.js +15 -1
- package/modules/gumgumBidAdapter.js +52 -38
- package/modules/hadronIdSystem.js +96 -0
- package/modules/hadronIdSystem.md +35 -0
- package/modules/hadronRtdProvider.js +254 -0
- package/modules/hadronRtdProvider.md +126 -0
- package/modules/haloIdSystem.md +4 -35
- package/modules/haloRtdProvider.md +3 -126
- package/modules/imRtdProvider.js +10 -0
- package/modules/improvedigitalBidAdapter.js +5 -0
- package/modules/interactiveOffersBidAdapter.js +9 -6
- package/modules/iqzoneBidAdapter.js +10 -3
- package/modules/iqzoneBidAdapter.md +16 -0
- package/modules/ixBidAdapter.js +2 -6
- package/modules/kubientBidAdapter.js +50 -19
- package/modules/lunamediahbBidAdapter.js +32 -4
- package/modules/malltvBidAdapter.js +7 -3
- package/modules/malltvBidAdapter.md +64 -51
- package/modules/mass.js +3 -5
- package/modules/mediakeysBidAdapter.js +0 -5
- package/modules/medianetAnalyticsAdapter.js +1 -1
- package/modules/mediasquareBidAdapter.js +9 -1
- package/modules/nextMillenniumBidAdapter.js +1 -0
- package/modules/oguryBidAdapter.js +7 -14
- package/modules/prebidServerBidAdapter/index.js +61 -39
- package/modules/priceFloors.js +20 -12
- package/modules/pubmaticBidAdapter.js +1 -1
- package/modules/richaudienceBidAdapter.js +8 -3
- package/modules/riseBidAdapter.js +17 -6
- package/modules/rtbhouseBidAdapter.js +2 -0
- package/modules/rubiconAnalyticsAdapter.js +5 -0
- package/modules/rubiconBidAdapter.js +2 -2
- package/modules/sizeMappingV2.js +1 -8
- package/modules/sortableAnalyticsAdapter.js +5 -4
- package/modules/sovrnBidAdapter.js +93 -18
- package/modules/sovrnBidAdapter.md +80 -2
- package/modules/sspBCBidAdapter.js +53 -20
- package/modules/telariaBidAdapter.js +22 -29
- package/modules/trustpidSystem.js +197 -0
- package/modules/trustpidSystem.md +45 -0
- package/modules/undertoneBidAdapter.js +17 -1
- package/modules/userId/eids.js +16 -1
- package/modules/userId/eids.md +10 -2
- package/modules/userId/userId.md +17 -2
- package/modules/vibrantmediaBidAdapter.js +220 -0
- package/modules/vibrantmediaBidAdapter.md +92 -0
- package/modules/vidoomyBidAdapter.js +8 -0
- package/modules/vidoomyBidAdapter.md +4 -2
- package/modules/weboramaRtdProvider.js +264 -34
- package/modules/weboramaRtdProvider.md +110 -40
- package/modules/yahoosspBidAdapter.js +3 -1
- package/modules/yieldoneBidAdapter.js +6 -0
- package/package.json +2 -1
- package/src/adRendering.js +38 -0
- package/src/adapterManager.js +24 -19
- package/src/adapters/bidderFactory.js +14 -11
- package/src/adloader.js +2 -1
- package/src/auction.js +138 -115
- package/src/auctionIndex.js +85 -0
- package/src/auctionManager.js +3 -0
- package/src/bidderSettings.js +69 -0
- package/src/bidfactory.js +18 -6
- package/src/native.js +29 -21
- package/src/prebid.js +3 -19
- package/src/secureCreatives.js +128 -45
- package/src/targeting.js +11 -2
- package/src/utils.js +14 -17
- package/src/video.js +10 -11
- package/src/videoCache.js +10 -9
- package/test/fixtures/fixtures.js +2 -1
- package/test/helpers/indexStub.js +28 -0
- package/test/helpers/syncPromise.js +71 -0
- package/test/spec/auctionmanager_spec.js +268 -89
- package/test/spec/config_spec.js +24 -1
- package/test/spec/modules/adagioBidAdapter_spec.js +0 -10
- package/test/spec/modules/adnuntiusRtdProvider_spec.js +145 -0
- package/test/spec/modules/adotBidAdapter_spec.js +294 -3124
- package/test/spec/modules/adpod_spec.js +91 -156
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +4 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +27 -0
- package/test/spec/modules/asealBidAdapter_spec.js +144 -0
- package/test/spec/modules/brandmetricsRtdProvider_spec.js +191 -0
- package/test/spec/modules/conversantBidAdapter_spec.js +54 -2
- package/test/spec/modules/criteoBidAdapter_spec.js +21 -0
- package/test/spec/modules/currency_spec.js +36 -15
- package/test/spec/modules/displayioBidAdapter_spec.js +239 -0
- package/test/spec/modules/dspxBidAdapter_spec.js +20 -15
- package/test/spec/modules/e_volutionBidAdapter_spec.js +242 -0
- package/test/spec/modules/eids_spec.js +2 -2
- package/test/spec/modules/gridBidAdapter_spec.js +18 -0
- package/test/spec/modules/gumgumBidAdapter_spec.js +49 -3
- package/test/spec/modules/hadronIdSystem_spec.js +57 -0
- package/test/spec/modules/hadronRtdProvider_spec.js +762 -0
- package/test/spec/modules/imRtdProvider_spec.js +30 -1
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +19 -0
- package/test/spec/modules/iqzoneBidAdapter_spec.js +1 -0
- package/test/spec/modules/ixBidAdapter_spec.js +1 -1
- package/test/spec/modules/kubientBidAdapter_spec.js +182 -84
- package/test/spec/modules/lunamediahbBidAdapter_spec.js +27 -1
- package/test/spec/modules/mass_spec.js +2 -14
- package/test/spec/modules/mediakeysBidAdapter_spec.js +9 -5
- package/test/spec/modules/mediasquareBidAdapter_spec.js +25 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +63 -5
- package/test/spec/modules/prebidServerBidAdapter_spec.js +43 -6
- package/test/spec/modules/priceFloors_spec.js +83 -24
- package/test/spec/modules/pubmaticBidAdapter_spec.js +40 -0
- package/test/spec/modules/riseBidAdapter_spec.js +30 -4
- package/test/spec/modules/rubiconAnalyticsAdapter_spec.js +31 -1
- package/test/spec/modules/rubiconBidAdapter_spec.js +1 -1
- package/test/spec/modules/sortableAnalyticsAdapter_spec.js +2 -3
- package/test/spec/modules/sovrnBidAdapter_spec.js +413 -333
- package/test/spec/modules/sspBCBidAdapter_spec.js +7 -7
- package/test/spec/modules/telariaBidAdapter_spec.js +1 -3
- package/test/spec/modules/trustpidSystem_spec.js +232 -0
- package/test/spec/modules/undertoneBidAdapter_spec.js +55 -2
- package/test/spec/modules/userId_spec.js +39 -39
- package/test/spec/modules/vibrantmediaBidAdapter_spec.js +1237 -0
- package/test/spec/modules/vidoomyBidAdapter_spec.js +7 -1
- package/test/spec/modules/weboramaRtdProvider_spec.js +536 -20
- package/test/spec/modules/yahoosspBidAdapter_spec.js +10 -0
- package/test/spec/modules/yieldoneBidAdapter_spec.js +33 -0
- package/test/spec/native_spec.js +62 -40
- package/test/spec/unit/core/adapterManager_spec.js +22 -0
- package/test/spec/unit/core/auctionIndex_spec.js +129 -0
- package/test/spec/unit/core/bidderFactory_spec.js +65 -12
- package/test/spec/unit/core/bidderSettings_spec.js +123 -0
- package/test/spec/unit/core/targeting_spec.js +93 -0
- package/test/spec/unit/pbjs_api_spec.js +80 -42
- package/test/spec/unit/secureCreatives_spec.js +143 -24
- package/test/spec/videoCache_spec.js +18 -19
- package/test/spec/video_spec.js +51 -61
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import {registerBidder} from '../src/adapters/bidderFactory.js';
|
|
2
|
+
import {BANNER, VIDEO} from '../src/mediaTypes.js';
|
|
3
|
+
|
|
4
|
+
const BIDDER_VERSION = '1.0.0';
|
|
5
|
+
const BIDDER_CODE = 'displayio';
|
|
6
|
+
const GVLID = 999;
|
|
7
|
+
const BID_TTL = 300;
|
|
8
|
+
const SUPPORTED_AD_TYPES = [BANNER, VIDEO];
|
|
9
|
+
const DEFAULT_CURRENCY = 'USD';
|
|
10
|
+
|
|
11
|
+
export const spec = {
|
|
12
|
+
code: BIDDER_CODE,
|
|
13
|
+
gvlid: GVLID,
|
|
14
|
+
supportedMediaTypes: SUPPORTED_AD_TYPES,
|
|
15
|
+
isBidRequestValid: function(bid) {
|
|
16
|
+
return !!(bid.params && bid.params.placementId && bid.params.siteId &&
|
|
17
|
+
bid.params.adsSrvDomain && bid.params.cdnDomain);
|
|
18
|
+
},
|
|
19
|
+
buildRequests: function (bidRequests, bidderRequest) {
|
|
20
|
+
return bidRequests.map(bid => {
|
|
21
|
+
let url = '//' + bid.params.adsSrvDomain + '/srv?method=getPlacement&app=' +
|
|
22
|
+
bid.params.siteId + '&placement=' + bid.params.placementId;
|
|
23
|
+
const data = this._getPayload(bid, bidderRequest);
|
|
24
|
+
return {
|
|
25
|
+
method: 'POST',
|
|
26
|
+
headers: {'Content-Type': 'application/json;charset=utf-8'},
|
|
27
|
+
url,
|
|
28
|
+
data
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
interpretResponse: function (serverResponse, serverRequest) {
|
|
33
|
+
const ads = serverResponse.body.data.ads;
|
|
34
|
+
const bidResponses = [];
|
|
35
|
+
const { data } = serverRequest.data;
|
|
36
|
+
if (ads.length) {
|
|
37
|
+
const adData = ads[0].ad.data;
|
|
38
|
+
const bidResponse = {
|
|
39
|
+
requestId: data.id,
|
|
40
|
+
cpm: adData.ecpm,
|
|
41
|
+
width: adData.w,
|
|
42
|
+
height: adData.h,
|
|
43
|
+
netRevenue: true,
|
|
44
|
+
ttl: BID_TTL,
|
|
45
|
+
creativeId: adData.adId || 0,
|
|
46
|
+
currency: DEFAULT_CURRENCY,
|
|
47
|
+
referrer: data.data.ref,
|
|
48
|
+
mediaType: ads[0].ad.subtype,
|
|
49
|
+
ad: adData.markup,
|
|
50
|
+
placement: data.placement,
|
|
51
|
+
adData: adData
|
|
52
|
+
};
|
|
53
|
+
if (bidResponse.vastUrl === 'videoVast') {
|
|
54
|
+
bidResponse.vastUrl = adData.videos[0].url
|
|
55
|
+
}
|
|
56
|
+
bidResponses.push(bidResponse);
|
|
57
|
+
}
|
|
58
|
+
return bidResponses;
|
|
59
|
+
},
|
|
60
|
+
_getPayload: function (bid, bidderRequest) {
|
|
61
|
+
const connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
|
|
62
|
+
const userSession = 'us_web_xxxxxxxxxxxx'.replace(/[x]/g, c => {
|
|
63
|
+
let r = Math.random() * 16 | 0;
|
|
64
|
+
let v = c === 'x' ? r : (r & 0x3 | 0x8);
|
|
65
|
+
return v.toString(16);
|
|
66
|
+
});
|
|
67
|
+
const { params } = bid;
|
|
68
|
+
const { siteId, placementId } = params;
|
|
69
|
+
const { refererInfo, uspConsent, gdprConsent } = bidderRequest;
|
|
70
|
+
const mediation = {consent: '-1', gdpr: '-1'};
|
|
71
|
+
if (gdprConsent) {
|
|
72
|
+
if (gdprConsent.consentString !== undefined) {
|
|
73
|
+
mediation.consent = gdprConsent.consentString;
|
|
74
|
+
}
|
|
75
|
+
if (gdprConsent.gdprApplies !== undefined) {
|
|
76
|
+
mediation.gdpr = gdprConsent.gdprApplies ? '1' : '0';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const payload = {
|
|
80
|
+
userSession,
|
|
81
|
+
data: {
|
|
82
|
+
id: bid.bidId,
|
|
83
|
+
action: 'getPlacement',
|
|
84
|
+
app: siteId,
|
|
85
|
+
placement: placementId,
|
|
86
|
+
data: {
|
|
87
|
+
pagecat: params.pageCategory ? params.pageCategory.split(',').map(k => k.trim()) : [],
|
|
88
|
+
keywords: params.keywords ? params.keywords.split(',').map(k => k.trim()) : [],
|
|
89
|
+
lang_content: document.documentElement.lang,
|
|
90
|
+
lang: window.navigator.language,
|
|
91
|
+
domain: window.location.hostname,
|
|
92
|
+
page: window.location.href,
|
|
93
|
+
ref: refererInfo.referer,
|
|
94
|
+
userids: _getUserIDs(),
|
|
95
|
+
geo: '',
|
|
96
|
+
},
|
|
97
|
+
complianceData: {
|
|
98
|
+
child: '-1',
|
|
99
|
+
us_privacy: uspConsent,
|
|
100
|
+
dnt: window.navigator.doNotTrack,
|
|
101
|
+
iabConsent: {},
|
|
102
|
+
mediation: {
|
|
103
|
+
consent: mediation.consent,
|
|
104
|
+
gdpr: mediation.gdpr,
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
integration: 'JS',
|
|
108
|
+
omidpn: 'Displayio',
|
|
109
|
+
mediationPlatform: 0,
|
|
110
|
+
prebidVersion: BIDDER_VERSION,
|
|
111
|
+
device: {
|
|
112
|
+
w: window.screen.width,
|
|
113
|
+
h: window.screen.height,
|
|
114
|
+
connection_type: connection ? connection.effectiveType : '',
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (navigator.permissions) {
|
|
119
|
+
navigator.permissions.query({ name: 'geolocation' })
|
|
120
|
+
.then((result) => {
|
|
121
|
+
if (result.state === 'granted') {
|
|
122
|
+
payload.data.data.geo = _getGeoData();
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return payload
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
function _getUserIDs () {
|
|
131
|
+
let ids = {};
|
|
132
|
+
try {
|
|
133
|
+
ids = window.owpbjs.getUserIdsAsEids();
|
|
134
|
+
} catch (e) {}
|
|
135
|
+
return ids;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
async function _getGeoData () {
|
|
139
|
+
let geoData = null;
|
|
140
|
+
const getCurrentPosition = () => {
|
|
141
|
+
return new Promise((resolve, reject) =>
|
|
142
|
+
navigator.geolocation.getCurrentPosition(resolve, reject)
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
try {
|
|
146
|
+
const position = await getCurrentPosition();
|
|
147
|
+
let {latitude, longitude, accuracy} = position.coords;
|
|
148
|
+
geoData = {
|
|
149
|
+
'lat': latitude,
|
|
150
|
+
'lng': longitude,
|
|
151
|
+
'precision': accuracy
|
|
152
|
+
};
|
|
153
|
+
} catch (e) {}
|
|
154
|
+
return geoData
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
registerBidder(spec);
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
Module Name: DisplayIO Bidder Adapter
|
|
5
|
+
Module Type: Bidder Adapter
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
# Description
|
|
9
|
+
|
|
10
|
+
Module that connects to display.io's demand sources.
|
|
11
|
+
Web mobile (not relevant for web desktop).
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
#Features
|
|
15
|
+
| Feature | | Feature | |
|
|
16
|
+
|---------------|---------------------------------------------------------|-----------------------|-----|
|
|
17
|
+
| Bidder Code | displayio | Prebid member | no |
|
|
18
|
+
| Media Types | Banner, video. <br/>Sizes (display 320x480 / vertical video) | GVL ID | no |
|
|
19
|
+
| GDPR Support | yes | Prebid.js Adapter | yes |
|
|
20
|
+
| USP Support | yes | Prebid Server Adapter | no |
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#Global configuration
|
|
24
|
+
```javascript
|
|
25
|
+
<head>
|
|
26
|
+
<script src="https://cdn.display.io/webis/webis.min.js"></script>
|
|
27
|
+
</head>
|
|
28
|
+
<script>
|
|
29
|
+
......................................
|
|
30
|
+
var CMP_TIMEOUT = 8000;
|
|
31
|
+
var consentManagement = {
|
|
32
|
+
gdpr: {
|
|
33
|
+
cmpApi: 'iab',
|
|
34
|
+
timeout: CMP_TIMEOUT,
|
|
35
|
+
defaultGdprScope: true
|
|
36
|
+
},
|
|
37
|
+
usp: {
|
|
38
|
+
cmpApi: 'iab',
|
|
39
|
+
timeout: CMP_TIMEOUT
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (typeof __tcfapi !== 'function') {
|
|
44
|
+
delete consentManagement.gdpr;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
pbjs.que.push(function() {
|
|
48
|
+
pbjs.setConfig({consentManagement})
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
......................................
|
|
53
|
+
|
|
54
|
+
function initAdserver(bidResponses) {
|
|
55
|
+
if (pbjs.initAdserverSet) return;
|
|
56
|
+
pbjs.initAdserverSet = true;
|
|
57
|
+
|
|
58
|
+
...........................
|
|
59
|
+
|
|
60
|
+
const displayioBids = getDisplayioBid(bidResponses)
|
|
61
|
+
displayioBids.forEach(b => {
|
|
62
|
+
const {adData, placement} = b[1].bids[0];
|
|
63
|
+
webis.init(adData, b[0], {placement})
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function getDisplayioBid(bidResponses) {
|
|
69
|
+
const codes = adUnits.map(u => u.code);
|
|
70
|
+
const bids = Object.entries(bidResponses);
|
|
71
|
+
bids.filter(([key, value]) => codes.includes(key) && value.bids[0].bidderCode === 'displayio');
|
|
72
|
+
return bids;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
......................................
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
# Bid Parameters
|
|
81
|
+
|
|
82
|
+
| Name | Scope | Type | Description | Example |
|
|
83
|
+
|----------------| ----- | ---- |----------------------------------------|-------------------------------|
|
|
84
|
+
| `siteId` | required | Number | SiteId and PlacementID are your inventory IDs on the display.io platform (please ask your Account Manager for your site and placement IDs). | 7753 |
|
|
85
|
+
| `placementId` | required | Number | SiteId and PlacementID are your inventory IDs on the display.io platform (please ask your Account Manager for your site and placement IDs). | 5375 |
|
|
86
|
+
| `adsSrvDomain` | required | String | | "appsrv.display.io" |
|
|
87
|
+
| `cdnDomain` | required | String | | "cdn.display.io" |
|
|
88
|
+
| `pageCategory` | optional | String | Comma-separated list of IAB content categories that describe the current page or view of the site, list of available values. | "pageCategory1, pageCategory2" |
|
|
89
|
+
| `keywords` | optional | String | Comma-separated list of keywords describing the content. | "keyword1, keyword2, keyword3" |
|
|
90
|
+
| `custom` | optional | Object | User-defined targeting key-value pairs. custom applies to a specific unit. | `{headerTextColor: "red", fixedHeaderSelector: '.site-header'}` |
|
|
91
|
+
| `custom.headerText`| optional | String | Ad container header text. By default, text is "Scroll to continue with content". Limited to 50 characters. | "Our awesome advertisement"|
|
|
92
|
+
| `custom.headerTextColor`| optional | String | Ad container header text color, "white" by default | "#2196f3"|
|
|
93
|
+
| `custom.headerBackgroundColor`| optional | String | Ad container header background color, "black" by default | "#fff" |
|
|
94
|
+
| `custom.adContainerBackgroundColor`| optional | String | Ad container body background color, "transparent" by default | "#000"|
|
|
95
|
+
| `custom.fixedHeaderSelector`| optional | String | In case your webpage has a fixed header – the header Id attribute or header class attribute should be defined as a value for parameter fixedHeaderSelector. | ".site-header"|
|
|
96
|
+
|
|
97
|
+
# adUnit configuration example
|
|
98
|
+
```javascript
|
|
99
|
+
var adUnits = [
|
|
100
|
+
{
|
|
101
|
+
code: 'ad-tag-1',
|
|
102
|
+
mediaTypes: {
|
|
103
|
+
banner: {
|
|
104
|
+
sizes: [[320, 480]]
|
|
105
|
+
},
|
|
106
|
+
video: {
|
|
107
|
+
sizes: [[360, 640]]
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
bids: [
|
|
111
|
+
{
|
|
112
|
+
bidder: 'displayio',
|
|
113
|
+
params: {
|
|
114
|
+
siteId: 1,
|
|
115
|
+
placementId: 1,
|
|
116
|
+
adsSrvDomain: 'appsrv.display.io',
|
|
117
|
+
cdnDomain: 'cdn.display.io',
|
|
118
|
+
pageCategory: 'pageCategory1, pageCategory2', //comma separated
|
|
119
|
+
keywords: 'keyword1, keyword2, keyword3', //comma separated
|
|
120
|
+
custom: {
|
|
121
|
+
headerText: 'Our awesome advertisement',
|
|
122
|
+
headerTextColor: '#2196f3',
|
|
123
|
+
headerBackgroundColor: 'black',
|
|
124
|
+
adContainerBackgroundColor: 'transparent',
|
|
125
|
+
fixedHeaderSelector: '.site-header',
|
|
126
|
+
},
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
// minimal required options
|
|
132
|
+
{
|
|
133
|
+
code: 'ad-tag-2',
|
|
134
|
+
bids: [{
|
|
135
|
+
bidder: 'displayio',
|
|
136
|
+
params: {
|
|
137
|
+
siteId: 1,
|
|
138
|
+
placementId: 1,
|
|
139
|
+
adsSrvDomain: 'appsrv.display.io',
|
|
140
|
+
cdnDomain: 'cdn.display.io',
|
|
141
|
+
}
|
|
142
|
+
}]
|
|
143
|
+
}
|
|
144
|
+
];
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
# Additional Details
|
|
148
|
+
[Mobile web prebid.js integration](https://www.display.io/documentation/mobile-web-prebid-js-integration/)
|
|
@@ -6,7 +6,6 @@ import { BANNER, VIDEO } from '../src/mediaTypes.js';
|
|
|
6
6
|
const BIDDER_CODE = 'dspx';
|
|
7
7
|
const ENDPOINT_URL = 'https://buyer.dspx.tv/request/';
|
|
8
8
|
const ENDPOINT_URL_DEV = 'https://dcbuyer.dspx.tv/request/';
|
|
9
|
-
const DEFAULT_VAST_FORMAT = 'vast2';
|
|
10
9
|
const GVLID = 602;
|
|
11
10
|
|
|
12
11
|
export const spec = {
|
|
@@ -26,37 +25,30 @@ export const spec = {
|
|
|
26
25
|
const referrer = bidderRequest.refererInfo.referer;
|
|
27
26
|
const bidId = bidRequest.bidId;
|
|
28
27
|
const isDev = params.devMode || false;
|
|
28
|
+
const pbcode = bidRequest.adUnitCode || false; // div id
|
|
29
|
+
const auctionId = bidRequest.auctionId || false;
|
|
29
30
|
|
|
30
31
|
let endpoint = isDev ? ENDPOINT_URL_DEV : ENDPOINT_URL;
|
|
31
|
-
let payload = {};
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
inventory_item_id: placementId,
|
|
53
|
-
srw: size.width,
|
|
54
|
-
srh: size.height,
|
|
55
|
-
idt: 100,
|
|
56
|
-
rnd: rnd,
|
|
57
|
-
ref: referrer,
|
|
58
|
-
bid_id: bidId,
|
|
59
|
-
};
|
|
33
|
+
let mediaTypesInfo = getMediaTypesInfo(bidRequest);
|
|
34
|
+
let type = isBannerRequest(bidRequest) ? BANNER : VIDEO;
|
|
35
|
+
let sizes = mediaTypesInfo[type];
|
|
36
|
+
|
|
37
|
+
let payload = {
|
|
38
|
+
_f: 'auto',
|
|
39
|
+
alternative: 'prebid_js',
|
|
40
|
+
inventory_item_id: placementId,
|
|
41
|
+
srw: sizes ? sizes[0].width : 0,
|
|
42
|
+
srh: sizes ? sizes[0].height : 0,
|
|
43
|
+
idt: 100,
|
|
44
|
+
rnd: rnd,
|
|
45
|
+
ref: referrer,
|
|
46
|
+
bid_id: bidId,
|
|
47
|
+
pbver: '$prebid.version$'
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
if (mediaTypesInfo[VIDEO] !== undefined && params.vastFormat !== undefined) {
|
|
51
|
+
payload.vf = params.vastFormat;
|
|
60
52
|
}
|
|
61
53
|
|
|
62
54
|
if (params.pfilter !== undefined) {
|
|
@@ -94,6 +86,15 @@ export const spec = {
|
|
|
94
86
|
payload.did_uid2 = bidRequest.userId.uid2;
|
|
95
87
|
}
|
|
96
88
|
|
|
89
|
+
if (auctionId) {
|
|
90
|
+
payload.auctionId = auctionId;
|
|
91
|
+
}
|
|
92
|
+
if (pbcode) {
|
|
93
|
+
payload.pbcode = pbcode;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
payload.media_types = convertMediaInfoForRequest(mediaTypesInfo);
|
|
97
|
+
|
|
97
98
|
return {
|
|
98
99
|
method: 'GET',
|
|
99
100
|
url: endpoint,
|
|
@@ -256,4 +257,43 @@ function parseSizes(sizes) {
|
|
|
256
257
|
return [parseSize(sizes)]; // or a single one ? (ie. [728,90])
|
|
257
258
|
}
|
|
258
259
|
|
|
260
|
+
/**
|
|
261
|
+
* Get MediaInfo object for server request
|
|
262
|
+
*
|
|
263
|
+
* @param mediaTypesInfo
|
|
264
|
+
* @returns {*}
|
|
265
|
+
*/
|
|
266
|
+
function convertMediaInfoForRequest(mediaTypesInfo) {
|
|
267
|
+
let requestData = {};
|
|
268
|
+
Object.keys(mediaTypesInfo).forEach(mediaType => {
|
|
269
|
+
requestData[mediaType] = mediaTypesInfo[mediaType].map(size => {
|
|
270
|
+
return size.width + 'x' + size.height;
|
|
271
|
+
}).join(',');
|
|
272
|
+
});
|
|
273
|
+
return requestData;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Get media types info
|
|
278
|
+
*
|
|
279
|
+
* @param bid
|
|
280
|
+
*/
|
|
281
|
+
function getMediaTypesInfo(bid) {
|
|
282
|
+
let mediaTypesInfo = {};
|
|
283
|
+
|
|
284
|
+
if (bid.mediaTypes) {
|
|
285
|
+
Object.keys(bid.mediaTypes).forEach(mediaType => {
|
|
286
|
+
if (mediaType === BANNER) {
|
|
287
|
+
mediaTypesInfo[mediaType] = getBannerSizes(bid);
|
|
288
|
+
}
|
|
289
|
+
if (mediaType === VIDEO) {
|
|
290
|
+
mediaTypesInfo[mediaType] = getVideoSizes(bid);
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
} else {
|
|
294
|
+
mediaTypesInfo[BANNER] = getBannerSizes(bid);
|
|
295
|
+
}
|
|
296
|
+
return mediaTypesInfo;
|
|
297
|
+
}
|
|
298
|
+
|
|
259
299
|
registerBidder(spec);
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
2
|
+
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
|
|
3
|
+
import { isFn, deepAccess, logMessage } from '../src/utils.js';
|
|
4
|
+
|
|
5
|
+
const BIDDER_CODE = 'e_volution';
|
|
6
|
+
const AD_URL = 'https://service.e-volution.ai/?c=o&m=multi';
|
|
7
|
+
const URL_SYNC = 'https://service.e-volution.ai/?c=o&m=sync';
|
|
8
|
+
const NO_SYNC = true;
|
|
9
|
+
|
|
10
|
+
function isBidResponseValid(bid) {
|
|
11
|
+
if (!bid.requestId || !bid.cpm || !bid.creativeId ||
|
|
12
|
+
!bid.ttl || !bid.currency) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
switch (bid.mediaType) {
|
|
16
|
+
case BANNER:
|
|
17
|
+
return Boolean(bid.width && bid.height && bid.ad);
|
|
18
|
+
case VIDEO:
|
|
19
|
+
return Boolean(bid.vastUrl);
|
|
20
|
+
case NATIVE:
|
|
21
|
+
return Boolean(bid.native && bid.native.title && bid.native.image && bid.native.impressionTrackers);
|
|
22
|
+
default:
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function getBidFloor(bid) {
|
|
28
|
+
if (!isFn(bid.getFloor)) {
|
|
29
|
+
return deepAccess(bid, 'params.bidfloor', 0);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
const bidFloor = bid.getFloor({
|
|
34
|
+
currency: 'USD',
|
|
35
|
+
mediaType: '*',
|
|
36
|
+
size: '*',
|
|
37
|
+
});
|
|
38
|
+
return bidFloor.floor;
|
|
39
|
+
} catch (_) {
|
|
40
|
+
return 0
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const spec = {
|
|
45
|
+
code: BIDDER_CODE,
|
|
46
|
+
supportedMediaTypes: [BANNER, VIDEO, NATIVE],
|
|
47
|
+
noSync: NO_SYNC,
|
|
48
|
+
|
|
49
|
+
isBidRequestValid: (bid) => {
|
|
50
|
+
return Boolean(bid.bidId && bid.params && !isNaN(parseInt(bid.params.placementId)));
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
buildRequests: (validBidRequests = [], bidderRequest) => {
|
|
54
|
+
let winTop = window;
|
|
55
|
+
let location;
|
|
56
|
+
try {
|
|
57
|
+
location = new URL(bidderRequest.refererInfo.referer)
|
|
58
|
+
winTop = window.top;
|
|
59
|
+
} catch (e) {
|
|
60
|
+
location = winTop.location;
|
|
61
|
+
logMessage(e);
|
|
62
|
+
};
|
|
63
|
+
let placements = [];
|
|
64
|
+
let request = {
|
|
65
|
+
'deviceWidth': winTop.screen.width,
|
|
66
|
+
'deviceHeight': winTop.screen.height,
|
|
67
|
+
'language': (navigator && navigator.language) ? navigator.language.split('-')[0] : '',
|
|
68
|
+
'secure': 1,
|
|
69
|
+
'host': location.host,
|
|
70
|
+
'page': location.pathname,
|
|
71
|
+
'placements': placements
|
|
72
|
+
};
|
|
73
|
+
if (bidderRequest) {
|
|
74
|
+
if (bidderRequest.uspConsent) {
|
|
75
|
+
request.ccpa = bidderRequest.uspConsent;
|
|
76
|
+
}
|
|
77
|
+
if (bidderRequest.gdprConsent) {
|
|
78
|
+
request.gdpr = bidderRequest.gdprConsent
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const len = validBidRequests.length;
|
|
82
|
+
|
|
83
|
+
for (let i = 0; i < len; i++) {
|
|
84
|
+
let bid = validBidRequests[i];
|
|
85
|
+
|
|
86
|
+
const placement = {
|
|
87
|
+
placementId: bid.params.placementId,
|
|
88
|
+
bidId: bid.bidId,
|
|
89
|
+
bidfloor: getBidFloor(bid)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (bid.mediaTypes && bid.mediaTypes[BANNER] && bid.mediaTypes[BANNER].sizes) {
|
|
93
|
+
placement.traffic = BANNER;
|
|
94
|
+
placement.sizes = bid.mediaTypes[BANNER].sizes;
|
|
95
|
+
} else if (bid.mediaTypes && bid.mediaTypes[VIDEO] && bid.mediaTypes[VIDEO].playerSize) {
|
|
96
|
+
placement.traffic = VIDEO;
|
|
97
|
+
placement.wPlayer = bid.mediaTypes[VIDEO].playerSize[0];
|
|
98
|
+
placement.hPlayer = bid.mediaTypes[VIDEO].playerSize[1];
|
|
99
|
+
placement.minduration = bid.mediaTypes[VIDEO].minduration;
|
|
100
|
+
placement.maxduration = bid.mediaTypes[VIDEO].maxduration;
|
|
101
|
+
placement.mimes = bid.mediaTypes[VIDEO].mimes;
|
|
102
|
+
placement.protocols = bid.mediaTypes[VIDEO].protocols;
|
|
103
|
+
placement.startdelay = bid.mediaTypes[VIDEO].startdelay;
|
|
104
|
+
placement.placement = bid.mediaTypes[VIDEO].placement;
|
|
105
|
+
placement.skip = bid.mediaTypes[VIDEO].skip;
|
|
106
|
+
placement.skipafter = bid.mediaTypes[VIDEO].skipafter;
|
|
107
|
+
placement.minbitrate = bid.mediaTypes[VIDEO].minbitrate;
|
|
108
|
+
placement.maxbitrate = bid.mediaTypes[VIDEO].maxbitrate;
|
|
109
|
+
placement.delivery = bid.mediaTypes[VIDEO].delivery;
|
|
110
|
+
placement.playbackmethod = bid.mediaTypes[VIDEO].playbackmethod;
|
|
111
|
+
placement.api = bid.mediaTypes[VIDEO].api;
|
|
112
|
+
placement.linearity = bid.mediaTypes[VIDEO].linearity;
|
|
113
|
+
} else if (bid.mediaTypes && bid.mediaTypes[NATIVE]) {
|
|
114
|
+
placement.traffic = NATIVE;
|
|
115
|
+
placement.native = bid.mediaTypes[NATIVE];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (bid.schain) {
|
|
119
|
+
placements.schain = bid.schain;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
placements.push(placement);
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
method: 'POST',
|
|
126
|
+
url: AD_URL,
|
|
127
|
+
data: request
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
interpretResponse: (serverResponse) => {
|
|
132
|
+
let response = [];
|
|
133
|
+
for (let i = 0; i < serverResponse.body.length; i++) {
|
|
134
|
+
let resItem = serverResponse.body[i];
|
|
135
|
+
if (isBidResponseValid(resItem)) {
|
|
136
|
+
const advertiserDomains = resItem.adomain && resItem.adomain.length ? resItem.adomain : [];
|
|
137
|
+
resItem.meta = { ...resItem.meta, advertiserDomains };
|
|
138
|
+
|
|
139
|
+
response.push(resItem);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return response;
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
getUserSyncs: (syncOptions, serverResponses) => {
|
|
146
|
+
if (NO_SYNC) {
|
|
147
|
+
return false
|
|
148
|
+
} else {
|
|
149
|
+
return [{
|
|
150
|
+
type: 'image',
|
|
151
|
+
url: URL_SYNC
|
|
152
|
+
}];
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
registerBidder(spec);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isEmpty, deepAccess, logError, parseGPTSingleSizeArrayToRtbSize, generateUUID, logWarn } from '../src/utils.js';
|
|
1
|
+
import { isEmpty, deepAccess, logError, parseGPTSingleSizeArrayToRtbSize, generateUUID, mergeDeep, logWarn } from '../src/utils.js';
|
|
2
2
|
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
3
3
|
import { Renderer } from '../src/Renderer.js';
|
|
4
4
|
import { VIDEO, BANNER } from '../src/mediaTypes.js';
|
|
@@ -173,10 +173,24 @@ export const spec = {
|
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
const ortb2UserData = config.getConfig('ortb2.user.data');
|
|
177
|
+
if (ortb2UserData && ortb2UserData.length) {
|
|
178
|
+
if (!user) {
|
|
179
|
+
user = { data: [] };
|
|
180
|
+
}
|
|
181
|
+
user = mergeDeep(user, { data: ortb2UserData });
|
|
182
|
+
}
|
|
183
|
+
|
|
176
184
|
if (gdprConsent && gdprConsent.consentString) {
|
|
177
185
|
userExt = {consent: gdprConsent.consentString};
|
|
178
186
|
}
|
|
179
187
|
|
|
188
|
+
const ortb2UserExtDevice = config.getConfig('ortb2.user.ext.device');
|
|
189
|
+
if (ortb2UserExtDevice) {
|
|
190
|
+
userExt = userExt || {};
|
|
191
|
+
userExt.device = { ...ortb2UserExtDevice };
|
|
192
|
+
}
|
|
193
|
+
|
|
180
194
|
if (userIdAsEids && userIdAsEids.length) {
|
|
181
195
|
userExt = userExt || {};
|
|
182
196
|
userExt.eids = [...userIdAsEids];
|