Skip to content

Commit

Permalink
DMX Bidfloor fix (#1579)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevealliance authored Nov 16, 2020
1 parent 12d96a6 commit ada88b4
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 16 deletions.
27 changes: 11 additions & 16 deletions adapters/dmx/dmx.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ func (adapter *DmxAdapter) MakeRequests(request *openrtb.BidRequest, req *adapte
Body: oJson,
Headers: headers,
}

reqsBidder = append(reqsBidder, reqBidder)
return
}
Expand Down Expand Up @@ -221,35 +222,29 @@ func (adapter *DmxAdapter) MakeBids(request *openrtb.BidRequest, externalRequest
}

func fetchParams(params dmxExt, inst openrtb.Imp, ins openrtb.Imp, imps []openrtb.Imp, banner *openrtb.Banner, video *openrtb.Video, intVal int8) []openrtb.Imp {
var tempimp openrtb.Imp
tempimp = inst
if params.Bidder.TagId != "" {
ins = openrtb.Imp{
ID: inst.ID,
TagID: params.Bidder.TagId,
Ext: inst.Ext,
Secure: &intVal,
}
tempimp.TagID = params.Bidder.TagId
tempimp.Secure = &intVal
}

if params.Bidder.DmxId != "" {
ins = openrtb.Imp{
ID: inst.ID,
TagID: params.Bidder.DmxId,
Ext: inst.Ext,
Secure: &intVal,
}
tempimp.TagID = params.Bidder.DmxId
tempimp.Secure = &intVal
}
if banner != nil {
ins.Banner = banner
tempimp.Banner = banner
}

if video != nil {
ins.Video = video
tempimp.Video = video
}

if ins.TagID == "" {
if tempimp.TagID == "" {
return imps
}
imps = append(imps, ins)
imps = append(imps, tempimp)
return imps
}

Expand Down
139 changes: 139 additions & 0 deletions adapters/dmx/dmxtest/exemplary/imp-populated-banner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
{
"mockBidRequest": {
"id": "test-request-id",
"app":{
"bundle":"302324249",
"id":"ed6207cefff74c14878963566683c070",
"name":"Skout - iOS Match Buy",
"publisher":{
"id":"10400"
},
"storeurl":"https://itunes.apple.com/app/id302324249"
},
"imp": [
{
"bidfloor": 0.35,
"id": "test-imp-id",
"banner": {
"w": 300,
"h": 250,
"format": [
{
"w": 300,
"h": 250
},
{
"w": 300,
"h": 600
}
]
},
"ext": {
"bidder": {
"dmxid": "123454",
"publisher_id": "10400"
}
}
}
]
},

"httpCalls": [
{
"expectedRequest": {
"uri": "",
"body": {
"id": "test-request-id",
"app":{
"bundle":"302324249",
"id":"ed6207cefff74c14878963566683c070",
"name":"Skout - iOS Match Buy",
"publisher":{
"id":"10400"
},
"storeurl":"https://itunes.apple.com/app/id302324249"
},
"imp": [
{
"bidfloor": 0.35,
"id": "test-imp-id",
"tagid": "123454",
"secure": 1,
"banner": {
"format": [
{
"w": 300,
"h": 250
},
{
"w": 300,
"h": 600
}
],
"w": 300,
"h": 250
},
"ext": {
"bidder": {
"publisher_id": "10400",
"dmxid": "123454"
}
}
}
]
}
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-request-id",
"seatbid": [
{
"seat": "958",
"bid": [{
"id": "7706636740145184841",
"impid": "test-imp-id",
"price": 1.75,
"adid": "29681110",
"adm": "<div>banner-ads</div>",
"adomain": ["dmx.districtm.io"],
"iurl": "https://dmx.districtm.io/b/v2",
"cid": "958",
"crid": "29681110",
"h": 250,
"w": 300
}]
}
],
"bidid": "5778926625248726496",
"cur": "USD"
}
}
}
],

"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "7706636740145184841",
"impid": "test-imp-id",
"price": 1.75,
"adm": "<div>banner-ads</div>",
"adid": "29681110",
"adomain": ["dmx.districtm.io"],
"iurl": "https://dmx.districtm.io/b/v2",
"cid": "958",
"crid": "29681110",
"w": 300,
"h": 250

},
"type": "banner"
}
]
}
]
}

0 comments on commit ada88b4

Please sign in to comment.