Skip to content

Commit

Permalink
add compactHeight and standardHeight fields in decision response
Browse files Browse the repository at this point in the history
  • Loading branch information
MishelleBit committed Sep 19, 2024
1 parent 905b3a5 commit 977baff
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion adapters/flipp/flipp.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ const (
inlineDivName = "inline"
flippBidder = "flipp"
defaultCurrency = "USD"
defaultStandardHeight int64 = 2400
defaultCompactHeight int64 = 600
)

var (
count int64 = 1
adTypes = []int64{4309, 641}
dtxTypes = []int64{5061}
defaultHeight int64
flippExtParams openrtb_ext.ImpExtFlipp
key string
)

type adapter struct {
Expand Down Expand Up @@ -230,7 +235,24 @@ func buildBid(decision *InlineModel, impId string) *openrtb2.Bid {
if decision.Contents[0].Data.Width != 0 {
bid.W = decision.Contents[0].Data.Width
}
bid.H = 0
customDataInterface := decision.Contents[0].Data.CustomData
customDataMap, ok := customDataInterface.(map[string]interface{})
if flippExtParams.Options.StartCompact {
defaultHeight = defaultCompactHeight
} else {
defaultHeight = defaultStandardHeight
}
bid.H = defaultHeight
if ok { // customDataMap exists
if flippExtParams.Options.StartCompact {
key = "compactHeight"
} else {
key = "standardHeight"
}
if height, exists := customDataMap[key].(int64); exists {
bid.H = height
}
}
}
return bid
}
Expand Down

0 comments on commit 977baff

Please sign in to comment.