Skip to content

Commit

Permalink
Accept bidfloor from impression to fix issue #1787 for sovrn adapter (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelrj authored Jun 15, 2021
1 parent a9ee429 commit 037bd7f
Show file tree
Hide file tree
Showing 5 changed files with 501 additions and 1 deletion.
5 changes: 4 additions & 1 deletion adapters/sovrn/sovrn.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ func preprocess(imp *openrtb2.Imp) (string, error) {
}

imp.TagID = getTagid(sovrnExt)
imp.BidFloor = sovrnExt.BidFloor

if imp.BidFloor == 0 && sovrnExt.BidFloor > 0 {
imp.BidFloor = sovrnExt.BidFloor
}

return imp.TagID, nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"mockBidRequest": {
"id": "test-request-id",
"imp": [
{
"id": "test-imp-id",
"banner": {
"format": [
{
"w": 300,
"h": 250
},
{
"w": 300,
"h": 600
}
]
},
"bidfloor": 1.69,
"ext": {
"bidder": {
"tagid": "123456",
"bidfloor": 4.20
}
}
}
],
"device": { },
"site": {
"domain": "www.publisher.com",
"page": "http://www.publisher.com/awesome/site"
},
"user": {
"buyeruid": "test_reader_id"
}
},

"httpCalls": [
{
"expectedRequest": {
"headers": {
"Content-Type": ["application/json"],
"Cookie": ["ljt_reader=test_reader_id"]
},
"uri": "http://sovrn.com/test/endpoint",
"body": {
"id": "test-request-id",
"imp": [
{
"id": "test-imp-id",
"banner": {
"format": [
{
"w": 300,
"h": 250
},
{
"w": 300,
"h": 600
}
]
},
"tagid": "123456",
"bidfloor": 1.69,
"ext": {
"bidder": {
"tagid": "123456",
"bidfloor": 4.20
}
}
}
],
"site": {
"domain": "www.publisher.com",
"page": "http://www.publisher.com/awesome/site"
},
"user": {
"buyeruid": "test_reader_id"
},
"device": { }
}
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-request-id",
"seatbid": [
{
"bid": [
{
"id": "a_449642_554a13d3b9f348fba707cf83f0f63800",
"impid": "test-imp-id",
"price": 3.5,
"nurl": "http://sovrn.com/rtb/impression?bannerid=138743&campaignid=3699&zoneid=449642&cb=69493397&tid=a_449642_554a13d3b9f348fba707cf83f0f63800",
"adm": "some-test-ad",
"w": 300,
"h": 250
}
]
}
]
}
}
}
],

"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "a_449642_554a13d3b9f348fba707cf83f0f63800",
"impid": "test-imp-id",
"price": 3.5,
"adm": "some-test-ad",
"nurl": "http://sovrn.com/rtb/impression?bannerid=138743&campaignid=3699&zoneid=449642&cb=69493397&tid=a_449642_554a13d3b9f348fba707cf83f0f63800",
"w": 300,
"h": 250
},
"type": "banner"
}
]
}
]
}
122 changes: 122 additions & 0 deletions adapters/sovrn/sovrntest/supplemental/no-bidfloor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"mockBidRequest": {
"id": "test-request-id",
"imp": [
{
"id": "test-imp-id",
"banner": {
"format": [
{
"w": 300,
"h": 250
},
{
"w": 300,
"h": 600
}
]
},
"ext": {
"bidder": {
"tagid": "123456"
}
}
}
],
"device": { },
"site": {
"domain": "www.publisher.com",
"page": "http://www.publisher.com/awesome/site"
},
"user": {
"buyeruid": "test_reader_id"
}
},

