Skip to content

Commit 72e9e06

Browse files
mike-leijpanduro-blackbird
authored andcommitted
Flipp Bid Adapter: fix height parameter (prebid#11633)
* Flipp Bid Adapter: initial release * Added flippBidAdapter * OFF-372 Support DTX/Hero in flippBidAdapter (#2) * support creativeType * OFF-422 flippBidAdapter handle AdTypes --------- Co-authored-by: Jairo Panduro <[email protected]> * OFF-465 Add getUserKey logic to prebid.js adapter (prebid#3) * Support cookie sync and uid * address pr feedback * remove redundant check * OFF-500 Support "startCompact" param for Prebid.JS prebid#4 * set startCompact default value (prebid#5) * fix docs * use client bidding endpoint * update unit testing endpoint * OFF-876 [Prebid Adapter] Check userKey for empty string (prebid#6) * add more checks to userKey * update document * add uuid format statement * modify docs * fix network id * use compactHeight and standardHeight in customData (prebid#7) * OFF-1455 [Prebid.js] height should use the compactHeight and standardHeight fields in decisions response (prebid#8) * Flipp Bid Adapter: initial release * Added flippBidAdapter * OFF-372 Support DTX/Hero in flippBidAdapter (#2) * support creativeType * OFF-422 flippBidAdapter handle AdTypes --------- Co-authored-by: Jairo Panduro <[email protected]> * OFF-465 Add getUserKey logic to prebid.js adapter (prebid#3) * Support cookie sync and uid * address pr feedback * remove redundant check * OFF-500 Support "startCompact" param for Prebid.JS prebid#4 * set startCompact default value (prebid#5) * fix docs * use client bidding endpoint * update unit testing endpoint * OFF-876 [Prebid Adapter] Check userKey for empty string (prebid#6) * add more checks to userKey * update document * add uuid format statement * modify docs * fix network id * use compactHeight and standardHeight in customData --------- Co-authored-by: Jairo Panduro <[email protected]> * Update flippBidAdapter.js * use compactHeight and standardHeight in customData (prebid#7) * update docs * fix unit test --------- Co-authored-by: Jairo Panduro <[email protected]>
1 parent 5a12b5c commit 72e9e06

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

modules/flippBidAdapter.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const DEFAULT_CREATIVE_TYPE = 'NativeX';
2525
const VALID_CREATIVE_TYPES = ['DTX', 'NativeX'];
2626
const FLIPP_USER_KEY = 'flipp-uid';
2727
const COMPACT_DEFAULT_HEIGHT = 600;
28+
const STANDARD_DEFAULT_HEIGHT = 1800;
2829

2930
let userKey = null;
3031
export const storage = getStorageManager({bidderCode: BIDDER_CODE});
@@ -166,7 +167,10 @@ export const spec = {
166167
if (!isEmpty(res) && !isEmpty(res.decisions) && !isEmpty(res.decisions.inline)) {
167168
return res.decisions.inline.map(decision => {
168169
const placement = placements.find(p => p.prebid.requestId === decision.prebid?.requestId);
169-
const height = placement.options?.startCompact ? COMPACT_DEFAULT_HEIGHT : decision.height;
170+
const customData = decision.contents[0]?.data?.customData;
171+
const height = placement.options?.startCompact
172+
? customData?.compactHeight ?? COMPACT_DEFAULT_HEIGHT
173+
: customData?.standardHeight ?? STANDARD_DEFAULT_HEIGHT;
170174
return {
171175
bidderCode: BIDDER_CODE,
172176
requestId: decision.prebid?.requestId,

test/spec/modules/flippBidAdapter_spec.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@ describe('flippAdapter', function () {
9999
'requestId': '237f4d1a293f99',
100100
'cpm': 1.11,
101101
'creative': 'Returned from server',
102+
},
103+
'contents': {
104+
'data': {
105+
'customData': {
106+
'compactHeight': 600,
107+
'standardHeight': 1800
108+
}
109+
}
102110
}
103111
}]
104112
},
@@ -114,7 +122,7 @@ describe('flippAdapter', function () {
114122
cpm: 1.11,
115123
netRevenue: true,
116124
width: 300,
117-
height: 600,
125+
height: 1800,
118126
creativeId: 262838368,
119127
ttl: 30,
120128
ad: 'Returned from server',

0 commit comments

Comments
 (0)