Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversant bid floor handling #1840

Merged
merged 3 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions adapters/conversant/conversant.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,14 @@ func (c ConversantAdapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *a
func parseCnvrParams(imp *openrtb2.Imp, cnvrExt openrtb_ext.ExtImpConversant) {
imp.DisplayManager = "prebid-s2s"
imp.DisplayManagerVer = "2.0.0"
imp.BidFloor = cnvrExt.BidFloor
imp.TagID = cnvrExt.TagID

if imp.BidFloor <= 0 && cnvrExt.BidFloor > 0 {
imp.BidFloor = cnvrExt.BidFloor
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case the cnvrExt.BidFloor is zero, and imp.BidFloor is negative, imp.BidFloor will continue being negative. Do we mind this? In your context, does it make sense to default imp.BidFloor to a non-negative value?

74   func parseCnvrParams(imp *openrtb2.Imp, cnvrExt openrtb_ext.ExtImpConversant) {
75       imp.DisplayManager = "prebid-s2s"
76       imp.DisplayManagerVer = "2.0.0"
77  
78       if imp.BidFloor <= 0 && cnvrExt.BidFloor > 0 {
79           imp.BidFloor = cnvrExt.BidFloor
80       }
   +      
   +     if imp.BidFloor < 0 {
   +         // set to default value
   +         imp.BidFloor = defaultBidFloorValue
   +     }
81  
82       if len(cnvrExt.TagID) > 0 {
83           imp.TagID = cnvrExt.TagID
84       }
85  
86       // Take care not to override the global secure flag
87       if (imp.Secure == nil || *imp.Secure == 0) && cnvrExt.Secure != nil {
88           imp.Secure = cnvrExt.Secure
89       }
adapters/conversant/conversant.go

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We treat zero and negative bid floors the same so it won't make a difference.


if len(cnvrExt.TagID) > 0 {
imp.TagID = cnvrExt.TagID
}

// Take care not to override the global secure flag
if (imp.Secure == nil || *imp.Secure == 0) && cnvrExt.Secure != nil {
Expand Down
Loading