"httpCalls": [
{
"expectedRequest": {
"headers": {
"Content-Type": ["application/json"],
"Cookie": ["ljt_reader=test_reader_id"]
},
"uri": "http://sovrn.com/test/endpoint",
"body": {
"id": "test-request-id",
"imp": [
{
"id": "test-imp-id",
"banner": {
"format": [
{
"w": 300,
"h": 250
},
{
"w": 300,
"h": 600
}
]
},
"tagid": "123456",
"ext": {
"bidder": {
"tagid": "123456"
}
}
}
],
"site": {
"domain": "www.publisher.com",
"page": "http://www.publisher.com/awesome/site"
},
"user": {
"buyeruid": "test_reader_id"
},
"device": { }
}
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-request-id",
"seatbid": [
{
"bid": [
{
"id": "a_449642_554a13d3b9f348fba707cf83f0f63800",
"impid": "test-imp-id",
"price": 3.5,
"nurl": "http://sovrn.com/rtb/impression?bannerid=138743&campaignid=3699&zoneid=449642&cb=69493397&tid=a_449642_554a13d3b9f348fba707cf83f0f63800",
"adm": "some-test-ad",
"w": 300,
"h": 250
}
]
}
]
}
}
}
],

"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "a_449642_554a13d3b9f348fba707cf83f0f63800",
"impid": "test-imp-id",
"price": 3.5,
"adm": "some-test-ad",
"nurl": "http://sovrn.com/rtb/impression?bannerid=138743&campaignid=3699&zoneid=449642&cb=69493397&tid=a_449642_554a13d3b9f348fba707cf83f0f63800",
"w": 300,
"h": 250
},
"type": "banner"
}
]
}
]
}
125 changes: 125 additions & 0 deletions adapters/sovrn/sovrntest/supplemental/only-custom-bidfloor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"mockBidRequest": {
"id": "test-request-id",
"imp": [
{
"id": "test-imp-id",
"banner": {
"format": [
{
"w": 300,
"h": 250
},
{
"w": 300,
"h": 600
}
]
},
"ext": {
"bidder": {
"tagid": "123456",
"bidfloor": 4.20
}
}
}
],
"device": { },
"site": {
"domain": "www.publisher.com",
"page": "http://www.publisher.com/awesome/site"
},
"user": {
"buyeruid": "test_reader_id"
}
},

"httpCalls": [
{
"expectedRequest": {
"headers": {
"Content-Type": ["application/json"],
"Cookie": ["ljt_reader=test_reader_id"]
},
"uri": "http://sovrn.com/test/endpoint",
"body": {
"id": "test-request-id",
"imp": [
{
"id": "test-imp-id",
"banner": {
"format": [
{
"w": 300,
"h": 250
},
{
"w": 300,
"h": 600
}
]
},
"tagid": "123456",
"bidfloor": 4.20,
"ext": {
"bidder": {
"tagid": "123456",
"bidfloor": 4.20
}
}
}
],
"site": {
"domain": "www.publisher.com",
"page": "http://www.publisher.com/awesome/site"
},
"user": {
"buyeruid": "test_reader_id"
},
"device": { }
}
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-request-id",
"seatbid": [
{
"bid": [
{
"id": "a_449642_554a13d3b9f348fba707cf83f0f63800",
"impid": "test-imp-id",
"price": 3.5,
"nurl": "http://sovrn.com/rtb/impression?bannerid=138743&campaignid=3699&zoneid=449642&cb=69493397&tid=a_449642_554a13d3b9f348fba707cf83f0f63800",
"adm": "some-test-ad",
"w": 300,
"h": 250
}
]
}
]
}
}
}
],

"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "a_449642_554a13d3b9f348fba707cf83f0f63800",
"impid": "test-imp-id",
"price": 3.5,
"adm": "some-test-ad",
"nurl": "http://sovrn.com/rtb/impression?bannerid=138743&campaignid=3699&zoneid=449642&cb=69493397&tid=a_449642_554a13d3b9f348fba707cf83f0f63800",
"w": 300,
"h": 250
},
"type": "banner"
}
]
}
]
}
Loading

0 comments on commit 037bd7f

Please sign in to comment.