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

OwnAdx: Bidder param and URL updates #3813

Merged
merged 8 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
9 changes: 5 additions & 4 deletions adapters/ownadx/ownadx.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ func createBidRequest(rtbBidRequest *openrtb2.BidRequest, imps []openrtb2.Imp) *
}
func (adapter *adapter) buildEndpointURL(params *openrtb_ext.ExtImpOwnAdx) (string, error) {
endpointParams := macros.EndpointTemplateParams{
ZoneID: params.SspId,
AccountID: params.SeatId,
SourceId: params.TokenId,
SspID: params.SspId, // Macro
SeatID: params.SeatId,
TokenID: params.TokenId,
}
return macros.ResolveMacros(adapter.endpoint, endpointParams)
}
Expand Down Expand Up @@ -124,6 +124,7 @@ func groupImpsByExt(imps []openrtb2.Imp) (map[openrtb_ext.ExtImpOwnAdx][]openrtb
}

func (adapter *adapter) MakeBids(internalRequest *openrtb2.BidRequest, externalRequest *adapters.RequestData, response *adapters.ResponseData) (*adapters.BidderResponse, []error) {

if response.StatusCode == http.StatusNoContent {
return nil, nil
}
Expand Down Expand Up @@ -159,6 +160,7 @@ func (adapter *adapter) MakeBids(internalRequest *openrtb2.BidRequest, externalR

seatBid := bidResp.SeatBid[0]
bidResponse := adapters.NewBidderResponseWithBidsCapacity(len(bidResp.SeatBid[0].Bid))

if len(seatBid.Bid) == 0 {
return nil, []error{
&errortypes.BadServerResponse{
Expand All @@ -169,7 +171,6 @@ func (adapter *adapter) MakeBids(internalRequest *openrtb2.BidRequest, externalR
for i := 0; i < len(seatBid.Bid); i++ {
var bidType openrtb_ext.BidType
bid := seatBid.Bid[i]

bidType, err := getMediaType(bid)
if err != nil {
return nil, []error{&errortypes.BadServerResponse{
Expand Down
2 changes: 1 addition & 1 deletion adapters/ownadx/ownadx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderOwnAdx, config.Adapter{
Endpoint: "https://pbs.prebid-ownadx.com/bidder/bid/{{.AccountID}}/{{.ZoneID}}?token={{.SourceId}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})
Endpoint: "https://pbs.prebid-ownadx.com/bidder/bid/{{.SeatID}}/{{.SspID}}?token={{.TokenID}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

assert.NoError(t, buildErr)
adapterstest.RunJSONBidderTest(t, "ownadxtest", bidder)
Expand Down
6 changes: 5 additions & 1 deletion macros/macros.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ type EndpointTemplateParams struct {
GvlID string
PageID string
SupplyId string
SspId string

SspID string // Ownadx adapter Macros.
SeatID string
TokenID string
ownAdx-prebid marked this conversation as resolved.
Show resolved Hide resolved

}

// UserSyncPrivacy specifies privacy policy macros, represented as strings, for user sync urls.
Expand Down
2 changes: 1 addition & 1 deletion static/bidder-info/ownadx.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
endpoint: "https://pbs.prebid-ownadx.com/bidder/bid/{{.AccountID}}/{{.ZoneID}}?token={{.SourceId}}"
endpoint: "https://pbs.prebid-ownadx.com/bidder/bid/{{.SeatID}}/{{.SspID}}?token={{.TokenID}}"
maintainer:
email: prebid-team@techbravo.com
capabilities:
Expand Down
7 changes: 1 addition & 6 deletions static/bidder-params/ownadx.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,5 @@
"description": "Token ID"
}
},

"oneOf": [
{ "required": ["sspId"] },
{ "required": ["feedId"] },
{ "required": ["token"] }
]
"required": ["sspId","seatId","tokenId"]
}
Loading