diff --git a/adapters/yieldmo/yieldmo.go b/adapters/yieldmo/yieldmo.go index ffb2e40b649..d328d82a5fb 100644 --- a/adapters/yieldmo/yieldmo.go +++ b/adapters/yieldmo/yieldmo.go @@ -123,7 +123,7 @@ func (a *YieldmoAdapter) MakeBids(internalRequest *openrtb.BidRequest, externalR for i := range sb.Bid { bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{ Bid: &sb.Bid[i], - BidType: "banner", + BidType: getMediaTypeForImp(sb.Bid[i].ImpID, internalRequest.Imp), }) } } @@ -136,3 +136,13 @@ func NewYieldmoBidder(endpoint string) *YieldmoAdapter { endpoint: endpoint, } } + +func getMediaTypeForImp(impId string, imps []openrtb.Imp) openrtb_ext.BidType { + //default to video unless banner exists in impression + for _, imp := range imps { + if imp.ID == impId && imp.Banner != nil { + return openrtb_ext.BidTypeBanner + } + } + return openrtb_ext.BidTypeVideo +} diff --git a/adapters/yieldmo/yieldmotest/exemplary/app-banner.json b/adapters/yieldmo/yieldmotest/exemplary/app-banner.json new file mode 100644 index 00000000000..e674cf11539 --- /dev/null +++ b/adapters/yieldmo/yieldmotest/exemplary/app-banner.json @@ -0,0 +1,97 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "ext": { + "bidder": { + "placementId": "123" + } + } + } + ], + "app": { + "id": "fake-app-id" + } + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://ads.yieldmo.com/openrtb2", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "ext": { + "placement_id": "123" + } + } + ], + "app": { + "id": "fake-app-id" + } + } + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "seat": "yieldmo", + "bid": [ + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id", + "price": 0.500000, + "adm": "some-test-ad", + "crid": "crid_10", + "h": 250, + "w": 300 + } + ] + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "currency": "EUR", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id", + "price": 0.5, + "adm": "some-test-ad", + "crid": "crid_10", + "w": 300, + "h": 250 + }, + "type": "banner" + } + ] + } + ] +} diff --git a/adapters/yieldmo/yieldmotest/exemplary/app_video.json b/adapters/yieldmo/yieldmotest/exemplary/app_video.json new file mode 100644 index 00000000000..e33c37f69bf --- /dev/null +++ b/adapters/yieldmo/yieldmotest/exemplary/app_video.json @@ -0,0 +1,95 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "video": { + "w": 300, + "h": 250, + "startdelay": 0, + "protocols": [2], + "mimes": ["video/mp4", "application/javascript"] + }, + "ext": { + "bidder": { + "placementId": "123" + } + } + } + ], + "app": { + "id": "fake-app-id" + } + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://ads.yieldmo.com/openrtb2", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "video": { + "w": 300, + "h": 250, + "startdelay": 0, + "protocols": [2], + "mimes": ["video/mp4", "application/javascript"] + }, + "ext": { + "placement_id": "123" + } + } + ], + "app": { + "id": "fake-app-id" + } + } + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "seat": "yieldmo", + "bid": [ + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id", + "price": 0.500000, + "adm": "some-test-ad", + "crid": "crid_10", + "h": 250, + "w": 300 + } + ] + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "currency": "EUR", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id", + "price": 0.5, + "adm": "some-test-ad", + "crid": "crid_10", + "w": 300, + "h": 250 + }, + "type": "video" + } + ] + } + ] +} diff --git a/adapters/yieldmo/yieldmotest/exemplary/simple_video.json b/adapters/yieldmo/yieldmotest/exemplary/simple_video.json new file mode 100644 index 00000000000..aaf53124365 --- /dev/null +++ b/adapters/yieldmo/yieldmotest/exemplary/simple_video.json @@ -0,0 +1,95 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "video": { + "w": 300, + "h": 250, + "startdelay": 0, + "protocols": [2], + "mimes": ["video/mp4", "application/javascript"] + }, + "ext": { + "bidder": { + "placementId": "123" + } + } + } + ], + "site": { + "id": "fake-site-id" + } + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://ads.yieldmo.com/openrtb2", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "video": { + "w": 300, + "h": 250, + "startdelay": 0, + "protocols": [2], + "mimes": ["video/mp4", "application/javascript"] + }, + "ext": { + "placement_id": "123" + } + } + ], + "site": { + "id": "fake-site-id" + } + } + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "seat": "yieldmo", + "bid": [ + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id", + "price": 0.500000, + "adm": "some-test-ad", + "crid": "crid_10", + "h": 250, + "w": 300 + } + ] + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "currency": "EUR", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id", + "price": 0.5, + "adm": "some-test-ad", + "crid": "crid_10", + "w": 300, + "h": 250 + }, + "type": "video" + } + ] + } + ] +} diff --git a/static/bidder-info/yieldmo.yaml b/static/bidder-info/yieldmo.yaml index 514f17455ea..64cda519acd 100644 --- a/static/bidder-info/yieldmo.yaml +++ b/static/bidder-info/yieldmo.yaml @@ -1,6 +1,11 @@ maintainer: email: "prebid@yieldmo.com" capabilities: + app: + mediaTypes: + - banner + - video site: mediaTypes: - banner + - video