Skip to content
Open
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: 9 additions & 1 deletion adapters/flipp/flipp.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func buildBid(decision *InlineModel, impId string, flippExtParams openrtb_ext.Im
ID: fmt.Sprint(decision.AdID),
ImpID: impId,
}
if len(decision.Contents) > 0 || decision.Contents[0] != nil || decision.Contents[0].Data != nil {
if len(decision.Contents) > 0 && decision.Contents[0] != nil && decision.Contents[0].Data != nil {
if decision.Contents[0].Data.Width != 0 {
bid.W = decision.Contents[0].Data.Width
}
Expand All @@ -262,6 +262,14 @@ func buildBid(decision *InlineModel, impId string, flippExtParams openrtb_ext.Im
bid.H = int64(floatVal)
}
}

// Prefer exact dimensions when provided
if v, ok := customDataMap["maxWidth"].(float64); ok && v != 0 {
bid.W = int64(v)
}
if v, ok := customDataMap["maxHeight"].(float64); ok && v != 0 {
bid.H = int64(v)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
{
"mockBidRequest": {
"id": "test-request-id",
"test": 1,
"device": {
"ip": "123.123.123.123"
},
"site": {
"id": "1243066",
"page": "http://www.example.com/test?flipp-content-code=publisher-test"
},
"user": {
"id": "1234"
},
"imp": [
{
"id": "test-imp-id",
"tagid": "test",
"banner": {
"format": [
{
"w": 300,
"h": 1800
}
]
},
"ext": {
"bidder": {
"publisherNameIdentifier": "wishabi-test-publisher",
"creativeType": "NativeX",
"siteId": 1243066,
"zoneIds": [285431],
"options": {
"startCompact": false,
"contentCode": "publisher-test-2"
}
}
}
}

]
},
"httpCalls": [
{
"expectedRequest": {
"uri": "http://example.com/pserver",
"body": {
"ip":"123.123.123.123",
"keywords":[
""
],
"placements":[
{
"adTypes":[
4309,
641
],
"count":1,
"divName":"inline",
"prebid":{
"creativeType":"NativeX",
"height":1800,
"publisherNameIdentifier":"wishabi-test-publisher",
"requestId":"test-imp-id",
"width":300
},
"properties":{
"contentCode":"publisher-test-2"
},
"siteId":1243066,
"zoneIds":[
285431
],
"options": {
"contentCode": "publisher-test-2"
}
}
],
"url":"http://www.example.com/test?flipp-content-code=publisher-test",
"user":{
"key":"1234"
}
},
"impIDs":["test-imp-id"]
},
"mockResponse": {
"status": 200,
"body": {
"decisions": {
"inline": [
{
"adId": 183599115,
"advertiserId": 1988027,
"campaignId": 63285392,
"contents": [
{
"data": {
"customData": {
"campaignConfigUrl": "https://campaign-config.flipp.com/dist-campaign-admin/215",
"campaignNameIdentifier": "Home Hardware",
"maxWidth": 320,
"maxHeight": 480
},
"height": 1800,
"width": 300
},
"type": "raw"
}
],
"creativeId": 81325690,
"flightId": 175421795,
"height": 1800,
"prebid": {
"cpm": 12.34,
"creative":"creativeContent",
"creativeType": "NativeX",
"requestId": "test-imp-id"
},
"priorityId": 232699,
"width": 300
}
]
},
"location": {
"accuracy_radius": 5,
"city": "Toronto",
"country": "CA",
"ip": "123.123.123.124",
"postal_code": "M4S",
"region": "ON",
"region_name": "Ontario"
}
}
}
}
],
"expectedBidResponses": [
{
"bids": [
{
"bid": {
"id": "183599115",
"impid": "test-imp-id",
"price": 12.34,
"adm": "creativeContent",
"crid": "81325690",
"w": 320,
"h": 480
},
"type": "banner"
}
]
}
]
}
2 changes: 1 addition & 1 deletion static/bidder-info/flipp.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
endpoint: "https://cdn-gateflipp.flippback.com/flyer-locator-service/prebid_campaigns"
endpoint: "https://ads-flipp.com/flyer-locator-service/prebid_campaigns"
maintainer:
email: prebid@flipp.com
capabilities:
Expand Down
Loading