diff --git a/adapters/flipp/flipp.go b/adapters/flipp/flipp.go index 4ac5c31c763..f2456c10ff5 100644 --- a/adapters/flipp/flipp.go +++ b/adapters/flipp/flipp.go @@ -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 } @@ -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) + } } } } diff --git a/adapters/flipp/flipptest/exemplary/simple-banner-native-rich-media.json b/adapters/flipp/flipptest/exemplary/simple-banner-native-rich-media.json new file mode 100644 index 00000000000..29aea5ff7c6 --- /dev/null +++ b/adapters/flipp/flipptest/exemplary/simple-banner-native-rich-media.json @@ -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" + } + ] + } + ] +} diff --git a/static/bidder-info/flipp.yaml b/static/bidder-info/flipp.yaml index 431c1345794..01772ab41e8 100644 --- a/static/bidder-info/flipp.yaml +++ b/static/bidder-info/flipp.yaml @@ -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: