Skip to content

Commit

Permalink
Flipp Bid Adapter: fix height parameter (prebid#11633)
Browse files Browse the repository at this point in the history
* 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 (#3)

* Support cookie sync and uid

* address pr feedback

* remove redundant check

* OFF-500 Support "startCompact" param for Prebid.JS #4

* set startCompact default value (#5)

* fix docs

* use client bidding endpoint

* update unit testing endpoint

* OFF-876 [Prebid Adapter] Check userKey for empty string (#6)

* add more checks to userKey

* update document

* add uuid format statement

* modify docs

* fix network id

* use compactHeight and standardHeight in customData (#7)

* OFF-1455 [Prebid.js] height should use the compactHeight and standardHeight fields in decisions response (#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 (#3)

* Support cookie sync and uid

* address pr feedback

* remove redundant check

* OFF-500 Support "startCompact" param for Prebid.JS #4

* set startCompact default value (#5)

* fix docs

* use client bidding endpoint

* update unit testing endpoint

* OFF-876 [Prebid Adapter] Check userKey for empty string (#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 (#7)

* update docs

* fix unit test

---------

Co-authored-by: Jairo Panduro <[email protected]>
  • Loading branch information
mike-lei and jpanduro-blackbird authored Jun 3, 2024
1 parent 74c8644 commit 07e6e30
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion modules/flippBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const DEFAULT_CREATIVE_TYPE = 'NativeX';
const VALID_CREATIVE_TYPES = ['DTX', 'NativeX'];
const FLIPP_USER_KEY = 'flipp-uid';
const COMPACT_DEFAULT_HEIGHT = 600;
const STANDARD_DEFAULT_HEIGHT = 1800;

let userKey = null;
export const storage = getStorageManager({bidderCode: BIDDER_CODE});
Expand Down Expand Up @@ -166,7 +167,10 @@ export const spec = {
if (!isEmpty(res) && !isEmpty(res.decisions) && !isEmpty(res.decisions.inline)) {
return res.decisions.inline.map(decision => {
const placement = placements.find(p => p.prebid.requestId === decision.prebid?.requestId);
const height = placement.options?.startCompact ? COMPACT_DEFAULT_HEIGHT : decision.height;
const customData = decision.contents[0]?.data?.customData;
const height = placement.options?.startCompact
? customData?.compactHeight ?? COMPACT_DEFAULT_HEIGHT
: customData?.standardHeight ?? STANDARD_DEFAULT_HEIGHT;
return {
bidderCode: BIDDER_CODE,
requestId: decision.prebid?.requestId,
Expand Down
10 changes: 9 additions & 1 deletion test/spec/modules/flippBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ describe('flippAdapter', function () {
'requestId': '237f4d1a293f99',
'cpm': 1.11,
'creative': 'Returned from server',
},
'contents': {
'data': {
'customData': {
'compactHeight': 600,
'standardHeight': 1800
}
}
}
}]
},
Expand All @@ -114,7 +122,7 @@ describe('flippAdapter', function () {
cpm: 1.11,
netRevenue: true,
width: 300,
height: 600,
height: 1800,
creativeId: 262838368,
ttl: 30,
ad: 'Returned from server',
Expand Down

0 comments on commit 07e6e30

Please sign in to comment.