Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yieldmo app support in yaml file #1542

Merged
merged 4 commits into from
Oct 22, 2020
Merged
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
12 changes: 11 additions & 1 deletion adapters/yieldmo/yieldmo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
})
}
}
Expand All @@ -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 {
SyntaxNode marked this conversation as resolved.
Show resolved Hide resolved
if imp.ID == impId && imp.Banner != nil {
return openrtb_ext.BidTypeBanner
}
}
return openrtb_ext.BidTypeVideo
}
97 changes: 97 additions & 0 deletions adapters/yieldmo/yieldmotest/exemplary/app-banner.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
]
}
95 changes: 95 additions & 0 deletions adapters/yieldmo/yieldmotest/exemplary/app_video.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
]
}
95 changes: 95 additions & 0 deletions adapters/yieldmo/yieldmotest/exemplary/simple_video.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
]
}
5 changes: 5 additions & 0 deletions static/bidder-info/yieldmo.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
maintainer:
email: "prebid@yieldmo.com"
capabilities:
app:
mediaTypes:
- banner
- video
site:
mediaTypes:
- banner
- video
SyntaxNode marked this conversation as resolved.
Show resolved Hide resolved