prebid.js 5.20.0 → 6.3.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/.babelrc.js +1 -10
- package/README.md +4 -2
- package/browsers.json +13 -37
- package/gulpfile.js +1 -8
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +23 -14
- package/karma.conf.maker.js +1 -1
- package/modules/33acrossBidAdapter.js +189 -102
- package/modules/adagioBidAdapter.js +1 -1
- package/modules/addefendBidAdapter.js +1 -0
- package/modules/adheseBidAdapter.js +7 -2
- package/modules/adkernelBidAdapter.js +1 -0
- package/modules/adlivetechBidAdapter.md +61 -0
- package/modules/admanBidAdapter.js +1 -0
- package/modules/admixerBidAdapter.js +3 -2
- package/modules/adnuntiusBidAdapter.js +5 -2
- package/modules/adomikAnalyticsAdapter.js +10 -4
- package/modules/adplusBidAdapter.js +203 -0
- package/modules/adplusBidAdapter.md +39 -0
- package/modules/adxcgBidAdapter.js +311 -359
- package/modules/adxcgBidAdapter.md +22 -21
- package/modules/adyoulikeBidAdapter.js +7 -2
- package/modules/appnexusBidAdapter.js +23 -3
- package/modules/beachfrontBidAdapter.js +14 -17
- package/modules/beopBidAdapter.js +5 -3
- package/modules/codefuelBidAdapter.js +1 -3
- package/modules/codefuelBidAdapter.md +3 -3
- package/modules/colossussspBidAdapter.js +7 -0
- package/modules/craftBidAdapter.js +5 -3
- package/modules/criteoBidAdapter.js +1 -1
- package/modules/cwireBidAdapter.js +3 -0
- package/modules/datablocksBidAdapter.js +3 -3
- package/modules/dchain.js +149 -0
- package/modules/dchain.md +45 -0
- package/modules/deepintentBidAdapter.js +1 -1
- package/modules/dspxBidAdapter.js +1 -1
- package/modules/emx_digitalBidAdapter.js +9 -1
- package/modules/engageyaBidAdapter.js +68 -54
- package/modules/freewheel-sspBidAdapter.js +6 -0
- package/modules/futureads.md +48 -0
- package/modules/glimpseBidAdapter.js +44 -16
- package/modules/goldbachBidAdapter.js +1176 -0
- package/modules/goldbachBidAdapter.md +151 -0
- package/modules/gptPreAuction.js +11 -5
- package/modules/gridBidAdapter.js +1 -1
- package/modules/gumgumBidAdapter.js +7 -3
- package/modules/id5IdSystem.md +6 -6
- package/modules/imRtdProvider.js +31 -0
- package/modules/intersectionRtdProvider.js +114 -0
- package/modules/invibesBidAdapter.js +15 -9
- package/modules/ipromBidAdapter.js +79 -0
- package/modules/ixBidAdapter.js +166 -21
- package/modules/kinessoIdSystem.js +1 -1
- package/modules/limelightDigitalBidAdapter.js +2 -1
- package/modules/lotamePanoramaIdSystem.js +80 -8
- package/modules/luponmediaBidAdapter.js +570 -0
- package/modules/mediasquareBidAdapter.js +1 -9
- package/modules/merkleIdSystem.js +5 -0
- package/modules/missenaBidAdapter.js +89 -0
- package/modules/nativoBidAdapter.js +27 -1
- package/modules/nextMillenniumBidAdapter.js +29 -1
- package/modules/oguryBidAdapter.js +2 -1
- package/modules/openxBidAdapter.js +6 -1
- package/modules/prebidServerBidAdapter/index.js +19 -15
- package/modules/pubmaticBidAdapter.js +5 -3
- package/modules/relaidoBidAdapter.js +86 -65
- package/modules/richaudienceBidAdapter.js +2 -3
- package/modules/rtdModule/index.js +48 -18
- package/modules/rubiconBidAdapter.js +10 -8
- package/modules/saambaaBidAdapter.js +420 -0
- package/modules/saambaaBidAdapter.md +65 -68
- package/modules/seedtagBidAdapter.js +6 -0
- package/modules/sharedIdSystem.js +27 -1
- package/modules/smaatoBidAdapter.js +9 -1
- package/modules/smartxBidAdapter.js +17 -1
- package/modules/sspBCBidAdapter.js +34 -3
- package/modules/tappxBidAdapter.js +3 -1
- package/modules/targetVideoBidAdapter.js +187 -0
- package/modules/targetVideoBidAdapter.md +34 -0
- package/modules/trustxBidAdapter.js +10 -1
- package/modules/undertoneBidAdapter.js +8 -1
- package/modules/userId/index.js +27 -2
- package/modules/ventes.md +71 -0
- package/modules/ventesBidAdapter.js +104 -64
- package/modules/ventesBidAdapter.md +0 -1
- package/modules/vidoomyBidAdapter.js +65 -108
- package/modules/visxBidAdapter.js +20 -3
- package/modules/visxBidAdapter.md +4 -6
- package/modules/weboramaRtdProvider.js +288 -73
- package/modules/weboramaRtdProvider.md +27 -10
- package/modules/yahoosspBidAdapter.js +5 -1
- package/modules/yahoosspBidAdapter.md +1 -1
- package/modules/yieldlabBidAdapter.js +41 -10
- package/modules/yieldlabBidAdapter.md +91 -48
- package/modules/yieldoneBidAdapter.js +115 -11
- package/modules/zetaSspBidAdapter.md +33 -1
- package/modules/zeta_global_sspBidAdapter.js +22 -1
- package/package.json +6 -1
- package/plugins/pbjsGlobals.js +28 -1
- package/src/adapterManager.js +14 -8
- package/src/auction.js +3 -2
- package/src/prebid.js +1 -2
- package/src/targeting.js +24 -3
- package/src/utils.js +41 -7
- package/test/spec/integration/faker/googletag.js +6 -0
- package/test/spec/modules/33acrossBidAdapter_spec.js +300 -78
- package/test/spec/modules/adheseBidAdapter_spec.js +27 -1
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +35 -0
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +3 -1
- package/test/spec/modules/adplusBidAdapter_spec.js +213 -0
- package/test/spec/modules/adxcgBidAdapter_spec.js +820 -571
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +26 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +63 -1
- package/test/spec/modules/beachfrontBidAdapter_spec.js +65 -1
- package/test/spec/modules/codefuelBidAdapter_spec.js +1 -1
- package/test/spec/modules/colossussspBidAdapter_spec.js +9 -0
- package/test/spec/modules/cwireBidAdapter_spec.js +10 -8
- package/test/spec/modules/datablocksBidAdapter_spec.js +3 -3
- package/test/spec/modules/dchain_spec.js +329 -0
- package/test/spec/modules/emx_digitalBidAdapter_spec.js +10 -0
- package/test/spec/modules/engageyaBidAdapter_spec.js +231 -95
- package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
- package/test/spec/modules/freewheel-sspBidAdapter_spec.js +19 -0
- package/test/spec/modules/glimpseBidAdapter_spec.js +33 -0
- package/test/spec/modules/goldbachBidAdapter_spec.js +1359 -0
- package/test/spec/modules/gptPreAuction_spec.js +58 -4
- package/test/spec/modules/gumgumBidAdapter_spec.js +6 -0
- package/test/spec/modules/imRtdProvider_spec.js +25 -0
- package/test/spec/modules/intersectionRtdProvider_spec.js +141 -0
- package/test/spec/modules/invibesBidAdapter_spec.js +29 -4
- package/test/spec/modules/ipromBidAdapter_spec.js +195 -0
- package/test/spec/modules/ixBidAdapter_spec.js +285 -2
- package/test/spec/modules/konduitWrapper_spec.js +0 -1
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +10 -7
- package/test/spec/modules/lotamePanoramaIdSystem_spec.js +227 -0
- package/test/spec/modules/luponmediaBidAdapter_spec.js +412 -0
- package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -4
- package/test/spec/modules/merkleIdSystem_spec.js +18 -0
- package/test/spec/modules/missenaBidAdapter_spec.js +134 -0
- package/test/spec/modules/nativoBidAdapter_spec.js +35 -18
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +18 -0
- package/test/spec/modules/oguryBidAdapter_spec.js +13 -11
- package/test/spec/modules/openxBidAdapter_spec.js +5 -0
- package/test/spec/modules/prebidServerBidAdapter_spec.js +62 -2
- package/test/spec/modules/pubmaticBidAdapter_spec.js +1 -1
- package/test/spec/modules/realTimeDataModule_spec.js +135 -49
- package/test/spec/modules/relaidoBidAdapter_spec.js +71 -63
- package/test/spec/modules/richaudienceBidAdapter_spec.js +2 -2
- package/test/spec/modules/rubiconBidAdapter_spec.js +17 -0
- package/test/spec/modules/seedtagBidAdapter_spec.js +3 -0
- package/test/spec/modules/sharedIdSystem_spec.js +52 -6
- package/test/spec/modules/smaatoBidAdapter_spec.js +61 -0
- package/test/spec/modules/smartxBidAdapter_spec.js +9 -0
- package/test/spec/modules/sspBCBidAdapter_spec.js +33 -3
- package/test/spec/modules/tappxBidAdapter_spec.js +4 -0
- package/test/spec/modules/targetVideoBidAdapter_spec.js +96 -0
- package/test/spec/modules/trustxBidAdapter_spec.js +42 -0
- package/test/spec/modules/userId_spec.js +51 -0
- package/test/spec/modules/vidoomyBidAdapter_spec.js +32 -13
- package/test/spec/modules/visxBidAdapter_spec.js +121 -5
- package/test/spec/modules/weboramaRtdProvider_spec.js +408 -214
- package/test/spec/modules/yahoosspBidAdapter_spec.js +28 -1
- package/test/spec/modules/yieldlabBidAdapter_spec.js +81 -0
- package/test/spec/modules/yieldoneBidAdapter_spec.js +299 -53
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +33 -1
- package/test/spec/unit/core/adapterManager_spec.js +24 -6
- package/test/spec/unit/core/targeting_spec.js +116 -0
- package/test/spec/utils_spec.js +38 -0
- package/wdio.conf.js +1 -1
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import { deepAccess, isFn, generateUUID, parseUrl, isEmpty, parseSizesInput } from '../src/utils.js';
|
|
2
|
+
import { config } from '../src/config.js';
|
|
3
|
+
import { registerBidder } from '../src/adapters/bidderFactory.js';
|
|
4
|
+
import { VIDEO, BANNER } from '../src/mediaTypes.js';
|
|
5
|
+
import find from 'core-js-pure/features/array/find.js';
|
|
6
|
+
import includes from 'core-js-pure/features/array/includes.js';
|
|
7
|
+
|
|
8
|
+
const ADAPTER_VERSION = '1.0';
|
|
9
|
+
const BIDDER_CODE = 'saambaa';
|
|
10
|
+
|
|
11
|
+
export const VIDEO_ENDPOINT = 'https://nep.advangelists.com/xp/get?pubid=';
|
|
12
|
+
export const BANNER_ENDPOINT = 'https://nep.advangelists.com/xp/get?pubid=';
|
|
13
|
+
export const OUTSTREAM_SRC = 'https://player-cdn.beachfrontmedia.com/playerapi/loader/outstream.js';
|
|
14
|
+
export const VIDEO_TARGETING = ['mimes', 'playbackmethod', 'maxduration', 'skip', 'playerSize', 'context'];
|
|
15
|
+
export const DEFAULT_MIMES = ['video/mp4', 'application/javascript'];
|
|
16
|
+
|
|
17
|
+
let pubid = '';
|
|
18
|
+
|
|
19
|
+
export const spec = {
|
|
20
|
+
code: BIDDER_CODE,
|
|
21
|
+
supportedMediaTypes: [BANNER, VIDEO],
|
|
22
|
+
|
|
23
|
+
isBidRequestValid(bidRequest) {
|
|
24
|
+
if (typeof bidRequest != 'undefined') {
|
|
25
|
+
if (bidRequest.bidder !== BIDDER_CODE && typeof bidRequest.params === 'undefined') { return false; }
|
|
26
|
+
if (bidRequest === '' || bidRequest.params.placement === '' || bidRequest.params.pubid === '') { return false; }
|
|
27
|
+
return true;
|
|
28
|
+
} else { return false; }
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
buildRequests(bids, bidderRequest) {
|
|
32
|
+
let requests = [];
|
|
33
|
+
let videoBids = bids.filter(bid => isVideoBidValid(bid));
|
|
34
|
+
let bannerBids = bids.filter(bid => isBannerBidValid(bid));
|
|
35
|
+
videoBids.forEach(bid => {
|
|
36
|
+
pubid = getVideoBidParam(bid, 'pubid');
|
|
37
|
+
requests.push({
|
|
38
|
+
method: 'POST',
|
|
39
|
+
url: VIDEO_ENDPOINT + pubid,
|
|
40
|
+
data: createVideoRequestData(bid, bidderRequest),
|
|
41
|
+
bidRequest: bid
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
bannerBids.forEach(bid => {
|
|
46
|
+
pubid = getBannerBidParam(bid, 'pubid');
|
|
47
|
+
|
|
48
|
+
requests.push({
|
|
49
|
+
method: 'POST',
|
|
50
|
+
url: BANNER_ENDPOINT + pubid,
|
|
51
|
+
data: createBannerRequestData(bid, bidderRequest),
|
|
52
|
+
bidRequest: bid
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
return requests;
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
interpretResponse(serverResponse, {bidRequest}) {
|
|
59
|
+
let response = serverResponse.body;
|
|
60
|
+
if (response !== null && isEmpty(response) == false) {
|
|
61
|
+
if (isVideoBid(bidRequest)) {
|
|
62
|
+
let bidResponse = {
|
|
63
|
+
requestId: response.id,
|
|
64
|
+
bidderCode: BIDDER_CODE,
|
|
65
|
+
cpm: response.seatbid[0].bid[0].price,
|
|
66
|
+
width: response.seatbid[0].bid[0].w,
|
|
67
|
+
height: response.seatbid[0].bid[0].h,
|
|
68
|
+
ttl: response.seatbid[0].bid[0].ttl || 60,
|
|
69
|
+
creativeId: response.seatbid[0].bid[0].crid,
|
|
70
|
+
currency: response.cur,
|
|
71
|
+
meta: { 'advertiserDomains': response.seatbid[0].bid[0].adomain },
|
|
72
|
+
mediaType: VIDEO,
|
|
73
|
+
netRevenue: true
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (response.seatbid[0].bid[0].adm) {
|
|
77
|
+
bidResponse.vastXml = response.seatbid[0].bid[0].adm;
|
|
78
|
+
bidResponse.adResponse = {
|
|
79
|
+
content: response.seatbid[0].bid[0].adm
|
|
80
|
+
};
|
|
81
|
+
} else {
|
|
82
|
+
bidResponse.vastUrl = response.seatbid[0].bid[0].nurl;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return bidResponse;
|
|
86
|
+
} else {
|
|
87
|
+
return {
|
|
88
|
+
requestId: response.id,
|
|
89
|
+
bidderCode: BIDDER_CODE,
|
|
90
|
+
cpm: response.seatbid[0].bid[0].price,
|
|
91
|
+
width: response.seatbid[0].bid[0].w,
|
|
92
|
+
height: response.seatbid[0].bid[0].h,
|
|
93
|
+
ad: response.seatbid[0].bid[0].adm,
|
|
94
|
+
ttl: response.seatbid[0].bid[0].ttl || 60,
|
|
95
|
+
creativeId: response.seatbid[0].bid[0].crid,
|
|
96
|
+
currency: response.cur,
|
|
97
|
+
meta: { 'advertiserDomains': response.seatbid[0].bid[0].adomain },
|
|
98
|
+
mediaType: BANNER,
|
|
99
|
+
netRevenue: true
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
function isBannerBid(bid) {
|
|
107
|
+
return deepAccess(bid, 'mediaTypes.banner') || !isVideoBid(bid);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function isVideoBid(bid) {
|
|
111
|
+
return deepAccess(bid, 'mediaTypes.video');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function getBannerBidFloor(bid) {
|
|
115
|
+
let floorInfo = isFn(bid.getFloor) ? bid.getFloor({ currency: 'USD', mediaType: 'banner', size: '*' }) : {};
|
|
116
|
+
return floorInfo.floor || getBannerBidParam(bid, 'bidfloor');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function getVideoBidFloor(bid) {
|
|
120
|
+
let floorInfo = isFn(bid.getFloor) ? bid.getFloor({ currency: 'USD', mediaType: 'video', size: '*' }) : {};
|
|
121
|
+
return floorInfo.floor || getVideoBidParam(bid, 'bidfloor');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function isVideoBidValid(bid) {
|
|
125
|
+
return isVideoBid(bid) && getVideoBidParam(bid, 'pubid') && getVideoBidParam(bid, 'placement');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function isBannerBidValid(bid) {
|
|
129
|
+
return isBannerBid(bid) && getBannerBidParam(bid, 'pubid') && getBannerBidParam(bid, 'placement');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function getVideoBidParam(bid, key) {
|
|
133
|
+
return deepAccess(bid, 'params.video.' + key) || deepAccess(bid, 'params.' + key);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function getBannerBidParam(bid, key) {
|
|
137
|
+
return deepAccess(bid, 'params.banner.' + key) || deepAccess(bid, 'params.' + key);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function isMobile() {
|
|
141
|
+
return (/(ios|ipod|ipad|iphone|android)/i).test(navigator.userAgent);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function isConnectedTV() {
|
|
145
|
+
return (/(smart[-]?tv|hbbtv|appletv|googletv|hdmi|netcast\.tv|viera|nettv|roku|\bdtv\b|sonydtv|inettvbrowser|\btv\b)/i).test(navigator.userAgent);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function getDoNotTrack() {
|
|
149
|
+
return navigator.doNotTrack === '1' || window.doNotTrack === '1' || navigator.msDoNoTrack === '1' || navigator.doNotTrack === 'yes';
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function findAndFillParam(o, key, value) {
|
|
153
|
+
try {
|
|
154
|
+
if (typeof value === 'function') {
|
|
155
|
+
o[key] = value();
|
|
156
|
+
} else {
|
|
157
|
+
o[key] = value;
|
|
158
|
+
}
|
|
159
|
+
} catch (ex) {}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function getOsVersion() {
|
|
163
|
+
let clientStrings = [
|
|
164
|
+
{ s: 'Android', r: /Android/ },
|
|
165
|
+
{ s: 'iOS', r: /(iPhone|iPad|iPod)/ },
|
|
166
|
+
{ s: 'Mac OS X', r: /Mac OS X/ },
|
|
167
|
+
{ s: 'Mac OS', r: /(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/ },
|
|
168
|
+
{ s: 'Linux', r: /(Linux|X11)/ },
|
|
169
|
+
{ s: 'Windows 10', r: /(Windows 10.0|Windows NT 10.0)/ },
|
|
170
|
+
{ s: 'Windows 8.1', r: /(Windows 8.1|Windows NT 6.3)/ },
|
|
171
|
+
{ s: 'Windows 8', r: /(Windows 8|Windows NT 6.2)/ },
|
|
172
|
+
{ s: 'Windows 7', r: /(Windows 7|Windows NT 6.1)/ },
|
|
173
|
+
{ s: 'Windows Vista', r: /Windows NT 6.0/ },
|
|
174
|
+
{ s: 'Windows Server 2003', r: /Windows NT 5.2/ },
|
|
175
|
+
{ s: 'Windows XP', r: /(Windows NT 5.1|Windows XP)/ },
|
|
176
|
+
{ s: 'UNIX', r: /UNIX/ },
|
|
177
|
+
{ s: 'Search Bot', r: /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/ }
|
|
178
|
+
];
|
|
179
|
+
let cs = find(clientStrings, cs => cs.r.test(navigator.userAgent));
|
|
180
|
+
return cs ? cs.s : 'unknown';
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function getFirstSize(sizes) {
|
|
184
|
+
return (sizes && sizes.length) ? sizes[0] : { w: undefined, h: undefined };
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function parseSizes(sizes) {
|
|
188
|
+
return parseSizesInput(sizes).map(size => {
|
|
189
|
+
let [ width, height ] = size.split('x');
|
|
190
|
+
return {
|
|
191
|
+
w: parseInt(width, 10) || undefined,
|
|
192
|
+
h: parseInt(height, 10) || undefined
|
|
193
|
+
};
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function getVideoSizes(bid) {
|
|
198
|
+
return parseSizes(deepAccess(bid, 'mediaTypes.video.playerSize') || bid.sizes);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function getBannerSizes(bid) {
|
|
202
|
+
return parseSizes(deepAccess(bid, 'mediaTypes.banner.sizes') || bid.sizes);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function getTopWindowReferrer() {
|
|
206
|
+
try {
|
|
207
|
+
return window.top.document.referrer;
|
|
208
|
+
} catch (e) {
|
|
209
|
+
return '';
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function getVideoTargetingParams(bid) {
|
|
214
|
+
const result = {};
|
|
215
|
+
const excludeProps = ['playerSize', 'context', 'w', 'h'];
|
|
216
|
+
Object.keys(Object(bid.mediaTypes.video))
|
|
217
|
+
.filter(key => !includes(excludeProps, key))
|
|
218
|
+
.forEach(key => {
|
|
219
|
+
result[ key ] = bid.mediaTypes.video[ key ];
|
|
220
|
+
});
|
|
221
|
+
Object.keys(Object(bid.params.video))
|
|
222
|
+
.filter(key => includes(VIDEO_TARGETING, key))
|
|
223
|
+
.forEach(key => {
|
|
224
|
+
result[ key ] = bid.params.video[ key ];
|
|
225
|
+
});
|
|
226
|
+
return result;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function createVideoRequestData(bid, bidderRequest) {
|
|
230
|
+
let topLocation = getTopWindowLocation(bidderRequest);
|
|
231
|
+
let topReferrer = getTopWindowReferrer();
|
|
232
|
+
|
|
233
|
+
// if size is explicitly given via adapter params
|
|
234
|
+
let paramSize = getVideoBidParam(bid, 'size');
|
|
235
|
+
let sizes = [];
|
|
236
|
+
let coppa = config.getConfig('coppa');
|
|
237
|
+
|
|
238
|
+
if (typeof paramSize !== 'undefined' && paramSize != '') {
|
|
239
|
+
sizes = parseSizes(paramSize);
|
|
240
|
+
} else {
|
|
241
|
+
sizes = getVideoSizes(bid);
|
|
242
|
+
}
|
|
243
|
+
const firstSize = getFirstSize(sizes);
|
|
244
|
+
let floor = (getVideoBidFloor(bid) == null || typeof getVideoBidFloor(bid) == 'undefined') ? 0.5 : getVideoBidFloor(bid);
|
|
245
|
+
let video = getVideoTargetingParams(bid);
|
|
246
|
+
const o = {
|
|
247
|
+
'device': {
|
|
248
|
+
'langauge': (global.navigator.language).split('-')[0],
|
|
249
|
+
'dnt': (global.navigator.doNotTrack === 1 ? 1 : 0),
|
|
250
|
+
'devicetype': isMobile() ? 4 : isConnectedTV() ? 3 : 2,
|
|
251
|
+
'js': 1,
|
|
252
|
+
'os': getOsVersion()
|
|
253
|
+
},
|
|
254
|
+
'at': 2,
|
|
255
|
+
'site': {},
|
|
256
|
+
'tmax': 3000,
|
|
257
|
+
'cur': ['USD'],
|
|
258
|
+
'id': bid.bidId,
|
|
259
|
+
'imp': [],
|
|
260
|
+
'regs': {
|
|
261
|
+
'ext': {
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
'user': {
|
|
265
|
+
'ext': {
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
o.site['page'] = topLocation.href;
|
|
271
|
+
o.site['domain'] = topLocation.hostname;
|
|
272
|
+
o.site['search'] = topLocation.search;
|
|
273
|
+
o.site['domain'] = topLocation.hostname;
|
|
274
|
+
o.site['ref'] = topReferrer;
|
|
275
|
+
o.site['mobile'] = isMobile() ? 1 : 0;
|
|
276
|
+
const secure = topLocation.protocol.indexOf('https') === 0 ? 1 : 0;
|
|
277
|
+
|
|
278
|
+
o.device['dnt'] = getDoNotTrack() ? 1 : 0;
|
|
279
|
+
|
|
280
|
+
findAndFillParam(o.site, 'name', function() {
|
|
281
|
+
return global.top.document.title;
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
findAndFillParam(o.device, 'h', function() {
|
|
285
|
+
return global.screen.height;
|
|
286
|
+
});
|
|
287
|
+
findAndFillParam(o.device, 'w', function() {
|
|
288
|
+
return global.screen.width;
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
let placement = getVideoBidParam(bid, 'placement');
|
|
292
|
+
|
|
293
|
+
for (let j = 0; j < sizes.length; j++) {
|
|
294
|
+
o.imp.push({
|
|
295
|
+
'id': '' + j,
|
|
296
|
+
'displaymanager': '' + BIDDER_CODE,
|
|
297
|
+
'displaymanagerver': '' + ADAPTER_VERSION,
|
|
298
|
+
'tagId': placement,
|
|
299
|
+
'bidfloor': floor,
|
|
300
|
+
'bidfloorcur': 'USD',
|
|
301
|
+
'secure': secure,
|
|
302
|
+
'video': Object.assign({
|
|
303
|
+
'id': generateUUID(),
|
|
304
|
+
'pos': 0,
|
|
305
|
+
'w': firstSize.w,
|
|
306
|
+
'h': firstSize.h,
|
|
307
|
+
'mimes': DEFAULT_MIMES
|
|
308
|
+
}, video)
|
|
309
|
+
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
if (coppa) {
|
|
313
|
+
o.regs.ext = {'coppa': 1};
|
|
314
|
+
}
|
|
315
|
+
if (bidderRequest && bidderRequest.gdprConsent) {
|
|
316
|
+
let { gdprApplies, consentString } = bidderRequest.gdprConsent;
|
|
317
|
+
o.regs.ext = {'gdpr': gdprApplies ? 1 : 0};
|
|
318
|
+
o.user.ext = {'consent': consentString};
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
return o;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function getTopWindowLocation(bidderRequest) {
|
|
325
|
+
let url = bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.referer;
|
|
326
|
+
return parseUrl(config.getConfig('pageUrl') || url, { decodeSearchAsString: true });
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function createBannerRequestData(bid, bidderRequest) {
|
|
330
|
+
let topLocation = getTopWindowLocation(bidderRequest);
|
|
331
|
+
let topReferrer = getTopWindowReferrer();
|
|
332
|
+
|
|
333
|
+
// if size is explicitly given via adapter params
|
|
334
|
+
|
|
335
|
+
let paramSize = getBannerBidParam(bid, 'size');
|
|
336
|
+
let sizes = [];
|
|
337
|
+
let coppa = config.getConfig('coppa');
|
|
338
|
+
if (typeof paramSize !== 'undefined' && paramSize != '') {
|
|
339
|
+
sizes = parseSizes(paramSize);
|
|
340
|
+
} else {
|
|
341
|
+
sizes = getBannerSizes(bid);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
let floor = (getBannerBidFloor(bid) == null || typeof getBannerBidFloor(bid) == 'undefined') ? 0.1 : getBannerBidFloor(bid);
|
|
345
|
+
const o = {
|
|
346
|
+
'device': {
|
|
347
|
+
'langauge': (global.navigator.language).split('-')[0],
|
|
348
|
+
'dnt': (global.navigator.doNotTrack === 1 ? 1 : 0),
|
|
349
|
+
'devicetype': isMobile() ? 4 : isConnectedTV() ? 3 : 2,
|
|
350
|
+
'js': 1
|
|
351
|
+
},
|
|
352
|
+
'at': 2,
|
|
353
|
+
'site': {},
|
|
354
|
+
'tmax': 3000,
|
|
355
|
+
'cur': ['USD'],
|
|
356
|
+
'id': bid.bidId,
|
|
357
|
+
'imp': [],
|
|
358
|
+
'regs': {
|
|
359
|
+
'ext': {
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
'user': {
|
|
363
|
+
'ext': {
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
o.site['page'] = topLocation.href;
|
|
369
|
+
o.site['domain'] = topLocation.hostname;
|
|
370
|
+
o.site['search'] = topLocation.search;
|
|
371
|
+
o.site['domain'] = topLocation.hostname;
|
|
372
|
+
o.site['ref'] = topReferrer;
|
|
373
|
+
o.site['mobile'] = isMobile() ? 1 : 0;
|
|
374
|
+
const secure = topLocation.protocol.indexOf('https') === 0 ? 1 : 0;
|
|
375
|
+
|
|
376
|
+
o.device['dnt'] = getDoNotTrack() ? 1 : 0;
|
|
377
|
+
|
|
378
|
+
findAndFillParam(o.site, 'name', function() {
|
|
379
|
+
return global.top.document.title;
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
findAndFillParam(o.device, 'h', function() {
|
|
383
|
+
return global.screen.height;
|
|
384
|
+
});
|
|
385
|
+
findAndFillParam(o.device, 'w', function() {
|
|
386
|
+
return global.screen.width;
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
let placement = getBannerBidParam(bid, 'placement');
|
|
390
|
+
for (let j = 0; j < sizes.length; j++) {
|
|
391
|
+
let size = sizes[j];
|
|
392
|
+
|
|
393
|
+
o.imp.push({
|
|
394
|
+
'id': '' + j,
|
|
395
|
+
'displaymanager': '' + BIDDER_CODE,
|
|
396
|
+
'displaymanagerver': '' + ADAPTER_VERSION,
|
|
397
|
+
'tagId': placement,
|
|
398
|
+
'bidfloor': floor,
|
|
399
|
+
'bidfloorcur': 'USD',
|
|
400
|
+
'secure': secure,
|
|
401
|
+
'banner': {
|
|
402
|
+
'id': generateUUID(),
|
|
403
|
+
'pos': 0,
|
|
404
|
+
'w': size['w'],
|
|
405
|
+
'h': size['h']
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
if (coppa) {
|
|
410
|
+
o.regs.ext = {'coppa': 1};
|
|
411
|
+
}
|
|
412
|
+
if (bidderRequest && bidderRequest.gdprConsent) {
|
|
413
|
+
let { gdprApplies, consentString } = bidderRequest.gdprConsent;
|
|
414
|
+
o.regs.ext = {'gdpr': gdprApplies ? 1 : 0};
|
|
415
|
+
o.user.ext = {'consent': consentString};
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
return o;
|
|
419
|
+
}
|
|
420
|
+
registerBidder(spec);
|
|
@@ -1,69 +1,66 @@
|
|
|
1
|
-
# Overview
|
|
2
|
-
|
|
3
|
-
```
|
|
4
|
-
Module Name: Saambaa Bidder Adapter
|
|
5
|
-
Module Type: Bidder Adapter
|
|
6
|
-
Maintainer: matt.voigt@saambaa.com
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
# Description
|
|
10
|
-
|
|
11
|
-
Connects to Saambaa exchange for bids.
|
|
12
|
-
|
|
13
|
-
Saambaa bid adapter supports Banner and Video ads currently.
|
|
14
|
-
|
|
15
|
-
For more informatio
|
|
16
|
-
|
|
17
|
-
# Sample Display Ad Unit: For Publishers
|
|
18
|
-
```javascript
|
|
19
|
-
|
|
20
|
-
var displayAdUnit = [
|
|
21
|
-
{
|
|
22
|
-
code: 'display',
|
|
23
|
-
mediaTypes: {
|
|
24
|
-
banner: {
|
|
25
|
-
sizes: [[300, 250],[320, 50]]
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
bids: [{
|
|
29
|
-
bidder: 'saambaa',
|
|
30
|
-
params: {
|
|
31
|
-
pubid: '121ab139faf7ac67428a23f1d0a9a71b',
|
|
32
|
-
placement: 1234,
|
|
33
|
-
size: '320x50'
|
|
34
|
-
}
|
|
35
|
-
}]
|
|
36
|
-
}];
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
# Sample Video Ad Unit: For Publishers
|
|
40
|
-
```javascript
|
|
41
|
-
|
|
42
|
-
var videoAdUnit = {
|
|
43
|
-
code: 'video',
|
|
44
|
-
sizes: [320,480],
|
|
45
|
-
mediaTypes: {
|
|
46
|
-
video: {
|
|
47
|
-
playerSize : [[320, 480]],
|
|
48
|
-
context: 'instream'
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
};
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
Module Name: Saambaa Bidder Adapter
|
|
5
|
+
Module Type: Bidder Adapter
|
|
6
|
+
Maintainer: matt.voigt@saambaa.com
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
# Description
|
|
10
|
+
|
|
11
|
+
Connects to Saambaa exchange for bids.
|
|
12
|
+
|
|
13
|
+
Saambaa bid adapter supports Banner and Video ads currently.
|
|
14
|
+
|
|
15
|
+
For more informatio
|
|
16
|
+
|
|
17
|
+
# Sample Display Ad Unit: For Publishers
|
|
18
|
+
```javascript
|
|
19
|
+
|
|
20
|
+
var displayAdUnit = [
|
|
21
|
+
{
|
|
22
|
+
code: 'display',
|
|
23
|
+
mediaTypes: {
|
|
24
|
+
banner: {
|
|
25
|
+
sizes: [[300, 250],[320, 50]]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
bids: [{
|
|
29
|
+
bidder: 'saambaa',
|
|
30
|
+
params: {
|
|
31
|
+
pubid: '121ab139faf7ac67428a23f1d0a9a71b',
|
|
32
|
+
placement: 1234,
|
|
33
|
+
size: '320x50'
|
|
34
|
+
}
|
|
35
|
+
}]
|
|
36
|
+
}];
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
# Sample Video Ad Unit: For Publishers
|
|
40
|
+
```javascript
|
|
41
|
+
|
|
42
|
+
var videoAdUnit = {
|
|
43
|
+
code: 'video',
|
|
44
|
+
sizes: [320,480],
|
|
45
|
+
mediaTypes: {
|
|
46
|
+
video: {
|
|
47
|
+
playerSize : [[320, 480]],
|
|
48
|
+
context: 'instream',
|
|
49
|
+
skip: 1,
|
|
50
|
+
mimes : ['video/mp4', 'application/javascript'],
|
|
51
|
+
playbackmethod : [2,6],
|
|
52
|
+
maxduration: 30
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
bids: [
|
|
56
|
+
{
|
|
57
|
+
bidder: 'saambaa',
|
|
58
|
+
params: {
|
|
59
|
+
pubid: '121ab139faf7ac67428a23f1d0a9a71b',
|
|
60
|
+
placement: 1234,
|
|
61
|
+
size: "320x480"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
};
|
|
69
66
|
```
|
|
@@ -13,6 +13,11 @@ const ALLOWED_PLACEMENTS = {
|
|
|
13
13
|
banner: true,
|
|
14
14
|
video: true
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
// Global Vendor List Id
|
|
18
|
+
// https://iabeurope.eu/vendor-list-tcf-v2-0/
|
|
19
|
+
const GVLID = 157;
|
|
20
|
+
|
|
16
21
|
const mediaTypesMap = {
|
|
17
22
|
[BANNER]: 'display',
|
|
18
23
|
[VIDEO]: 'video'
|
|
@@ -158,6 +163,7 @@ export function getTimeoutUrl (data) {
|
|
|
158
163
|
|
|
159
164
|
export const spec = {
|
|
160
165
|
code: BIDDER_CODE,
|
|
166
|
+
gvlid: GVLID,
|
|
161
167
|
aliases: [SEEDTAG_ALIAS],
|
|
162
168
|
supportedMediaTypes: [BANNER, VIDEO],
|
|
163
169
|
/**
|
|
@@ -11,7 +11,7 @@ import { coppaDataHandler } from '../src/adapterManager.js';
|
|
|
11
11
|
import {getStorageManager} from '../src/storageManager.js';
|
|
12
12
|
|
|
13
13
|
const GVLID = 887;
|
|
14
|
-
const storage = getStorageManager(GVLID, 'pubCommonId');
|
|
14
|
+
export const storage = getStorageManager(GVLID, 'pubCommonId');
|
|
15
15
|
const COOKIE = 'cookie';
|
|
16
16
|
const LOCAL_STORAGE = 'html5';
|
|
17
17
|
const OPTOUT_NAME = '_pubcid_optout';
|
|
@@ -171,7 +171,33 @@ export const sharedIdSystemSubmodule = {
|
|
|
171
171
|
return {id: storedId};
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
domainOverride: function () {
|
|
177
|
+
const domainElements = document.domain.split('.');
|
|
178
|
+
const cookieName = `_gd${Date.now()}`;
|
|
179
|
+
for (let i = 0, topDomain, testCookie; i < domainElements.length; i++) {
|
|
180
|
+
const nextDomain = domainElements.slice(i).join('.');
|
|
181
|
+
|
|
182
|
+
// write test cookie
|
|
183
|
+
storage.setCookie(cookieName, '1', undefined, undefined, nextDomain);
|
|
184
|
+
|
|
185
|
+
// read test cookie to verify domain was valid
|
|
186
|
+
testCookie = storage.getCookie(cookieName);
|
|
187
|
+
|
|
188
|
+
// delete test cookie
|
|
189
|
+
storage.setCookie(cookieName, '', 'Thu, 01 Jan 1970 00:00:01 GMT', undefined, nextDomain);
|
|
190
|
+
|
|
191
|
+
if (testCookie === '1') {
|
|
192
|
+
// cookie was written successfully using test domain so the topDomain is updated
|
|
193
|
+
topDomain = nextDomain;
|
|
194
|
+
} else {
|
|
195
|
+
// cookie failed to write using test domain so exit by returning the topDomain
|
|
196
|
+
return topDomain;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
174
199
|
}
|
|
200
|
+
|
|
175
201
|
};
|
|
176
202
|
|
|
177
203
|
submodule('userId', sharedIdSystemSubmodule);
|
|
@@ -5,7 +5,7 @@ import {ADPOD, BANNER, VIDEO} from '../src/mediaTypes.js';
|
|
|
5
5
|
|
|
6
6
|
const BIDDER_CODE = 'smaato';
|
|
7
7
|
const SMAATO_ENDPOINT = 'https://prebid.ad.smaato.net/oapi/prebid';
|
|
8
|
-
const SMAATO_CLIENT = 'prebid_js_$prebid.version$_1.
|
|
8
|
+
const SMAATO_CLIENT = 'prebid_js_$prebid.version$_1.6'
|
|
9
9
|
const CURRENCY = 'USD';
|
|
10
10
|
|
|
11
11
|
const buildOpenRtbBidRequest = (bidRequest, bidderRequest) => {
|
|
@@ -37,6 +37,11 @@ const buildOpenRtbBidRequest = (bidRequest, bidderRequest) => {
|
|
|
37
37
|
user: {
|
|
38
38
|
ext: {}
|
|
39
39
|
},
|
|
40
|
+
source: {
|
|
41
|
+
ext: {
|
|
42
|
+
schain: bidRequest.schain
|
|
43
|
+
}
|
|
44
|
+
},
|
|
40
45
|
ext: {
|
|
41
46
|
client: SMAATO_CLIENT
|
|
42
47
|
}
|
|
@@ -299,6 +304,7 @@ function createBannerImp(bidRequest) {
|
|
|
299
304
|
id: bidRequest.bidId,
|
|
300
305
|
tagid: deepAccess(bidRequest, 'params.adspaceId'),
|
|
301
306
|
bidfloor: getBidFloor(bidRequest, BANNER, adUnitSizes),
|
|
307
|
+
instl: deepAccess(bidRequest.ortb2Imp, 'instl'),
|
|
302
308
|
banner: {
|
|
303
309
|
w: sizes[0].w,
|
|
304
310
|
h: sizes[0].h,
|
|
@@ -314,6 +320,7 @@ function createVideoImp(bidRequest, videoMediaType) {
|
|
|
314
320
|
id: bidRequest.bidId,
|
|
315
321
|
tagid: deepAccess(bidRequest, 'params.adspaceId'),
|
|
316
322
|
bidfloor: getBidFloor(bidRequest, VIDEO, videoMediaType.playerSize),
|
|
323
|
+
instl: deepAccess(bidRequest.ortb2Imp, 'instl'),
|
|
317
324
|
video: {
|
|
318
325
|
mimes: videoMediaType.mimes,
|
|
319
326
|
minduration: videoMediaType.minduration,
|
|
@@ -341,6 +348,7 @@ function createAdPodImp(bidRequest, videoMediaType) {
|
|
|
341
348
|
id: bidRequest.bidId,
|
|
342
349
|
tagid: tagid,
|
|
343
350
|
bidfloor: getBidFloor(bidRequest, VIDEO, videoMediaType.playerSize),
|
|
351
|
+
instl: deepAccess(bidRequest.ortb2Imp, 'instl'),
|
|
344
352
|
video: {
|
|
345
353
|
w: videoMediaType.playerSize[0][0],
|
|
346
354
|
h: videoMediaType.playerSize[0][1],
|