-
Notifications
You must be signed in to change notification settings - Fork 795
New Adapter: Start.io #4324
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
base: master
Are you sure you want to change the base?
New Adapter: Start.io #4324
Conversation
var bidExt openrtb_ext.ExtBid | ||
err := jsonutil.Unmarshal(bid.Ext, &bidExt) | ||
if err == nil && bidExt.Prebid != nil { | ||
switch bidExt.Prebid.Type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider this as a suggestion. The current implementation follows an anti-pattern, assumes that if there is a multi-format request, the media type defaults to openrtb_ext.BidTypeBanner. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, we strongly recommend implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
var bidExt openrtb_ext.ExtBid | ||
err := jsonutil.Unmarshal(bid.Ext, &bidExt) | ||
if err == nil && bidExt.Prebid != nil { | ||
switch bidExt.Prebid.Type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider this as a suggestion. The current implementation follows an anti-pattern, assumes that if there is a multi-format request, the media type defaults to openrtb_ext.BidTypeNative. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, we strongly recommend implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
var bidExt openrtb_ext.ExtBid | ||
err := jsonutil.Unmarshal(bid.Ext, &bidExt) | ||
if err == nil && bidExt.Prebid != nil { | ||
switch bidExt.Prebid.Type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider this as a suggestion. The current implementation follows an anti-pattern, assumes that if there is a multi-format request, the media type defaults to openrtb_ext.BidTypeVideo. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, we strongly recommend implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
Code coverage summaryNote:
startioRefer here for heat map coverage report
|
endpoint: "http://pbs-rtb.startappnetwork.com/1.3/2.5/getbid?account=pbs" | ||
maintainer: | ||
email: [email protected] | ||
gvlVendorID: 1216 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@przemkaczmarek and I reviewed together. Please see comments.
@@ -0,0 +1,15 @@ | |||
endpoint: "http://pbs-rtb.startappnetwork.com/1.3/2.5/getbid?account=pbs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified endpoint is reachable
curl -i --location --request POST http://pbs-rtb.startappnetwork.com/1.3/2.5/getbid?account=pbs
HTTP/1.1 200 OK
Date: Thu, 01 May 2025 13:31:53 GMT
Content-Length: 0
Connection: keep-alive
Server: Golang net/http
@@ -0,0 +1,15 @@ | |||
endpoint: "http://pbs-rtb.startappnetwork.com/1.3/2.5/getbid?account=pbs" | |||
maintainer: | |||
email: [email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've sent an email to this address. Please reply with "confirmed" to verify that this address is reachable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed received response.
endpoint: "http://pbs-rtb.startappnetwork.com/1.3/2.5/getbid?account=pbs" | ||
maintainer: | ||
email: [email protected] | ||
gvlVendorID: 1216 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified GVL is correct
curl https://vendor-list.consensu.org/v3/vendor-list.json | jq '.vendors."1216"'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 749k 100 749k 0 0 4788k 0 --:--:-- --:--:-- --:--:-- 4805k
{
"id": 1216,
"name": "Start.io Inc",
"purposes": [
1,
3,
4
],
"legIntPurposes": [
2,
7,
10
],
"flexiblePurposes": [
2,
7,
10
],
"specialPurposes": [
1,
2
],
"features": [
1
],
"specialFeatures": [
1
],
"overflow": {
"httpGetLimit": 128
},
"cookieMaxAgeSeconds": null,
"usesCookies": false,
"cookieRefresh": false,
"urls": [
{
"langId": "en",
"privacy": "https://www.start.io/policy/privacy-policy-site/",
"legIntClaim": "https://www.start.io/policy/privacy-policy-site/"
},
{
"langId": "fr",
"privacy": "https://www.start.io/policy/privacy-policy-site/",
"legIntClaim": "https://www.start.io/policy/privacy-policy-site/"
},
{
"langId": "es",
"privacy": "https://www.start.io/policy/privacy-policy-site/",
"legIntClaim": "https://www.start.io/policy/privacy-policy-site/"
},
{
"langId": "de",
"privacy": "https://www.start.io/policy/privacy-policy-site/",
"legIntClaim": "https://www.start.io/policy/privacy-policy-site/"
}
],
"usesNonCookieAccess": true,
"dataRetention": {
"stdRetention": 365,
"purposes": {},
"specialPurposes": {}
},
"dataDeclaration": [
1,
2,
3,
6,
7,
8,
9,
10,
11
],
"deviceStorageDisclosureUrl": "https://info.startappservice.com/tcf/start.io_domains.json"
}
adapters/startio/startio.go
Outdated
"github.com/prebid/prebid-server/v3/util/jsonutil" | ||
) | ||
|
||
type StartioAdapter struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: let's call this adapter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
adapters/startio/startio.go
Outdated
uri, err := url.ParseRequestURI(config.Endpoint) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
bidder := &StartioAdapter{ | ||
endpoint: uri.String(), | ||
} | ||
|
||
return bidder, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you're trying to validate your endpoint URL. This can be simplified to
bidder := &adapter{
endpoint: config.Endpoint,
}
return bidder, nil
Endpoint validation occurs upstream when the YAML files are loaded.
} | ||
|
||
var errs []error | ||
bidderResponse := adapters.NewBidderResponseWithBidsCapacity(len(bidResponse.SeatBid)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better to start with a capacity derived from SeatBid[i].Bid
instead?
return "", &errortypes.BadServerResponse{ | ||
Message: fmt.Sprintf("Failed to parse bid media type for impression %s.", bid.ImpID), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a supplemental JSON test called invalid-resp-media-type.json
to cover this case. Since you don't support audio I suggest returning that in your response.
} | ||
|
||
func getMediaTypeForBid(bid openrtb2.Bid) (openrtb_ext.BidType, error) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super nitpick: delete blank line
|
||
func validateRequest(request openrtb2.BidRequest) error { | ||
if !isSupportedCurrency(request.Cur) { | ||
return wrapReqError("unsupported currency: only USD is accepted") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a supplemental JSON test called req-invalid-unsupported-cur.json
to cover this case.
} | ||
|
||
if !hasSiteOrAppID(request) { | ||
return wrapReqError("request must contain either site.id or app.id") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add supplemental JSON tests called req-invalid-missing-site-id.json
and req-invalid-missing-app-id.json
to cover this case.
Code coverage summaryNote:
startioRefer here for heat map coverage report
|
Docs PR - prebid/prebid.github.io#6018
Related Changes