Skip to content

Commit bd2e9f1

Browse files
authored
Merge branch 'patmmccann-patch-1' into master
2 parents 9c0975a + b0457ed commit bd2e9f1

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

modules/33acrossBidAdapter.js

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { BANNER, VIDEO } from '../src/mediaTypes.js';
1818
const BIDDER_CODE = '33across';
1919
const END_POINT = 'https://ssc.33across.com/api/v1/hb';
2020
const SYNC_ENDPOINT = 'https://ssc-cms.33across.com/ps/?m=xch&rt=html&ru=deb';
21+
const GVLID = 58;
2122

2223
const CURRENCY = 'USD';
2324
const GUID_PATTERN = /^[a-zA-Z0-9_-]{22}$/;
@@ -735,6 +736,7 @@ export const spec = {
735736

736737
code: BIDDER_CODE,
737738
supportedMediaTypes: [ BANNER, VIDEO ],
739+
gvlid: GVLID,
738740
isBidRequestValid,
739741
buildRequests,
740742
interpretResponse,

modules/smaatoBidAdapter.js

+39-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,45 @@ import {ADPOD, BANNER, VIDEO} from '../src/mediaTypes.js';
55

66
const BIDDER_CODE = 'smaato';
77
const SMAATO_ENDPOINT = 'https://prebid.ad.smaato.net/oapi/prebid';
8-
const SMAATO_CLIENT = 'prebid_js_$prebid.version$_1.6'
8+
const SMAATO_CLIENT = 'prebid_js_$prebid.version$_1.6';
99
const CURRENCY = 'USD';
10+
const CLIENT = 'prebid_js_$prebid.version$_1.1';
11+
const GVLID = 82;
12+
13+
/**
14+
* Transform BidRequest to OpenRTB-formatted BidRequest Object
15+
* @param {Array<BidRequest>} validBidRequests
16+
* @param {any} bidderRequest
17+
* @returns {string}
18+
*/
19+
const buildOpenRtbBidRequestPayload = (validBidRequests, bidderRequest) => {
20+
/**
21+
* Turn incoming prebid sizes into openRtb format mapping.
22+
* @param {*} sizes in format [[10, 10], [20, 20]]
23+
* @returns array of openRtb format mappings [{w: 10, h: 10}, {w: 20, h: 20}]
24+
*/
25+
const parseSizes = (sizes) => {
26+
return sizes.map((size) => {
27+
return {w: size[0], h: size[1]};
28+
})
29+
}
30+
31+
const imp = validBidRequests.map(br => {
32+
const bannerMediaType = utils.deepAccess(br, 'mediaTypes.banner');
33+
const videoMediaType = utils.deepAccess(br, 'mediaTypes.video');
34+
let result = {
35+
id: br.bidId,
36+
tagid: utils.deepAccess(br, 'params.adspaceId')
37+
}
38+
39+
if (bannerMediaType) {
40+
const sizes = parseSizes(utils.getAdUnitSizes(br));
41+
result.banner = {
42+
w: sizes[0].w,
43+
h: sizes[0].h,
44+
format: sizes
45+
}
46+
}
1047

1148
const buildOpenRtbBidRequest = (bidRequest, bidderRequest) => {
1249
const requestTemplate = {
@@ -110,6 +147,7 @@ const buildServerRequest = (validBidRequest, data) => {
110147
export const spec = {
111148
code: BIDDER_CODE,
112149
supportedMediaTypes: [BANNER, VIDEO],
150+
gvlid: GVLID,
113151

114152
/**
115153
* Determines whether or not the given bid request is valid.

0 commit comments

Comments
 (0)