From 93b554f8f000d8d50feec39b66d423f7f8ae75de Mon Sep 17 00:00:00 2001 From: playdigo Date: Mon, 22 Apr 2024 23:58:44 +0300 Subject: [PATCH 1/5] init adapter --- adapters/playdigo/params_test.go | 47 ++++ adapters/playdigo/playdigo.go | 164 ++++++++++++ adapters/playdigo/playdigo_test.go | 20 ++ .../playdigotest/exemplary/endpointId.json | 134 ++++++++++ .../playdigotest/exemplary/multi-format.json | 105 ++++++++ .../playdigotest/exemplary/multi-imp.json | 249 ++++++++++++++++++ .../playdigotest/exemplary/simple-banner.json | 134 ++++++++++ .../playdigotest/exemplary/simple-native.json | 118 +++++++++ .../playdigotest/exemplary/simple-video.json | 129 +++++++++ .../exemplary/simple-web-banner.json | 134 ++++++++++ .../supplemental/bad_media_type.json | 83 ++++++ .../supplemental/bad_response.json | 85 ++++++ .../supplemental/no-valid-impressions.json | 20 ++ .../playdigotest/supplemental/status-204.json | 80 ++++++ .../supplemental/status-not-200.json | 85 ++++++ exchange/adapter_builders.go | 2 + openrtb_ext/bidders.go | 2 + openrtb_ext/imp_playdigo.go | 6 + static/bidder-info/playdigo.yaml | 16 ++ static/bidder-params/playdigo.json | 23 ++ 20 files changed, 1636 insertions(+) create mode 100644 adapters/playdigo/params_test.go create mode 100644 adapters/playdigo/playdigo.go create mode 100644 adapters/playdigo/playdigo_test.go create mode 100644 adapters/playdigo/playdigotest/exemplary/endpointId.json create mode 100644 adapters/playdigo/playdigotest/exemplary/multi-format.json create mode 100644 adapters/playdigo/playdigotest/exemplary/multi-imp.json create mode 100644 adapters/playdigo/playdigotest/exemplary/simple-banner.json create mode 100644 adapters/playdigo/playdigotest/exemplary/simple-native.json create mode 100644 adapters/playdigo/playdigotest/exemplary/simple-video.json create mode 100644 adapters/playdigo/playdigotest/exemplary/simple-web-banner.json create mode 100644 adapters/playdigo/playdigotest/supplemental/bad_media_type.json create mode 100644 adapters/playdigo/playdigotest/supplemental/bad_response.json create mode 100644 adapters/playdigo/playdigotest/supplemental/no-valid-impressions.json create mode 100644 adapters/playdigo/playdigotest/supplemental/status-204.json create mode 100644 adapters/playdigo/playdigotest/supplemental/status-not-200.json create mode 100644 openrtb_ext/imp_playdigo.go create mode 100644 static/bidder-info/playdigo.yaml create mode 100644 static/bidder-params/playdigo.json diff --git a/adapters/playdigo/params_test.go b/adapters/playdigo/params_test.go new file mode 100644 index 00000000000..ba18c1fb216 --- /dev/null +++ b/adapters/playdigo/params_test.go @@ -0,0 +1,47 @@ +package playdigo + +import ( + "encoding/json" + "testing" + + "github.com/prebid/prebid-server/v2/openrtb_ext" +) + +func TestValidParams(t *testing.T) { + validator, err := openrtb_ext.NewBidderParamsValidator("../../static/bidder-params") + if err != nil { + t.Fatalf("Failed to fetch the json schema. %v", err) + } + + for _, p := range validParams { + if err := validator.Validate(openrtb_ext.BidderPlaydigo, json.RawMessage(p)); err != nil { + t.Errorf("Schema rejected valid params: %s", p) + } + } +} + +func TestInvalidParams(t *testing.T) { + validator, err := openrtb_ext.NewBidderParamsValidator("../../static/bidder-params") + if err != nil { + t.Fatalf("Failed to fetch the json schema. %v", err) + } + + for _, p := range invalidParams { + if err := validator.Validate(openrtb_ext.BidderPlaydigo, json.RawMessage(p)); err == nil { + t.Errorf("Schema allowed invalid params: %s", p) + } + } +} + +var validParams = []string{ + `{"placementId": "test"}`, + `{"placementId": "1"}`, + `{"endpointId": "test"}`, + `{"endpointId": "1"}`, +} + +var invalidParams = []string{ + `{"placementId": 42}`, + `{"endpointId": 42}`, + `{"placementId": "1", "endpointId": "1"}`, +} diff --git a/adapters/playdigo/playdigo.go b/adapters/playdigo/playdigo.go new file mode 100644 index 00000000000..2a7a8a80cac --- /dev/null +++ b/adapters/playdigo/playdigo.go @@ -0,0 +1,164 @@ +package playdigo + +import ( + "encoding/json" + "errors" + "fmt" + "net/http" + + "github.com/prebid/openrtb/v20/openrtb2" + "github.com/prebid/prebid-server/v2/adapters" + "github.com/prebid/prebid-server/v2/config" + "github.com/prebid/prebid-server/v2/openrtb_ext" +) + +type adapter struct { + endpoint string +} + +type reqBodyExt struct { + PlaydigoBidderExt reqBodyExtBidder `json:"bidder"` +} + +type reqBodyExtBidder struct { + Type string `json:"type"` + PlacementID string `json:"placementId,omitempty"` + EndpointID string `json:"endpointId,omitempty"` +} + +func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) { + bidder := &adapter{ + endpoint: config.Endpoint, + } + return bidder, nil +} + +func (a *adapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) { + var errs []error + var adapterRequests []*adapters.RequestData + + reqCopy := *request + for _, imp := range request.Imp { + reqCopy.Imp = []openrtb2.Imp{imp} + + var bidderExt adapters.ExtImpBidder + var playdigoExt openrtb_ext.ImpExtPlaydigo + + if err := json.Unmarshal(imp.Ext, &bidderExt); err != nil { + errs = append(errs, err) + continue + } + if err := json.Unmarshal(bidderExt.Bidder, &playdigoExt); err != nil { + errs = append(errs, err) + continue + } + + impExt := reqBodyExt{PlaydigoBidderExt: reqBodyExtBidder{}} + + if playdigoExt.PlacementID != "" { + impExt.PlaydigoBidderExt.PlacementID = playdigoExt.PlacementID + impExt.PlaydigoBidderExt.Type = "publisher" + } else if playdigoExt.EndpointID != "" { + impExt.PlaydigoBidderExt.EndpointID = playdigoExt.EndpointID + impExt.PlaydigoBidderExt.Type = "network" + } + + finalyImpExt, err := json.Marshal(impExt) + if err != nil { + errs = append(errs, err) + continue + } + + reqCopy.Imp[0].Ext = finalyImpExt + + adapterReq, err := a.makeRequest(&reqCopy) + if err != nil { + errs = append(errs, err) + continue + } + + if adapterReq != nil { + adapterRequests = append(adapterRequests, adapterReq) + } + } + + if len(adapterRequests) == 0 { + errs = append(errs, errors.New("found no valid impressions")) + return nil, errs + } + + return adapterRequests, nil +} + +func (a *adapter) makeRequest(request *openrtb2.BidRequest) (*adapters.RequestData, error) { + reqJSON, err := json.Marshal(request) + if err != nil { + return nil, err + } + + headers := http.Header{} + headers.Add("Content-Type", "application/json;charset=utf-8") + headers.Add("Accept", "application/json") + return &adapters.RequestData{ + Method: "POST", + Uri: a.endpoint, + Body: reqJSON, + Headers: headers, + ImpIDs: openrtb_ext.GetImpIDs(request.Imp), + }, nil +} + +func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.RequestData, responseData *adapters.ResponseData) (*adapters.BidderResponse, []error) { + if adapters.IsResponseStatusCodeNoContent(responseData) { + return nil, nil + } + + if err := adapters.CheckResponseStatusCodeForErrors(responseData); err != nil { + return nil, []error{err} + } + + var response openrtb2.BidResponse + if err := json.Unmarshal(responseData.Body, &response); err != nil { + return nil, []error{err} + } + + bidResponse := adapters.NewBidderResponseWithBidsCapacity(len(request.Imp)) + if len(response.Cur) != 0 { + bidResponse.Currency = response.Cur + } + + for _, seatBid := range response.SeatBid { + for i := range seatBid.Bid { + bidType, err := getBidMediaType(&seatBid.Bid[i]) + if err != nil { + return nil, []error{err} + } + + b := &adapters.TypedBid{ + Bid: &seatBid.Bid[i], + BidType: bidType, + } + bidResponse.Bids = append(bidResponse.Bids, b) + } + } + return bidResponse, nil +} + +func getBidMediaType(bid *openrtb2.Bid) (openrtb_ext.BidType, error) { + var extBid openrtb_ext.ExtBid + err := json.Unmarshal(bid.Ext, &extBid) + if err != nil { + return "", fmt.Errorf("unable to deserialize imp %v bid.ext, error: %v", bid.ImpID, err) + } + + if extBid.Prebid == nil { + return "", fmt.Errorf("imp %v with unknown media type", bid.ImpID) + } + + switch extBid.Prebid.Type { + case openrtb_ext.BidTypeBanner, openrtb_ext.BidTypeVideo, openrtb_ext.BidTypeNative: + return extBid.Prebid.Type, nil + default: + return "", fmt.Errorf("invalid BidType: %s", extBid.Prebid.Type) + } +} diff --git a/adapters/playdigo/playdigo_test.go b/adapters/playdigo/playdigo_test.go new file mode 100644 index 00000000000..f7424ca583d --- /dev/null +++ b/adapters/playdigo/playdigo_test.go @@ -0,0 +1,20 @@ +package playdigo + +import ( + "testing" + + "github.com/prebid/prebid-server/v2/adapters/adapterstest" + "github.com/prebid/prebid-server/v2/config" + "github.com/prebid/prebid-server/v2/openrtb_ext" +) + +func TestJsonSamples(t *testing.T) { + bidder, buildErr := Builder(openrtb_ext.BidderEmtv, config.Adapter{ + Endpoint: "https://server.playdigo.com/pserver"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"}) + + if buildErr != nil { + t.Fatalf("Builder returned unexpected error %v", buildErr) + } + + adapterstest.RunJSONBidderTest(t, "playdigotest", bidder) +} diff --git a/adapters/playdigo/playdigotest/exemplary/endpointId.json b/adapters/playdigo/playdigotest/exemplary/endpointId.json new file mode 100644 index 00000000000..f1cf8a54a20 --- /dev/null +++ b/adapters/playdigo/playdigotest/exemplary/endpointId.json @@ -0,0 +1,134 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "device": { + "ip": "123.123.123.123", + "ua": "iPad" + }, + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "imp": [ + { + "id": "test-imp-id", + "tagid": "test", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "endpointId": "test" + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://server.playdigo.com/pserver", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "tagid": "test", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "endpointId": "test", + "type": "network" + } + } + } + ], + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "device": { + "ip": "123.123.123.123", + "ua": "iPad" + } + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "test_bid_id", + "impid": "test-imp-id", + "price": 0.27543, + "adm": "", + "cid": "test_cid", + "crid": "test_crid", + "dealid": "test_dealid", + "w": 300, + "h": 250, + "ext": { + "prebid": { + "type": "banner" + } + } + } + ], + "seat": "playdigo" + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "bids": [ + { + "bid": { + "id": "test_bid_id", + "impid": "test-imp-id", + "price": 0.27543, + "adm": "", + "cid": "test_cid", + "crid": "test_crid", + "dealid": "test_dealid", + "w": 300, + "h": 250, + "ext": { + "prebid": { + "type": "banner" + } + } + }, + "type": "banner" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/playdigo/playdigotest/exemplary/multi-format.json b/adapters/playdigo/playdigotest/exemplary/multi-format.json new file mode 100644 index 00000000000..12d589a1366 --- /dev/null +++ b/adapters/playdigo/playdigotest/exemplary/multi-format.json @@ -0,0 +1,105 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "device": { + "ip": "123.123.123.123", + "ua": "iPad" + }, + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "imp": [ + { + "id": "test-imp-id", + "tagid": "test", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "video": { + "mimes": [ + "video/mp4" + ], + "protocols": [ + 2, + 5 + ], + "w": 1024, + "h": 576 + }, + "ext": { + "bidder": { + "endpointId": "test" + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://server.playdigo.com/pserver", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "tagid": "test", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "video": { + "mimes": [ + "video/mp4" + ], + "protocols": [ + 2, + 5 + ], + "w": 1024, + "h": 576 + }, + "ext": { + "bidder": { + "endpointId": "test", + "type": "network" + } + } + } + ], + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "device": { + "ip": "123.123.123.123", + "ua": "iPad" + } + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 204 + } + } + ], + "expectedBidResponses": [] +} \ No newline at end of file diff --git a/adapters/playdigo/playdigotest/exemplary/multi-imp.json b/adapters/playdigo/playdigotest/exemplary/multi-imp.json new file mode 100644 index 00000000000..4937f741b87 --- /dev/null +++ b/adapters/playdigo/playdigotest/exemplary/multi-imp.json @@ -0,0 +1,249 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "device": { + "ip": "123.123.123.123", + "ua": "iPad" + }, + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "imp": [ + { + "id": "test-imp-id", + "tagid": "test", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "endpointId": "test" + } + } + }, + { + "id": "test-imp-id", + "tagid": "test", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "endpointId": "test" + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://server.playdigo.com/pserver", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "tagid": "test", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "endpointId": "test", + "type": "network" + } + } + } + ], + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "device": { + "ip": "123.123.123.123", + "ua": "iPad" + } + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "test_bid_id", + "impid": "test-imp-id", + "price": 0.27543, + "adm": "", + "cid": "test_cid", + "crid": "test_crid", + "dealid": "test_dealid", + "w": 300, + "h": 250, + "ext": { + "prebid": { + "type": "banner" + } + } + } + ], + "seat": "playdigo" + } + ], + "cur": "USD" + } + } + }, + { + "expectedRequest": { + "uri": "https://server.playdigo.com/pserver", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "tagid": "test", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "endpointId": "test", + "type": "network" + } + } + } + ], + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "device": { + "ip": "123.123.123.123", + "ua": "iPad" + } + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "test_bid_id", + "impid": "test-imp-id", + "price": 0.27543, + "adm": "", + "cid": "test_cid", + "crid": "test_crid", + "dealid": "test_dealid", + "w": 300, + "h": 250, + "ext": { + "prebid": { + "type": "banner" + } + } + } + ], + "seat": "playdigo" + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "bids": [ + { + "bid": { + "id": "test_bid_id", + "impid": "test-imp-id", + "price": 0.27543, + "adm": "", + "cid": "test_cid", + "crid": "test_crid", + "dealid": "test_dealid", + "w": 300, + "h": 250, + "ext": { + "prebid": { + "type": "banner" + } + } + }, + "type": "banner" + } + ] + }, + { + "bids": [ + { + "bid": { + "id": "test_bid_id", + "impid": "test-imp-id", + "price": 0.27543, + "adm": "", + "cid": "test_cid", + "crid": "test_crid", + "dealid": "test_dealid", + "w": 300, + "h": 250, + "ext": { + "prebid": { + "type": "banner" + } + } + }, + "type": "banner" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/playdigo/playdigotest/exemplary/simple-banner.json b/adapters/playdigo/playdigotest/exemplary/simple-banner.json new file mode 100644 index 00000000000..05267020d00 --- /dev/null +++ b/adapters/playdigo/playdigotest/exemplary/simple-banner.json @@ -0,0 +1,134 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "device": { + "ip": "123.123.123.123", + "ua": "iPad" + }, + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "imp": [ + { + "id": "test-imp-id", + "tagid": "test", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "placementId": "test" + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://server.playdigo.com/pserver", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "tagid": "test", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "placementId": "test", + "type": "publisher" + } + } + } + ], + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "device": { + "ip": "123.123.123.123", + "ua": "iPad" + } + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "test_bid_id", + "impid": "test-imp-id", + "price": 0.27543, + "adm": "", + "cid": "test_cid", + "crid": "test_crid", + "dealid": "test_dealid", + "w": 300, + "h": 250, + "ext": { + "prebid": { + "type": "banner" + } + } + } + ], + "seat": "playdigo" + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "bids": [ + { + "bid": { + "id": "test_bid_id", + "impid": "test-imp-id", + "price": 0.27543, + "adm": "", + "cid": "test_cid", + "crid": "test_crid", + "dealid": "test_dealid", + "w": 300, + "h": 250, + "ext": { + "prebid": { + "type": "banner" + } + } + }, + "type": "banner" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/playdigo/playdigotest/exemplary/simple-native.json b/adapters/playdigo/playdigotest/exemplary/simple-native.json new file mode 100644 index 00000000000..ab2e7e6249e --- /dev/null +++ b/adapters/playdigo/playdigotest/exemplary/simple-native.json @@ -0,0 +1,118 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "device": { + "ip": "123.123.123.123", + "ua": "iPad" + }, + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "imp": [ + { + "id": "test-imp-id", + "tagid": "test", + "native": { + "request": "{\"ver\":\"1.1\",\"layout\":1,\"adunit\":2,\"plcmtcnt\":6,\"plcmttype\":4,\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":75}},{\"id\":2,\"required\":1,\"img\":{\"wmin\":492,\"hmin\":328,\"type\":3,\"mimes\":[\"image/jpeg\",\"image/jpg\",\"image/png\"]}},{\"id\":4,\"required\":0,\"data\":{\"type\":6}},{\"id\":5,\"required\":0,\"data\":{\"type\":7}},{\"id\":6,\"required\":0,\"data\":{\"type\":1,\"len\":20}}]}", + "ver": "1.1" + }, + "ext": { + "bidder": { + "placementId": "test" + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://server.playdigo.com/pserver", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "tagid": "test", + "native": { + "request": "{\"ver\":\"1.1\",\"layout\":1,\"adunit\":2,\"plcmtcnt\":6,\"plcmttype\":4,\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":75}},{\"id\":2,\"required\":1,\"img\":{\"wmin\":492,\"hmin\":328,\"type\":3,\"mimes\":[\"image/jpeg\",\"image/jpg\",\"image/png\"]}},{\"id\":4,\"required\":0,\"data\":{\"type\":6}},{\"id\":5,\"required\":0,\"data\":{\"type\":7}},{\"id\":6,\"required\":0,\"data\":{\"type\":1,\"len\":20}}]}", + "ver": "1.1" + }, + "ext": { + "bidder": { + "placementId": "test", + "type": "publisher" + } + } + } + ], + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "device": { + "ip": "123.123.123.123", + "ua": "iPad" + } + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "test_bid_id", + "impid": "test-imp-id", + "price": 0.27543, + "adm": "", + "cid": "test_cid", + "crid": "test_crid", + "dealid": "test_dealid", + "w": 300, + "h": 250, + "ext": { + "prebid": { + "type": "native" + } + } + } + ], + "seat": "playdigo" + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "bids": [ + { + "bid": { + "id": "test_bid_id", + "impid": "test-imp-id", + "price": 0.27543, + "adm": "", + "cid": "test_cid", + "crid": "test_crid", + "dealid": "test_dealid", + "w": 300, + "h": 250, + "ext": { + "prebid": { + "type": "native" + } + } + }, + "type": "native" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/playdigo/playdigotest/exemplary/simple-video.json b/adapters/playdigo/playdigotest/exemplary/simple-video.json new file mode 100644 index 00000000000..0a4d6d0462d --- /dev/null +++ b/adapters/playdigo/playdigotest/exemplary/simple-video.json @@ -0,0 +1,129 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "device": { + "ip": "123.123.123.123", + "ua": "iPad" + }, + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "imp": [ + { + "id": "test-imp-id", + "tagid": "test", + "video": { + "mimes": [ + "video/mp4" + ], + "protocols": [ + 2, + 5 + ], + "w": 1024, + "h": 576 + }, + "ext": { + "bidder": { + "placementId": "test" + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://server.playdigo.com/pserver", + "body": { + "id": "test-request-id", + "device": { + "ip": "123.123.123.123", + "ua": "iPad" + }, + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "imp": [ + { + "id": "test-imp-id", + "tagid": "test", + "video": { + "mimes": [ + "video/mp4" + ], + "protocols": [ + 2, + 5 + ], + "w": 1024, + "h": 576 + }, + "ext": { + "bidder": { + "placementId": "test", + "type": "publisher" + } + } + } + ] + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "test_bid_id", + "impid": "test-imp-id", + "price": 0.27543, + "adm": "00:01:00", + "cid": "test_cid", + "crid": "test_crid", + "dealid": "test_dealid", + "ext": { + "prebid": { + "type": "video" + } + } + } + ], + "seat": "playdigo" + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "test_bid_id", + "impid": "test-imp-id", + "price": 0.27543, + "adm": "00:01:00", + "cid": "test_cid", + "crid": "test_crid", + "dealid": "test_dealid", + "ext": { + "prebid": { + "type": "video" + } + } + }, + "type": "video" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/playdigo/playdigotest/exemplary/simple-web-banner.json b/adapters/playdigo/playdigotest/exemplary/simple-web-banner.json new file mode 100644 index 00000000000..57e694e95cf --- /dev/null +++ b/adapters/playdigo/playdigotest/exemplary/simple-web-banner.json @@ -0,0 +1,134 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "tagid": "test", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "placementId": "test" + } + } + } + ], + "site": { + "id": "1", + "domain": "test.com" + }, + "device": { + "ip": "123.123.123.123", + "ua": "Ubuntu" + } + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://server.playdigo.com/pserver", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "tagid": "test", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "placementId": "test", + "type": "publisher" + } + } + } + ], + "site": { + "id": "1", + "domain": "test.com" + }, + "device": { + "ip": "123.123.123.123", + "ua": "Ubuntu" + } + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "test_bid_id", + "impid": "test-imp-id", + "price": 0.27543, + "adm": "", + "cid": "test_cid", + "crid": "test_crid", + "dealid": "test_dealid", + "w": 468, + "h": 60, + "ext": { + "prebid": { + "type": "banner" + } + } + } + ], + "seat": "playdigo" + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "bids": [ + { + "bid": { + "id": "test_bid_id", + "impid": "test-imp-id", + "price": 0.27543, + "adm": "", + "cid": "test_cid", + "crid": "test_crid", + "dealid": "test_dealid", + "w": 468, + "h": 60, + "ext": { + "prebid": { + "type": "banner" + } + } + }, + "type": "banner" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/playdigo/playdigotest/supplemental/bad_media_type.json b/adapters/playdigo/playdigotest/supplemental/bad_media_type.json new file mode 100644 index 00000000000..f2badaaeb40 --- /dev/null +++ b/adapters/playdigo/playdigotest/supplemental/bad_media_type.json @@ -0,0 +1,83 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "ext": { + "bidder": { + "placementId": "test" + } + } + } + ], + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "device": { + "ip": "123.123.123.123", + "ifa": "sdjfksdf-dfsds-dsdg-dsgg" + } + }, + "httpCalls": [{ + "expectedRequest": { + "uri": "https://server.playdigo.com/pserver", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "ext": { + "bidder": { + "placementId": "test", + "type": "publisher" + } + } + } + ], + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "device": { + "ip": "123.123.123.123", + "ifa": "sdjfksdf-dfsds-dsdg-dsgg" + } + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "test_bid_id", + "impid": "test-imp-id", + "price": 0.27543, + "adm": "", + "cid": "test_cid", + "crid": "test_crid", + "dealid": "test_dealid", + "w": 300, + "h": 250, + "ext": {} + } + ], + "seat": "playdigo" + } + ], + "cur": "USD" + } + } + }], + "expectedMakeBidsErrors": [ + { + "value": "imp test-imp-id with unknown media type", + "comparison": "literal" + } + ] +} diff --git a/adapters/playdigo/playdigotest/supplemental/bad_response.json b/adapters/playdigo/playdigotest/supplemental/bad_response.json new file mode 100644 index 00000000000..afa17aa2e87 --- /dev/null +++ b/adapters/playdigo/playdigotest/supplemental/bad_response.json @@ -0,0 +1,85 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "placementId": "test" + } + } + } + ], + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "device": { + "ip": "123.123.123.123", + "ifa": "sdjfksdf-dfsds-dsdg-dsgg" + } + }, + "httpCalls": [{ + "expectedRequest": { + "uri": "https://server.playdigo.com/pserver", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "placementId": "test", + "type": "publisher" + } + } + } + ], + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "device": { + "ip": "123.123.123.123", + "ifa": "sdjfksdf-dfsds-dsdg-dsgg" + } + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": "" + } + }], + "expectedMakeBidsErrors": [ + { + "value": "json: cannot unmarshal string into Go value of type openrtb2.BidResponse", + "comparison": "literal" + } + ] +} diff --git a/adapters/playdigo/playdigotest/supplemental/no-valid-impressions.json b/adapters/playdigo/playdigotest/supplemental/no-valid-impressions.json new file mode 100644 index 00000000000..cc1edd685f9 --- /dev/null +++ b/adapters/playdigo/playdigotest/supplemental/no-valid-impressions.json @@ -0,0 +1,20 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "imp": [], + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "device": { + "ip": "123.123.123.123", + "ifa": "sdjfksdf-dfsds-dsdg-dsgg" + } + }, + "expectedMakeRequestsErrors": [ + { + "value": "found no valid impressions", + "comparison": "literal" + } + ] +} diff --git a/adapters/playdigo/playdigotest/supplemental/status-204.json b/adapters/playdigo/playdigotest/supplemental/status-204.json new file mode 100644 index 00000000000..a424ea0d2fb --- /dev/null +++ b/adapters/playdigo/playdigotest/supplemental/status-204.json @@ -0,0 +1,80 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "placementId": "test" + } + } + } + ], + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "device": { + "ip": "123.123.123.123", + "ifa": "sdjfksdf-dfsds-dsdg-dsgg" + } + }, + "httpCalls": [{ + "expectedRequest": { + "uri": "https://server.playdigo.com/pserver", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "placementId": "test", + "type": "publisher" + } + } + } + ], + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "device": { + "ip": "123.123.123.123", + "ifa": "sdjfksdf-dfsds-dsdg-dsgg" + } + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 204, + "body": {} + } + }], + "expectedBidResponses": [] +} diff --git a/adapters/playdigo/playdigotest/supplemental/status-not-200.json b/adapters/playdigo/playdigotest/supplemental/status-not-200.json new file mode 100644 index 00000000000..a8993092e99 --- /dev/null +++ b/adapters/playdigo/playdigotest/supplemental/status-not-200.json @@ -0,0 +1,85 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "placementId": "test" + } + } + } + ], + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "device": { + "ip": "123.123.123.123", + "ifa": "sdjfksdf-dfsds-dsdg-dsgg" + } + }, + "httpCalls": [{ + "expectedRequest": { + "uri": "https://server.playdigo.com/pserver", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "placementId": "test", + "type": "publisher" + } + } + } + ], + "app": { + "id": "1", + "bundle": "com.wls.testwlsapplication" + }, + "device": { + "ip": "123.123.123.123", + "ifa": "sdjfksdf-dfsds-dsdg-dsgg" + } + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 404, + "body": {} + } + }], + "expectedMakeBidsErrors": [ + { + "value": "Unexpected status code: 404. Run with request.debug = 1 for more info", + "comparison": "literal" + } + ] +} diff --git a/exchange/adapter_builders.go b/exchange/adapter_builders.go index 416bd164445..a817d29398e 100755 --- a/exchange/adapter_builders.go +++ b/exchange/adapter_builders.go @@ -140,6 +140,7 @@ import ( "github.com/prebid/prebid-server/v2/adapters/ownadx" "github.com/prebid/prebid-server/v2/adapters/pangle" "github.com/prebid/prebid-server/v2/adapters/pgamssp" + "github.com/prebid/prebid-server/v2/adapters/playdigo" "github.com/prebid/prebid-server/v2/adapters/pubmatic" "github.com/prebid/prebid-server/v2/adapters/pubnative" "github.com/prebid/prebid-server/v2/adapters/pulsepoint" @@ -348,6 +349,7 @@ func newAdapterBuilders() map[openrtb_ext.BidderName]adapters.Builder { openrtb_ext.BidderOwnAdx: ownadx.Builder, openrtb_ext.BidderPangle: pangle.Builder, openrtb_ext.BidderPGAMSsp: pgamssp.Builder, + openrtb_ext.BidderPlaydigo: playdigo.Builder, openrtb_ext.BidderPubmatic: pubmatic.Builder, openrtb_ext.BidderPubnative: pubnative.Builder, openrtb_ext.BidderPulsepoint: pulsepoint.Builder, diff --git a/openrtb_ext/bidders.go b/openrtb_ext/bidders.go index ea74cf94b8c..1871763cd34 100644 --- a/openrtb_ext/bidders.go +++ b/openrtb_ext/bidders.go @@ -158,6 +158,7 @@ var coreBidderNames []BidderName = []BidderName{ BidderOwnAdx, BidderPangle, BidderPGAMSsp, + BidderPlaydigo, BidderPubmatic, BidderPubnative, BidderPulsepoint, @@ -442,6 +443,7 @@ const ( BidderOwnAdx BidderName = "ownadx" BidderPangle BidderName = "pangle" BidderPGAMSsp BidderName = "pgamssp" + BidderPlaydigo BidderName = "playdigo" BidderPubmatic BidderName = "pubmatic" BidderPubnative BidderName = "pubnative" BidderPulsepoint BidderName = "pulsepoint" diff --git a/openrtb_ext/imp_playdigo.go b/openrtb_ext/imp_playdigo.go new file mode 100644 index 00000000000..2d2d54ada20 --- /dev/null +++ b/openrtb_ext/imp_playdigo.go @@ -0,0 +1,6 @@ +package openrtb_ext + +type ImpExtPlaydigo struct { + PlacementID string `json:"placementId"` + EndpointID string `json:"endpointId"` +} diff --git a/static/bidder-info/playdigo.yaml b/static/bidder-info/playdigo.yaml new file mode 100644 index 00000000000..08e8e4766a4 --- /dev/null +++ b/static/bidder-info/playdigo.yaml @@ -0,0 +1,16 @@ +endpoint: "https://server.playdigo.com/pserver" +geoscope: + - USA +maintainer: + email: "yr@playdigo.com" +capabilities: + site: + mediaTypes: + - banner + - video + - native + app: + mediaTypes: + - banner + - video + - native diff --git a/static/bidder-params/playdigo.json b/static/bidder-params/playdigo.json new file mode 100644 index 00000000000..301ffdf1ca6 --- /dev/null +++ b/static/bidder-params/playdigo.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Playdigo Adapter Params", + "description": "A schema which validates params accepted by the Playdigo adapter", + "type": "object", + + "properties": { + "placementId": { + "type": "string", + "minLength": 1, + "description": "Placement ID" + }, + "endpointId": { + "type": "string", + "minLength": 1, + "description": "Endpoint ID" + } + }, + "oneOf": [ + { "required": ["placementId"] }, + { "required": ["endpointId"] } + ] +} \ No newline at end of file From b7b5e649fe2097e0f6ff7913eb3e472d65cee51e Mon Sep 17 00:00:00 2001 From: playdigo Date: Thu, 25 Apr 2024 14:30:30 +0300 Subject: [PATCH 2/5] updates --- adapters/playdigo/playdigo.go | 34 ++++++++----------- .../playdigotest/exemplary/endpointId.json | 2 ++ .../playdigotest/exemplary/multi-imp.json | 4 +++ .../playdigotest/exemplary/simple-banner.json | 2 ++ .../playdigotest/exemplary/simple-native.json | 2 ++ .../playdigotest/exemplary/simple-video.json | 2 ++ .../exemplary/simple-web-banner.json | 2 ++ .../supplemental/bad_media_type.json | 2 +- 8 files changed, 30 insertions(+), 20 deletions(-) diff --git a/adapters/playdigo/playdigo.go b/adapters/playdigo/playdigo.go index 2a7a8a80cac..d8450bdd798 100644 --- a/adapters/playdigo/playdigo.go +++ b/adapters/playdigo/playdigo.go @@ -77,9 +77,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.E continue } - if adapterReq != nil { - adapterRequests = append(adapterRequests, adapterReq) - } + adapterRequests = append(adapterRequests, adapterReq) } if len(adapterRequests) == 0 { @@ -129,7 +127,8 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R for _, seatBid := range response.SeatBid { for i := range seatBid.Bid { - bidType, err := getBidMediaType(&seatBid.Bid[i]) + bid := seatBid.Bid[i] + bidType, err := getBidType(bid) if err != nil { return nil, []error{err} } @@ -144,21 +143,18 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R return bidResponse, nil } -func getBidMediaType(bid *openrtb2.Bid) (openrtb_ext.BidType, error) { - var extBid openrtb_ext.ExtBid - err := json.Unmarshal(bid.Ext, &extBid) - if err != nil { - return "", fmt.Errorf("unable to deserialize imp %v bid.ext, error: %v", bid.ImpID, err) +func getBidType(bid openrtb2.Bid) (openrtb_ext.BidType, error) { + // determinate media type by bid response field mtype + switch bid.MType { + case openrtb2.MarkupBanner: + return openrtb_ext.BidTypeBanner, nil + case openrtb2.MarkupVideo: + return openrtb_ext.BidTypeVideo, nil + case openrtb2.MarkupAudio: + return openrtb_ext.BidTypeAudio, nil + case openrtb2.MarkupNative: + return openrtb_ext.BidTypeNative, nil } - if extBid.Prebid == nil { - return "", fmt.Errorf("imp %v with unknown media type", bid.ImpID) - } - - switch extBid.Prebid.Type { - case openrtb_ext.BidTypeBanner, openrtb_ext.BidTypeVideo, openrtb_ext.BidTypeNative: - return extBid.Prebid.Type, nil - default: - return "", fmt.Errorf("invalid BidType: %s", extBid.Prebid.Type) - } + return "", fmt.Errorf("could not define media type for impression: %s", bid.ImpID) } diff --git a/adapters/playdigo/playdigotest/exemplary/endpointId.json b/adapters/playdigo/playdigotest/exemplary/endpointId.json index f1cf8a54a20..8b6cc1a253f 100644 --- a/adapters/playdigo/playdigotest/exemplary/endpointId.json +++ b/adapters/playdigo/playdigotest/exemplary/endpointId.json @@ -89,6 +89,7 @@ "cid": "test_cid", "crid": "test_crid", "dealid": "test_dealid", + "mtype": 1, "w": 300, "h": 250, "ext": { @@ -118,6 +119,7 @@ "cid": "test_cid", "crid": "test_crid", "dealid": "test_dealid", + "mtype": 1, "w": 300, "h": 250, "ext": { diff --git a/adapters/playdigo/playdigotest/exemplary/multi-imp.json b/adapters/playdigo/playdigotest/exemplary/multi-imp.json index 4937f741b87..571642d753f 100644 --- a/adapters/playdigo/playdigotest/exemplary/multi-imp.json +++ b/adapters/playdigo/playdigotest/exemplary/multi-imp.json @@ -110,6 +110,7 @@ "cid": "test_cid", "crid": "test_crid", "dealid": "test_dealid", + "mtype": 1, "w": 300, "h": 250, "ext": { @@ -181,6 +182,7 @@ "cid": "test_cid", "crid": "test_crid", "dealid": "test_dealid", + "mtype": 1, "w": 300, "h": 250, "ext": { @@ -210,6 +212,7 @@ "cid": "test_cid", "crid": "test_crid", "dealid": "test_dealid", + "mtype": 1, "w": 300, "h": 250, "ext": { @@ -233,6 +236,7 @@ "cid": "test_cid", "crid": "test_crid", "dealid": "test_dealid", + "mtype": 1, "w": 300, "h": 250, "ext": { diff --git a/adapters/playdigo/playdigotest/exemplary/simple-banner.json b/adapters/playdigo/playdigotest/exemplary/simple-banner.json index 05267020d00..9972f4b38be 100644 --- a/adapters/playdigo/playdigotest/exemplary/simple-banner.json +++ b/adapters/playdigo/playdigotest/exemplary/simple-banner.json @@ -89,6 +89,7 @@ "cid": "test_cid", "crid": "test_crid", "dealid": "test_dealid", + "mtype": 1, "w": 300, "h": 250, "ext": { @@ -118,6 +119,7 @@ "cid": "test_cid", "crid": "test_crid", "dealid": "test_dealid", + "mtype": 1, "w": 300, "h": 250, "ext": { diff --git a/adapters/playdigo/playdigotest/exemplary/simple-native.json b/adapters/playdigo/playdigotest/exemplary/simple-native.json index ab2e7e6249e..c3d50492c42 100644 --- a/adapters/playdigo/playdigotest/exemplary/simple-native.json +++ b/adapters/playdigo/playdigotest/exemplary/simple-native.json @@ -73,6 +73,7 @@ "cid": "test_cid", "crid": "test_crid", "dealid": "test_dealid", + "mtype": 4, "w": 300, "h": 250, "ext": { @@ -102,6 +103,7 @@ "cid": "test_cid", "crid": "test_crid", "dealid": "test_dealid", + "mtype": 4, "w": 300, "h": 250, "ext": { diff --git a/adapters/playdigo/playdigotest/exemplary/simple-video.json b/adapters/playdigo/playdigotest/exemplary/simple-video.json index 0a4d6d0462d..3bdfbb22a21 100644 --- a/adapters/playdigo/playdigotest/exemplary/simple-video.json +++ b/adapters/playdigo/playdigotest/exemplary/simple-video.json @@ -87,6 +87,7 @@ "cid": "test_cid", "crid": "test_crid", "dealid": "test_dealid", + "mtype": 2, "ext": { "prebid": { "type": "video" @@ -115,6 +116,7 @@ "cid": "test_cid", "crid": "test_crid", "dealid": "test_dealid", + "mtype": 2, "ext": { "prebid": { "type": "video" diff --git a/adapters/playdigo/playdigotest/exemplary/simple-web-banner.json b/adapters/playdigo/playdigotest/exemplary/simple-web-banner.json index 57e694e95cf..dfb69f1b959 100644 --- a/adapters/playdigo/playdigotest/exemplary/simple-web-banner.json +++ b/adapters/playdigo/playdigotest/exemplary/simple-web-banner.json @@ -89,6 +89,7 @@ "cid": "test_cid", "crid": "test_crid", "dealid": "test_dealid", + "mtype": 1, "w": 468, "h": 60, "ext": { @@ -118,6 +119,7 @@ "cid": "test_cid", "crid": "test_crid", "dealid": "test_dealid", + "mtype": 1, "w": 468, "h": 60, "ext": { diff --git a/adapters/playdigo/playdigotest/supplemental/bad_media_type.json b/adapters/playdigo/playdigotest/supplemental/bad_media_type.json index f2badaaeb40..e00ae157763 100644 --- a/adapters/playdigo/playdigotest/supplemental/bad_media_type.json +++ b/adapters/playdigo/playdigotest/supplemental/bad_media_type.json @@ -76,7 +76,7 @@ }], "expectedMakeBidsErrors": [ { - "value": "imp test-imp-id with unknown media type", + "value": "could not define media type for impression: test-imp-id", "comparison": "literal" } ] From 4ec3064ce945dbf8b98d977f35e250a221ab2316 Mon Sep 17 00:00:00 2001 From: playdigo Date: Mon, 8 Jul 2024 14:55:30 +0300 Subject: [PATCH 3/5] add usersync --- static/bidder-info/playdigo.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/bidder-info/playdigo.yaml b/static/bidder-info/playdigo.yaml index 08e8e4766a4..5511c2390cf 100644 --- a/static/bidder-info/playdigo.yaml +++ b/static/bidder-info/playdigo.yaml @@ -14,3 +14,10 @@ capabilities: - banner - video - native +userSync: + redirect: + url: "https://cs.playdigo.com/pbserver?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&ccpa={{.USPrivacy}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}}&redir={{.RedirectURL}}" + userMacro: "[UID]" + iframe: + url: "https://cs.playdigo.com/pbserverIframe?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&ccpa={{.USPrivacy}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}}&pbserverUrl={{.RedirectURL}}" + userMacro: "[UID]" \ No newline at end of file From 2ffbb78c1784e4ed936d89359a51c04cfb0bfdef Mon Sep 17 00:00:00 2001 From: playdigo Date: Mon, 8 Jul 2024 14:56:39 +0300 Subject: [PATCH 4/5] yaml fix --- static/bidder-info/playdigo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/bidder-info/playdigo.yaml b/static/bidder-info/playdigo.yaml index 5511c2390cf..1ca35cfd0a2 100644 --- a/static/bidder-info/playdigo.yaml +++ b/static/bidder-info/playdigo.yaml @@ -20,4 +20,4 @@ userSync: userMacro: "[UID]" iframe: url: "https://cs.playdigo.com/pbserverIframe?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&ccpa={{.USPrivacy}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}}&pbserverUrl={{.RedirectURL}}" - userMacro: "[UID]" \ No newline at end of file + userMacro: "[UID]" From b872dbfb1a29024a7cf9dbcbda7b88d796d3753a Mon Sep 17 00:00:00 2001 From: playdigo Date: Tue, 27 Aug 2024 19:38:41 +0300 Subject: [PATCH 5/5] add gvl id --- static/bidder-info/playdigo.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/static/bidder-info/playdigo.yaml b/static/bidder-info/playdigo.yaml index 1ca35cfd0a2..b90b680f183 100644 --- a/static/bidder-info/playdigo.yaml +++ b/static/bidder-info/playdigo.yaml @@ -3,6 +3,7 @@ geoscope: - USA maintainer: email: "yr@playdigo.com" +gvlVendorID: 1302 capabilities: site: mediaTypes: