From d7218f04c2e1b053d1229aeb3021c4e21608acbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Thu, 2 May 2024 11:46:00 +0300 Subject: [PATCH 01/30] admatic s2s --- adapters/admatic/admatic.go | 145 ++++++++++++++++++ adapters/admatic/admatic_test.go | 21 +++ .../admatic/admatictest/exemplary/banner.json | 93 +++++++++++ .../admatic/admatictest/exemplary/native.json | 81 ++++++++++ .../exemplary/optional-params.json | 97 ++++++++++++ .../admatic/admatictest/exemplary/video.json | 91 +++++++++++ .../response-200-without-body.json | 51 ++++++ .../supplemental/response-204.json | 46 ++++++ .../supplemental/server-error.json | 46 ++++++ adapters/admatic/params_test.go | 53 +++++++ exchange/adapter_builders.go | 2 + openrtb_ext/bidders.go | 2 + openrtb_ext/imp_admatic.go | 5 + static/bidder-info/admatic.yaml | 22 +++ static/bidder-params/admatic.json | 15 ++ 15 files changed, 770 insertions(+) create mode 100644 adapters/admatic/admatic.go create mode 100644 adapters/admatic/admatic_test.go create mode 100644 adapters/admatic/admatictest/exemplary/banner.json create mode 100644 adapters/admatic/admatictest/exemplary/native.json create mode 100644 adapters/admatic/admatictest/exemplary/optional-params.json create mode 100644 adapters/admatic/admatictest/exemplary/video.json create mode 100644 adapters/admatic/admatictest/supplemental/response-200-without-body.json create mode 100644 adapters/admatic/admatictest/supplemental/response-204.json create mode 100644 adapters/admatic/admatictest/supplemental/server-error.json create mode 100644 adapters/admatic/params_test.go create mode 100644 openrtb_ext/imp_admatic.go create mode 100644 static/bidder-info/admatic.yaml create mode 100644 static/bidder-params/admatic.json diff --git a/adapters/admatic/admatic.go b/adapters/admatic/admatic.go new file mode 100644 index 00000000000..26d18462507 --- /dev/null +++ b/adapters/admatic/admatic.go @@ -0,0 +1,145 @@ +package admatic + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + "text/template" + + "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/errortypes" + "github.com/prebid/prebid-server/v2/macros" + "github.com/prebid/prebid-server/v2/openrtb_ext" +) + +type adapter struct { + endpoint *template.Template +} + +func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) { + endpointTemplate, err := template.New("endpointTemplate").Parse(config.Endpoint) + if err != nil { + return nil, fmt.Errorf("unable to parse endpoint template: %v", err) + } + + bidder := &adapter{ + endpoint: endpointTemplate, + } + return bidder, nil +} + +func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) { + + host := "" + + for _, imp := range request.Imp { + admaticExt, err := getImpressionExt(imp) + if err != nil { + return nil, []error{err} + } + + if host == "" { + host = admaticExt.Host + } else if host != admaticExt.Host { + return nil, []error{&errortypes.BadInput{ + Message: "There must be only one Host", + }} + } + } + + resolvedUrl, err := a.resolveUrl(host) + + if err != nil { + return nil, []error{err} + } + requestJSON, err := json.Marshal(request) + if err != nil { + return nil, []error{err} + } + requestData := &adapters.RequestData{ + Method: "POST", + Uri: resolvedUrl, + Body: requestJSON, + } + + return []*adapters.RequestData{requestData}, nil +} + +func getImpressionExt(imp openrtb2.Imp) (*openrtb_ext.ImpExtAdmatic, error) { + var bidderExt adapters.ExtImpBidder + if err := json.Unmarshal(imp.Ext, &bidderExt); err != nil { + return nil, &errortypes.BadInput{ + Message: "Bidder extension not provided or can't be unmarshalled", + } + } + + var admaticExt openrtb_ext.ImpExtAdmatic + if err := json.Unmarshal(bidderExt.Bidder, &admaticExt); err != nil { + return nil, &errortypes.BadInput{ + Message: "Error while unmarshaling bidder extension", + } + } + + return &admaticExt, nil +} + +// "Un-templates" the endpoint by replacing macroses and adding the required query parameters +func (a *adapter) resolveUrl(host string) (string, error) { + params := macros.EndpointTemplateParams{Host: host} + + endpointStr, err := macros.ResolveMacros(a.endpoint, params) + if err != nil { + return "", err + } + + parsedUrl, err := url.Parse(endpointStr) + if err != nil { + return "", err + } + + return parsedUrl.String(), nil +} + +func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.RequestData, responseData *adapters.ResponseData) (*adapters.BidderResponse, []error) { + if responseData.StatusCode == http.StatusNoContent { + return nil, nil + } + + 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 { + bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{ + Bid: &seatBid.Bid[i], + BidType: getMediaTypeForBid(seatBid.Bid[i].ImpID, request.Imp), + }) + } + } + return bidResponse, nil +} + +func getMediaTypeForBid(impID string, imps []openrtb2.Imp) openrtb_ext.BidType { + for _, imp := range imps { + if imp.ID == impID { + if imp.Banner != nil { + return openrtb_ext.BidTypeBanner + } else if imp.Video != nil { + return openrtb_ext.BidTypeVideo + } else if imp.Native != nil { + return openrtb_ext.BidTypeNative + } + } + } + return "" +} diff --git a/adapters/admatic/admatic_test.go b/adapters/admatic/admatic_test.go new file mode 100644 index 00000000000..a7a6670bd93 --- /dev/null +++ b/adapters/admatic/admatic_test.go @@ -0,0 +1,21 @@ +package admatic + +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.BidderAdmatic, config.Adapter{ + Endpoint: "http://pbs.admatic.com.tr?host={{.Host}}"}, + config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1281, DataCenter: "2"}) + + if buildErr != nil { + t.Fatalf("Builder returned unexpected error %v", buildErr) + } + + adapterstest.RunJSONBidderTest(t, "admatictest", bidder) +} diff --git a/adapters/admatic/admatictest/exemplary/banner.json b/adapters/admatic/admatictest/exemplary/banner.json new file mode 100644 index 00000000000..59e06a5198c --- /dev/null +++ b/adapters/admatic/admatictest/exemplary/banner.json @@ -0,0 +1,93 @@ +{ + "mockBidRequest": { + "id": "test-request-id-banner", + "imp": [ + { + "id": "test-imp-id-banner", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "admatic.rtb.admatic.com.tr" + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://pbs.admatic.com.tr?host=admatic.rtb.admatic.com.tr", + "body": { + "id": "test-request-id-banner", + "imp": [ + { + "id": "test-imp-id-banner", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "admatic.rtb.admatic.com.tr" + } + } + } + ] + } + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id-banner", + "seatbid": [ + { + "seat": "admatic", + "bid": [ + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-banner", + "price": 0.500000, + "adm": "some-test-ad-banner", + "crid": "crid_10", + "w": 728, + "h": 90 + } + ] + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-banner", + "price": 0.5, + "adm": "some-test-ad-banner", + "crid": "crid_10", + "w": 728, + "h": 90 + }, + "type": "banner" + } + ] + } + ] +} diff --git a/adapters/admatic/admatictest/exemplary/native.json b/adapters/admatic/admatictest/exemplary/native.json new file mode 100644 index 00000000000..1562ea020ae --- /dev/null +++ b/adapters/admatic/admatictest/exemplary/native.json @@ -0,0 +1,81 @@ +{ + "mockBidRequest": { + "id": "test-request-id-native", + "imp": [ + { + "id": "test-imp-id-native", + "native": { + "request": "" + }, + "ext": { + "bidder": { + "host": "admatic.rtb.admatic.com.tr" + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://pbs.admatic.com.tr?host=admatic.rtb.admatic.com.tr", + "body": { + "id": "test-request-id-native", + "imp": [ + { + "id": "test-imp-id-native", + "native": { + "request": "" + }, + "ext": { + "bidder": { + "host": "admatic.rtb.admatic.com.tr" + } + } + } + ] + } + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id-native", + "seatbid": [ + { + "seat": "admatic", + "bid": [{ + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-native", + "price": 0.500000, + "adm": "some-test-ad-native", + "crid": "crid_10", + "w": 728, + "h": 90 + }] + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-native", + "price": 0.5, + "adm": "some-test-ad-native", + "crid": "crid_10", + "w": 728, + "h": 90 + }, + "type": "native" + } + ] + } + ] +} diff --git a/adapters/admatic/admatictest/exemplary/optional-params.json b/adapters/admatic/admatictest/exemplary/optional-params.json new file mode 100644 index 00000000000..abedf0f0671 --- /dev/null +++ b/adapters/admatic/admatictest/exemplary/optional-params.json @@ -0,0 +1,97 @@ +{ + "mockBidRequest": { + "id": "test-request-id-banner", + "imp": [ + { + "id": "test-imp-id-banner", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "admatic.rtb.admatic.com.tr", + "bidFloor": 0.10, + "isTest": false + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://pbs.admatic.com.tr?host=admatic.rtb.admatic.com.tr", + "body": { + "id": "test-request-id-banner", + "imp": [ + { + "id": "test-imp-id-banner", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "admatic.rtb.admatic.com.tr", + "bidFloor": 0.10, + "isTest": false + } + } + } + ] + } + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id-banner", + "seatbid": [ + { + "seat": "admatic", + "bid": [ + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-banner", + "price": 0.500000, + "adm": "some-test-ad-banner", + "crid": "crid_10", + "w": 728, + "h": 90 + } + ] + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-banner", + "price": 0.5, + "adm": "some-test-ad-banner", + "crid": "crid_10", + "w": 728, + "h": 90 + }, + "type": "banner" + } + ] + } + ] +} diff --git a/adapters/admatic/admatictest/exemplary/video.json b/adapters/admatic/admatictest/exemplary/video.json new file mode 100644 index 00000000000..7a7742d7edb --- /dev/null +++ b/adapters/admatic/admatictest/exemplary/video.json @@ -0,0 +1,91 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-video-id", + "video": { + "mimes": ["video/mp4"], + "w": 300, + "h": 250 + }, + "ext": { + "bidder": { + "host": "admatic.rtb.admatic.com.tr" + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://pbs.admatic.com.tr?host=admatic.rtb.admatic.com.tr", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-video-id", + "video": { + "mimes": ["video/mp4"], + "w": 300, + "h": 250 + }, + "ext": { + "bidder": { + "host": "admatic.rtb.admatic.com.tr" + } + } + } + ] + } + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id-test-video-id", + "seatbid": [ + { + "seat": "test-seat", + "bid": [ + { + "id": "5dce6055-a93c-1fd0-8c29-14afc3e510fd", + "impid": "test-video-id", + "price": 0.1529, + "nurl": "test-win", + "adm": "test-video", + "adid": "92-288", + "adomain": ["advertiserdomain.com"], + "crid": "288", + "w": 300, + "h": 250 + } + ] + } + ] + } + } + } + ], + "expectedBidResponses": [ + { + "bids": [ + { + "bid": { + "id": "5dce6055-a93c-1fd0-8c29-14afc3e510fd", + "impid": "test-video-id", + "price": 0.1529, + "nurl": "test-win", + "adm": "test-video", + "adid": "92-288", + "adomain": ["advertiserdomain.com"], + "crid": "288", + "w": 300, + "h": 250 + }, + "type": "video" + } + ] + } + ] +} diff --git a/adapters/admatic/admatictest/supplemental/response-200-without-body.json b/adapters/admatic/admatictest/supplemental/response-200-without-body.json new file mode 100644 index 00000000000..cda256e6e71 --- /dev/null +++ b/adapters/admatic/admatictest/supplemental/response-200-without-body.json @@ -0,0 +1,51 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [{"w": 728, "h": 90}] + }, + "ext": { + "bidder": { + "host": "admatic.rtb.admatic.com.tr" + } + } + } + ] + }, + + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://pbs.admatic.com.tr?host=admatic.rtb.admatic.com.tr", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [{"w": 728, "h": 90}] + }, + "ext": { + "bidder": { + "host": "admatic.rtb.admatic.com.tr" + } + } + } + ] + } + }, + "mockResponse": { + "status": 200 + } + } + ], + "expectedMakeBidsErrors": [ + { + "value": "unexpected end of JSON input", + "comparison": "literal" + } + ] +} diff --git a/adapters/admatic/admatictest/supplemental/response-204.json b/adapters/admatic/admatictest/supplemental/response-204.json new file mode 100644 index 00000000000..2384f7b0723 --- /dev/null +++ b/adapters/admatic/admatictest/supplemental/response-204.json @@ -0,0 +1,46 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [{"w": 728, "h": 90}] + }, + "ext": { + "bidder": { + "host": "admatic.rtb.admatic.com.tr" + } + } + } + ] + }, + + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://pbs.admatic.com.tr?host=admatic.rtb.admatic.com.tr", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [{"w": 728, "h": 90}] + }, + "ext": { + "bidder": { + "host": "admatic.rtb.admatic.com.tr" + } + } + } + ] + } + }, + "mockResponse": { + "status": 204 + } + } + ], + "expectedBidResponses": [] +} diff --git a/adapters/admatic/admatictest/supplemental/server-error.json b/adapters/admatic/admatictest/supplemental/server-error.json new file mode 100644 index 00000000000..7305845a7f8 --- /dev/null +++ b/adapters/admatic/admatictest/supplemental/server-error.json @@ -0,0 +1,46 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [{"w": 728, "h": 90}] + }, + "ext": { + "bidder": { + "host": "admatic.rtb.admatic.com.tr" + } + } + } + ] + }, + + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://pbs.admatic.com.tr?host=admatic.rtb.admatic.com.tr", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [{"w": 728, "h": 90}] + }, + "ext": { + "bidder": { + "host": "admatic.rtb.admatic.com.tr" + } + } + } + ] + } + }, + "mockResponse": { + "status": 204 + } + } + ], + "expectedBidResponses": [] +} diff --git a/adapters/admatic/params_test.go b/adapters/admatic/params_test.go new file mode 100644 index 00000000000..a800536ed23 --- /dev/null +++ b/adapters/admatic/params_test.go @@ -0,0 +1,53 @@ +package admatic + +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.BidderAdmatic, 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.BidderAdmatic, json.RawMessage(p)); err == nil { + t.Errorf("Schema allowed invalid params: %s", p) + } + } +} + +var validParams = []string{ + `{ "host": "admatic.rtb.admatic.com.tr", + "ext": { + "key1": "value1", + "key2": "value2" + } + }`, + `{"host": "admatic.rtb.admatic.com.tr"}`, +} + +var invalidParams = []string{ + `{"ext": { + "key1": "value1", + "key2": "value2" + }`, + `{}`, + `{"host": 123}`, +} diff --git a/exchange/adapter_builders.go b/exchange/adapter_builders.go index 09c7bf83777..58e54cb2f0b 100755 --- a/exchange/adapter_builders.go +++ b/exchange/adapter_builders.go @@ -13,6 +13,7 @@ import ( "github.com/prebid/prebid-server/v2/adapters/adkernel" "github.com/prebid/prebid-server/v2/adapters/adkernelAdn" "github.com/prebid/prebid-server/v2/adapters/adman" + "github.com/prebid/prebid-server/v2/adapters/admatic" "github.com/prebid/prebid-server/v2/adapters/admixer" "github.com/prebid/prebid-server/v2/adapters/adnuntius" "github.com/prebid/prebid-server/v2/adapters/adocean" @@ -223,6 +224,7 @@ func newAdapterBuilders() map[openrtb_ext.BidderName]adapters.Builder { openrtb_ext.BidderAdkernel: adkernel.Builder, openrtb_ext.BidderAdkernelAdn: adkernelAdn.Builder, openrtb_ext.BidderAdman: adman.Builder, + openrtb_ext.BidderAdmatic: admatic.Builder, openrtb_ext.BidderAdmixer: admixer.Builder, openrtb_ext.BidderAdnuntius: adnuntius.Builder, openrtb_ext.BidderAdOcean: adocean.Builder, diff --git a/openrtb_ext/bidders.go b/openrtb_ext/bidders.go index 5f6e35452d5..bbc4c6a1072 100644 --- a/openrtb_ext/bidders.go +++ b/openrtb_ext/bidders.go @@ -29,6 +29,7 @@ var coreBidderNames []BidderName = []BidderName{ BidderAdkernel, BidderAdkernelAdn, BidderAdman, + BidderAdmatic, BidderAdmixer, BidderAdnuntius, BidderAdOcean, @@ -317,6 +318,7 @@ const ( BidderAdkernel BidderName = "adkernel" BidderAdkernelAdn BidderName = "adkernelAdn" BidderAdman BidderName = "adman" + BidderAdmatic BidderName = "admatic" BidderAdmixer BidderName = "admixer" BidderAdnuntius BidderName = "adnuntius" BidderAdOcean BidderName = "adocean" diff --git a/openrtb_ext/imp_admatic.go b/openrtb_ext/imp_admatic.go new file mode 100644 index 00000000000..31a14478f8e --- /dev/null +++ b/openrtb_ext/imp_admatic.go @@ -0,0 +1,5 @@ +package openrtb_ext + +type ImpExtAdmatic struct { + Host string `json:"host"` +} diff --git a/static/bidder-info/admatic.yaml b/static/bidder-info/admatic.yaml new file mode 100644 index 00000000000..18db5311580 --- /dev/null +++ b/static/bidder-info/admatic.yaml @@ -0,0 +1,22 @@ +endpoint: "http://pbs.admatic.com.tr?host={{.Host}}" +endpointCompression: gzip +maintainer: + email: "prebid@admatic.com.tr" +gvlVendorID: 1281 +modifyingVastXmlAllowed: true +capabilities: + app: + mediaTypes: + - banner + - video + - native + site: + mediaTypes: + - banner + - video + - native +userSync: + # admatic supports user syncing, but requires configuration by the host. contact this + # bidder directly at the email address in this file to ask about enabling user sync. + supports: + - iframe diff --git a/static/bidder-params/admatic.json b/static/bidder-params/admatic.json new file mode 100644 index 00000000000..bab135ab48d --- /dev/null +++ b/static/bidder-params/admatic.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Pixad Adapter Params", + "description": "A schema which validates params accepted by the Pixad adapter", + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "Host Name" + } + }, + "required": [ + "host" + ] +} \ No newline at end of file From 546cda39aefb8e68271257fe37433868e379a099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Thu, 2 May 2024 17:13:44 +0300 Subject: [PATCH 02/30] Update admatic.go --- adapters/admatic/admatic.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/adapters/admatic/admatic.go b/adapters/admatic/admatic.go index 26d18462507..704bc37c345 100644 --- a/adapters/admatic/admatic.go +++ b/adapters/admatic/admatic.go @@ -55,10 +55,12 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte if err != nil { return nil, []error{err} } + requestJSON, err := json.Marshal(request) if err != nil { return nil, []error{err} } + requestData := &adapters.RequestData{ Method: "POST", Uri: resolvedUrl, From 435b598b470af818a1eee7bfb085fb31982dbea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Thu, 2 May 2024 17:19:44 +0300 Subject: [PATCH 03/30] formatted jsons --- .../admatic/admatictest/exemplary/banner.json | 2 +- .../admatic/admatictest/exemplary/native.json | 20 ++++++++++--------- .../exemplary/optional-params.json | 6 +++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/adapters/admatic/admatictest/exemplary/banner.json b/adapters/admatic/admatictest/exemplary/banner.json index 59e06a5198c..7cf7f3c06f4 100644 --- a/adapters/admatic/admatictest/exemplary/banner.json +++ b/adapters/admatic/admatictest/exemplary/banner.json @@ -57,7 +57,7 @@ { "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", "impid": "test-imp-id-banner", - "price": 0.500000, + "price": 0.5, "adm": "some-test-ad-banner", "crid": "crid_10", "w": 728, diff --git a/adapters/admatic/admatictest/exemplary/native.json b/adapters/admatic/admatictest/exemplary/native.json index 1562ea020ae..1bff31628f2 100644 --- a/adapters/admatic/admatictest/exemplary/native.json +++ b/adapters/admatic/admatictest/exemplary/native.json @@ -43,15 +43,17 @@ "seatbid": [ { "seat": "admatic", - "bid": [{ - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id-native", - "price": 0.500000, - "adm": "some-test-ad-native", - "crid": "crid_10", - "w": 728, - "h": 90 - }] + "bid": [ + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-native", + "price": 0.5, + "adm": "some-test-ad-native", + "crid": "crid_10", + "w": 728, + "h": 90 + } + ] } ], "cur": "USD" diff --git a/adapters/admatic/admatictest/exemplary/optional-params.json b/adapters/admatic/admatictest/exemplary/optional-params.json index abedf0f0671..dbe0214bbf6 100644 --- a/adapters/admatic/admatictest/exemplary/optional-params.json +++ b/adapters/admatic/admatictest/exemplary/optional-params.json @@ -15,7 +15,7 @@ "ext": { "bidder": { "host": "admatic.rtb.admatic.com.tr", - "bidFloor": 0.10, + "bidFloor": 0.1, "isTest": false } } @@ -42,7 +42,7 @@ "ext": { "bidder": { "host": "admatic.rtb.admatic.com.tr", - "bidFloor": 0.10, + "bidFloor": 0.1, "isTest": false } } @@ -61,7 +61,7 @@ { "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", "impid": "test-imp-id-banner", - "price": 0.500000, + "price": 0.5, "adm": "some-test-ad-banner", "crid": "crid_10", "w": 728, From dbec2dee69ba810f0cfd9316ec8813ce3f13736d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Thu, 2 May 2024 17:34:28 +0300 Subject: [PATCH 04/30] fmt --- adapters/admatic/admatic.go | 294 +++++++++++++++---------------- adapters/admatic/admatic_test.go | 42 ++--- adapters/admatic/params_test.go | 106 +++++------ openrtb_ext/imp_admatic.go | 10 +- 4 files changed, 226 insertions(+), 226 deletions(-) diff --git a/adapters/admatic/admatic.go b/adapters/admatic/admatic.go index 704bc37c345..8e713b4836f 100644 --- a/adapters/admatic/admatic.go +++ b/adapters/admatic/admatic.go @@ -1,147 +1,147 @@ -package admatic - -import ( - "encoding/json" - "fmt" - "net/http" - "net/url" - "text/template" - - "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/errortypes" - "github.com/prebid/prebid-server/v2/macros" - "github.com/prebid/prebid-server/v2/openrtb_ext" -) - -type adapter struct { - endpoint *template.Template -} - -func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) { - endpointTemplate, err := template.New("endpointTemplate").Parse(config.Endpoint) - if err != nil { - return nil, fmt.Errorf("unable to parse endpoint template: %v", err) - } - - bidder := &adapter{ - endpoint: endpointTemplate, - } - return bidder, nil -} - -func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) { - - host := "" - - for _, imp := range request.Imp { - admaticExt, err := getImpressionExt(imp) - if err != nil { - return nil, []error{err} - } - - if host == "" { - host = admaticExt.Host - } else if host != admaticExt.Host { - return nil, []error{&errortypes.BadInput{ - Message: "There must be only one Host", - }} - } - } - - resolvedUrl, err := a.resolveUrl(host) - - if err != nil { - return nil, []error{err} - } - - requestJSON, err := json.Marshal(request) - if err != nil { - return nil, []error{err} - } - - requestData := &adapters.RequestData{ - Method: "POST", - Uri: resolvedUrl, - Body: requestJSON, - } - - return []*adapters.RequestData{requestData}, nil -} - -func getImpressionExt(imp openrtb2.Imp) (*openrtb_ext.ImpExtAdmatic, error) { - var bidderExt adapters.ExtImpBidder - if err := json.Unmarshal(imp.Ext, &bidderExt); err != nil { - return nil, &errortypes.BadInput{ - Message: "Bidder extension not provided or can't be unmarshalled", - } - } - - var admaticExt openrtb_ext.ImpExtAdmatic - if err := json.Unmarshal(bidderExt.Bidder, &admaticExt); err != nil { - return nil, &errortypes.BadInput{ - Message: "Error while unmarshaling bidder extension", - } - } - - return &admaticExt, nil -} - -// "Un-templates" the endpoint by replacing macroses and adding the required query parameters -func (a *adapter) resolveUrl(host string) (string, error) { - params := macros.EndpointTemplateParams{Host: host} - - endpointStr, err := macros.ResolveMacros(a.endpoint, params) - if err != nil { - return "", err - } - - parsedUrl, err := url.Parse(endpointStr) - if err != nil { - return "", err - } - - return parsedUrl.String(), nil -} - -func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.RequestData, responseData *adapters.ResponseData) (*adapters.BidderResponse, []error) { - if responseData.StatusCode == http.StatusNoContent { - return nil, nil - } - - 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 { - bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{ - Bid: &seatBid.Bid[i], - BidType: getMediaTypeForBid(seatBid.Bid[i].ImpID, request.Imp), - }) - } - } - return bidResponse, nil -} - -func getMediaTypeForBid(impID string, imps []openrtb2.Imp) openrtb_ext.BidType { - for _, imp := range imps { - if imp.ID == impID { - if imp.Banner != nil { - return openrtb_ext.BidTypeBanner - } else if imp.Video != nil { - return openrtb_ext.BidTypeVideo - } else if imp.Native != nil { - return openrtb_ext.BidTypeNative - } - } - } - return "" -} +package admatic + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + "text/template" + + "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/errortypes" + "github.com/prebid/prebid-server/v2/macros" + "github.com/prebid/prebid-server/v2/openrtb_ext" +) + +type adapter struct { + endpoint *template.Template +} + +func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) { + endpointTemplate, err := template.New("endpointTemplate").Parse(config.Endpoint) + if err != nil { + return nil, fmt.Errorf("unable to parse endpoint template: %v", err) + } + + bidder := &adapter{ + endpoint: endpointTemplate, + } + return bidder, nil +} + +func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) { + + host := "" + + for _, imp := range request.Imp { + admaticExt, err := getImpressionExt(imp) + if err != nil { + return nil, []error{err} + } + + if host == "" { + host = admaticExt.Host + } else if host != admaticExt.Host { + return nil, []error{&errortypes.BadInput{ + Message: "There must be only one Host", + }} + } + } + + resolvedUrl, err := a.resolveUrl(host) + + if err != nil { + return nil, []error{err} + } + + requestJSON, err := json.Marshal(request) + if err != nil { + return nil, []error{err} + } + + requestData := &adapters.RequestData{ + Method: "POST", + Uri: resolvedUrl, + Body: requestJSON, + } + + return []*adapters.RequestData{requestData}, nil +} + +func getImpressionExt(imp openrtb2.Imp) (*openrtb_ext.ImpExtAdmatic, error) { + var bidderExt adapters.ExtImpBidder + if err := json.Unmarshal(imp.Ext, &bidderExt); err != nil { + return nil, &errortypes.BadInput{ + Message: "Bidder extension not provided or can't be unmarshalled", + } + } + + var admaticExt openrtb_ext.ImpExtAdmatic + if err := json.Unmarshal(bidderExt.Bidder, &admaticExt); err != nil { + return nil, &errortypes.BadInput{ + Message: "Error while unmarshaling bidder extension", + } + } + + return &admaticExt, nil +} + +// "Un-templates" the endpoint by replacing macroses and adding the required query parameters +func (a *adapter) resolveUrl(host string) (string, error) { + params := macros.EndpointTemplateParams{Host: host} + + endpointStr, err := macros.ResolveMacros(a.endpoint, params) + if err != nil { + return "", err + } + + parsedUrl, err := url.Parse(endpointStr) + if err != nil { + return "", err + } + + return parsedUrl.String(), nil +} + +func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.RequestData, responseData *adapters.ResponseData) (*adapters.BidderResponse, []error) { + if responseData.StatusCode == http.StatusNoContent { + return nil, nil + } + + 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 { + bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{ + Bid: &seatBid.Bid[i], + BidType: getMediaTypeForBid(seatBid.Bid[i].ImpID, request.Imp), + }) + } + } + return bidResponse, nil +} + +func getMediaTypeForBid(impID string, imps []openrtb2.Imp) openrtb_ext.BidType { + for _, imp := range imps { + if imp.ID == impID { + if imp.Banner != nil { + return openrtb_ext.BidTypeBanner + } else if imp.Video != nil { + return openrtb_ext.BidTypeVideo + } else if imp.Native != nil { + return openrtb_ext.BidTypeNative + } + } + } + return "" +} diff --git a/adapters/admatic/admatic_test.go b/adapters/admatic/admatic_test.go index a7a6670bd93..95f9a47894c 100644 --- a/adapters/admatic/admatic_test.go +++ b/adapters/admatic/admatic_test.go @@ -1,21 +1,21 @@ -package admatic - -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.BidderAdmatic, config.Adapter{ - Endpoint: "http://pbs.admatic.com.tr?host={{.Host}}"}, - config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1281, DataCenter: "2"}) - - if buildErr != nil { - t.Fatalf("Builder returned unexpected error %v", buildErr) - } - - adapterstest.RunJSONBidderTest(t, "admatictest", bidder) -} +package admatic + +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.BidderAdmatic, config.Adapter{ + Endpoint: "http://pbs.admatic.com.tr?host={{.Host}}"}, + config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1281, DataCenter: "2"}) + + if buildErr != nil { + t.Fatalf("Builder returned unexpected error %v", buildErr) + } + + adapterstest.RunJSONBidderTest(t, "admatictest", bidder) +} diff --git a/adapters/admatic/params_test.go b/adapters/admatic/params_test.go index a800536ed23..2103bd3e42f 100644 --- a/adapters/admatic/params_test.go +++ b/adapters/admatic/params_test.go @@ -1,53 +1,53 @@ -package admatic - -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.BidderAdmatic, 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.BidderAdmatic, json.RawMessage(p)); err == nil { - t.Errorf("Schema allowed invalid params: %s", p) - } - } -} - -var validParams = []string{ - `{ "host": "admatic.rtb.admatic.com.tr", - "ext": { - "key1": "value1", - "key2": "value2" - } - }`, - `{"host": "admatic.rtb.admatic.com.tr"}`, -} - -var invalidParams = []string{ - `{"ext": { - "key1": "value1", - "key2": "value2" - }`, - `{}`, - `{"host": 123}`, -} +package admatic + +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.BidderAdmatic, 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.BidderAdmatic, json.RawMessage(p)); err == nil { + t.Errorf("Schema allowed invalid params: %s", p) + } + } +} + +var validParams = []string{ + `{ "host": "admatic.rtb.admatic.com.tr", + "ext": { + "key1": "value1", + "key2": "value2" + } + }`, + `{"host": "admatic.rtb.admatic.com.tr"}`, +} + +var invalidParams = []string{ + `{"ext": { + "key1": "value1", + "key2": "value2" + }`, + `{}`, + `{"host": 123}`, +} diff --git a/openrtb_ext/imp_admatic.go b/openrtb_ext/imp_admatic.go index 31a14478f8e..2cc2f326f56 100644 --- a/openrtb_ext/imp_admatic.go +++ b/openrtb_ext/imp_admatic.go @@ -1,5 +1,5 @@ -package openrtb_ext - -type ImpExtAdmatic struct { - Host string `json:"host"` -} +package openrtb_ext + +type ImpExtAdmatic struct { + Host string `json:"host"` +} From 094bd524fbe5f1c0a050312202649d160221c5dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Tue, 14 May 2024 09:55:08 +0300 Subject: [PATCH 05/30] Update admatic.go --- adapters/admatic/admatic.go | 1 + 1 file changed, 1 insertion(+) diff --git a/adapters/admatic/admatic.go b/adapters/admatic/admatic.go index 8e713b4836f..79180e8a458 100644 --- a/adapters/admatic/admatic.go +++ b/adapters/admatic/admatic.go @@ -65,6 +65,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte Method: "POST", Uri: resolvedUrl, Body: requestJSON, + ImpIDs: openrtb_ext.GetImpIDs(request.Imp), } return []*adapters.RequestData{requestData}, nil From bc0468f876587d904062aa8e8cbc853eb0ce1816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Thu, 23 May 2024 10:09:49 +0300 Subject: [PATCH 06/30] impIDs --- adapters/admatic/admatictest/exemplary/banner.json | 3 ++- adapters/admatic/admatictest/exemplary/native.json | 3 ++- adapters/admatic/admatictest/exemplary/optional-params.json | 3 ++- adapters/admatic/admatictest/exemplary/video.json | 3 ++- .../admatictest/supplemental/response-200-without-body.json | 3 ++- adapters/admatic/admatictest/supplemental/response-204.json | 3 ++- adapters/admatic/admatictest/supplemental/server-error.json | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/adapters/admatic/admatictest/exemplary/banner.json b/adapters/admatic/admatictest/exemplary/banner.json index 7cf7f3c06f4..3a9736a9bf5 100644 --- a/adapters/admatic/admatictest/exemplary/banner.json +++ b/adapters/admatic/admatictest/exemplary/banner.json @@ -44,7 +44,8 @@ } } ] - } + }, + "impIDs": ["test-imp-id-banner"] }, "mockResponse": { "status": 200, diff --git a/adapters/admatic/admatictest/exemplary/native.json b/adapters/admatic/admatictest/exemplary/native.json index 1bff31628f2..284a75ef654 100644 --- a/adapters/admatic/admatictest/exemplary/native.json +++ b/adapters/admatic/admatictest/exemplary/native.json @@ -34,7 +34,8 @@ } } ] - } + }, + "impIDs": ["test-imp-id-native"] }, "mockResponse": { "status": 200, diff --git a/adapters/admatic/admatictest/exemplary/optional-params.json b/adapters/admatic/admatictest/exemplary/optional-params.json index dbe0214bbf6..54b03f318e5 100644 --- a/adapters/admatic/admatictest/exemplary/optional-params.json +++ b/adapters/admatic/admatictest/exemplary/optional-params.json @@ -48,7 +48,8 @@ } } ] - } + }, + "impIDs": ["test-imp-id-banner"] }, "mockResponse": { "status": 200, diff --git a/adapters/admatic/admatictest/exemplary/video.json b/adapters/admatic/admatictest/exemplary/video.json index 7a7742d7edb..53357972d72 100644 --- a/adapters/admatic/admatictest/exemplary/video.json +++ b/adapters/admatic/admatictest/exemplary/video.json @@ -38,7 +38,8 @@ } } ] - } + }, + "impIDs": ["test-video-id"] }, "mockResponse": { "status": 200, diff --git a/adapters/admatic/admatictest/supplemental/response-200-without-body.json b/adapters/admatic/admatictest/supplemental/response-200-without-body.json index cda256e6e71..78739496513 100644 --- a/adapters/admatic/admatictest/supplemental/response-200-without-body.json +++ b/adapters/admatic/admatictest/supplemental/response-200-without-body.json @@ -35,7 +35,8 @@ } } ] - } + }, + "impIDs": ["test-imp-id"] }, "mockResponse": { "status": 200 diff --git a/adapters/admatic/admatictest/supplemental/response-204.json b/adapters/admatic/admatictest/supplemental/response-204.json index 2384f7b0723..0f9bed26449 100644 --- a/adapters/admatic/admatictest/supplemental/response-204.json +++ b/adapters/admatic/admatictest/supplemental/response-204.json @@ -35,7 +35,8 @@ } } ] - } + }, + "impIDs": ["test-imp-id"] }, "mockResponse": { "status": 204 diff --git a/adapters/admatic/admatictest/supplemental/server-error.json b/adapters/admatic/admatictest/supplemental/server-error.json index 7305845a7f8..9b5152c06ea 100644 --- a/adapters/admatic/admatictest/supplemental/server-error.json +++ b/adapters/admatic/admatictest/supplemental/server-error.json @@ -35,7 +35,8 @@ } } ] - } + }, + "impIDs": ["test-imp-id"] }, "mockResponse": { "status": 204 From 60a434ce30723fecd169133e86b40a3bb0b4d9f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Thu, 23 May 2024 15:25:04 +0300 Subject: [PATCH 07/30] Update admatic.json --- static/bidder-params/admatic.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/bidder-params/admatic.json b/static/bidder-params/admatic.json index bab135ab48d..5cd1b6b5fb7 100644 --- a/static/bidder-params/admatic.json +++ b/static/bidder-params/admatic.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Pixad Adapter Params", - "description": "A schema which validates params accepted by the Pixad adapter", + "description": "A schema which validates params accepted by the AdMatic adapter", "type": "object", "properties": { "host": { From ac61d1c6d744408948dd39dcaac6a8c0e8e7fbcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Fri, 24 May 2024 11:34:46 +0300 Subject: [PATCH 08/30] Update admatic.go --- adapters/admatic/admatic.go | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/adapters/admatic/admatic.go b/adapters/admatic/admatic.go index 79180e8a458..fdeceb3927a 100644 --- a/adapters/admatic/admatic.go +++ b/adapters/admatic/admatic.go @@ -122,27 +122,36 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R } for _, seatBid := range response.SeatBid { - for i := range seatBid.Bid { + for _, bid := range seatBid.Bid { + bidMediaType, err := getMediaTypeForBid(request.Imp, bid) + if err != nil { + return nil, []error{err} + } bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{ - Bid: &seatBid.Bid[i], - BidType: getMediaTypeForBid(seatBid.Bid[i].ImpID, request.Imp), + Bid: &bid, + BidType: bidMediaType, }) } } return bidResponse, nil } -func getMediaTypeForBid(impID string, imps []openrtb2.Imp) openrtb_ext.BidType { - for _, imp := range imps { - if imp.ID == impID { - if imp.Banner != nil { - return openrtb_ext.BidTypeBanner - } else if imp.Video != nil { - return openrtb_ext.BidTypeVideo - } else if imp.Native != nil { - return openrtb_ext.BidTypeNative +func getMediaTypeForBid(impressions []openrtb2.Imp, bid openrtb2.Bid) (openrtb_ext.BidType, error) { + for _, impression := range impressions { + if impression.ID == bid.ImpID { + if impression.Banner != nil { + return openrtb_ext.BidTypeBanner, nil + } + if impression.Video != nil { + return openrtb_ext.BidTypeVideo, nil + } + if impression.Native != nil { + return openrtb_ext.BidTypeNative, nil } } } - return "" + + return "", &errortypes.BadServerResponse{ + Message: fmt.Sprintf("The impression with ID %s is not present into the request", bid.ImpID), + } } From f978cf017cf2b8099ac6bd4fd3acff500cecb456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Fri, 24 May 2024 11:37:33 +0300 Subject: [PATCH 09/30] Update admatic.go --- adapters/admatic/admatic.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adapters/admatic/admatic.go b/adapters/admatic/admatic.go index fdeceb3927a..8ec5e878dfd 100644 --- a/adapters/admatic/admatic.go +++ b/adapters/admatic/admatic.go @@ -120,17 +120,17 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R if len(response.Cur) != 0 { bidResponse.Currency = response.Cur } - for _, seatBid := range response.SeatBid { for _, bid := range seatBid.Bid { bidMediaType, err := getMediaTypeForBid(request.Imp, bid) if err != nil { return nil, []error{err} } - bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{ + b := &adapters.TypedBid{ Bid: &bid, BidType: bidMediaType, - }) + } + bidResponse.Bids = append(bidResponse.Bids, b) } } return bidResponse, nil From f025b87c96719e5cf0ea10b9831aaedd14c709ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Fri, 24 May 2024 15:30:44 +0300 Subject: [PATCH 10/30] Update admatic.yaml --- static/bidder-info/admatic.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/static/bidder-info/admatic.yaml b/static/bidder-info/admatic.yaml index 18db5311580..a63e910b3fe 100644 --- a/static/bidder-info/admatic.yaml +++ b/static/bidder-info/admatic.yaml @@ -1,9 +1,7 @@ endpoint: "http://pbs.admatic.com.tr?host={{.Host}}" -endpointCompression: gzip maintainer: email: "prebid@admatic.com.tr" gvlVendorID: 1281 -modifyingVastXmlAllowed: true capabilities: app: mediaTypes: From b02724b4a3b26eeadfea49e9a4db5b9479269c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Fri, 24 May 2024 15:35:58 +0300 Subject: [PATCH 11/30] Update admatic.go --- adapters/admatic/admatic.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/adapters/admatic/admatic.go b/adapters/admatic/admatic.go index 8ec5e878dfd..4ceec00b2a3 100644 --- a/adapters/admatic/admatic.go +++ b/adapters/admatic/admatic.go @@ -111,6 +111,13 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R return nil, nil } + if responseData.StatusCode != http.StatusOK { + err := &errortypes.BadServerResponse{ + Message: fmt.Sprintf("Unexpected status code: %d. Run with request.debug = 1 for more info.", responseData.StatusCode), + } + return nil, []error{err} + } + var response openrtb2.BidResponse if err := json.Unmarshal(responseData.Body, &response); err != nil { return nil, []error{err} From 63387d3e8ffc16bb47b9be7e4c0f2be142d8342a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Fri, 24 May 2024 15:41:10 +0300 Subject: [PATCH 12/30] Update admatic.go --- adapters/admatic/admatic.go | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/adapters/admatic/admatic.go b/adapters/admatic/admatic.go index 4ceec00b2a3..f0218b6580e 100644 --- a/adapters/admatic/admatic.go +++ b/adapters/admatic/admatic.go @@ -111,13 +111,6 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R return nil, nil } - if responseData.StatusCode != http.StatusOK { - err := &errortypes.BadServerResponse{ - Message: fmt.Sprintf("Unexpected status code: %d. Run with request.debug = 1 for more info.", responseData.StatusCode), - } - return nil, []error{err} - } - var response openrtb2.BidResponse if err := json.Unmarshal(responseData.Body, &response); err != nil { return nil, []error{err} @@ -127,38 +120,36 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R if len(response.Cur) != 0 { bidResponse.Currency = response.Cur } + for _, seatBid := range response.SeatBid { - for _, bid := range seatBid.Bid { - bidMediaType, err := getMediaTypeForBid(request.Imp, bid) + for i := range seatBid.Bid { + + bidMediaType, err := getMediaTypeForBid(seatBid.Bid[i].ImpID, request.Imp) if err != nil { return nil, []error{err} } - b := &adapters.TypedBid{ - Bid: &bid, + bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{ + Bid: &seatBid.Bid[i], BidType: bidMediaType, - } - bidResponse.Bids = append(bidResponse.Bids, b) + }) } } return bidResponse, nil } -func getMediaTypeForBid(impressions []openrtb2.Imp, bid openrtb2.Bid) (openrtb_ext.BidType, error) { - for _, impression := range impressions { - if impression.ID == bid.ImpID { - if impression.Banner != nil { +func getMediaTypeForBid(impID string, imps []openrtb2.Imp) (openrtb_ext.BidType, error) { + for _, imp := range imps { + if imp.ID == impID { + if imp.Banner != nil { return openrtb_ext.BidTypeBanner, nil - } - if impression.Video != nil { + } else if imp.Video != nil { return openrtb_ext.BidTypeVideo, nil - } - if impression.Native != nil { + } else if imp.Native != nil { return openrtb_ext.BidTypeNative, nil } } } - return "", &errortypes.BadServerResponse{ - Message: fmt.Sprintf("The impression with ID %s is not present into the request", bid.ImpID), + Message: fmt.Sprintf("The impression with ID %s is not present into the request", impID), } } From d1dfaef7c43f5a200056bf203a0cb21a8595ef19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:39:30 +0300 Subject: [PATCH 13/30] Update admatic.go --- adapters/admatic/admatic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapters/admatic/admatic.go b/adapters/admatic/admatic.go index f0218b6580e..9228e4a3110 100644 --- a/adapters/admatic/admatic.go +++ b/adapters/admatic/admatic.go @@ -89,7 +89,7 @@ func getImpressionExt(imp openrtb2.Imp) (*openrtb_ext.ImpExtAdmatic, error) { return &admaticExt, nil } -// "Un-templates" the endpoint by replacing macroses and adding the required query parameters +// resolveUrl "un-templates" the endpoint by replacing macroses and adding the required query parameters func (a *adapter) resolveUrl(host string) (string, error) { params := macros.EndpointTemplateParams{Host: host} From 655829180f756587e036dab0aec2c522ec2239bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Sat, 29 Jun 2024 13:10:42 +0300 Subject: [PATCH 14/30] solved problems --- adapters/admatic/admatic.go | 89 ++++++++----------- adapters/admatic/admatic_test.go | 8 ++ .../admatic/admatictest/exemplary/banner.json | 8 +- .../admatic/admatictest/exemplary/native.json | 8 +- .../exemplary/optional-params.json | 8 +- .../admatic/admatictest/exemplary/video.json | 8 +- .../response-200-without-body.json | 22 +++-- .../supplemental/response-204.json | 22 +++-- .../supplemental/server-error.json | 33 +++++-- adapters/admatic/params_test.go | 7 +- openrtb_ext/imp_admatic.go | 3 +- static/bidder-params/admatic.json | 9 +- 12 files changed, 136 insertions(+), 89 deletions(-) diff --git a/adapters/admatic/admatic.go b/adapters/admatic/admatic.go index 9228e4a3110..7d8bed496aa 100644 --- a/adapters/admatic/admatic.go +++ b/adapters/admatic/admatic.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" "net/http" - "net/url" "text/template" "github.com/prebid/openrtb/v20/openrtb2" @@ -32,85 +31,67 @@ func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server co } func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) { + var requests []*adapters.RequestData + var errs []error - host := "" - + requestCopy := *request for _, imp := range request.Imp { - admaticExt, err := getImpressionExt(imp) + requestCopy.Imp = []openrtb2.Imp{imp} + + endpoint, err := a.buildEndpointFromRequest(&imp) if err != nil { - return nil, []error{err} + errs = append(errs, err) + continue } - if host == "" { - host = admaticExt.Host - } else if host != admaticExt.Host { - return nil, []error{&errortypes.BadInput{ - Message: "There must be only one Host", - }} + requestJSON, err := json.Marshal(requestCopy) + if err != nil { + errs = append(errs, err) + continue } - } - - resolvedUrl, err := a.resolveUrl(host) - - if err != nil { - return nil, []error{err} - } - requestJSON, err := json.Marshal(request) - if err != nil { - return nil, []error{err} - } + request := &adapters.RequestData{ + Method: http.MethodPost, + Body: requestJSON, + Uri: endpoint, + ImpIDs: openrtb_ext.GetImpIDs(requestCopy.Imp), + } - requestData := &adapters.RequestData{ - Method: "POST", - Uri: resolvedUrl, - Body: requestJSON, - ImpIDs: openrtb_ext.GetImpIDs(request.Imp), + requests = append(requests, request) } - return []*adapters.RequestData{requestData}, nil + return requests, errs } -func getImpressionExt(imp openrtb2.Imp) (*openrtb_ext.ImpExtAdmatic, error) { - var bidderExt adapters.ExtImpBidder - if err := json.Unmarshal(imp.Ext, &bidderExt); err != nil { - return nil, &errortypes.BadInput{ - Message: "Bidder extension not provided or can't be unmarshalled", +func (a *adapter) buildEndpointFromRequest(imp *openrtb2.Imp) (string, error) { + var impExt adapters.ExtImpBidder + if err := json.Unmarshal(imp.Ext, &impExt); err != nil { + return "", &errortypes.BadInput{ + Message: fmt.Sprintf("Failed to deserialize bidder impression extension: %v", err), } } var admaticExt openrtb_ext.ImpExtAdmatic - if err := json.Unmarshal(bidderExt.Bidder, &admaticExt); err != nil { - return nil, &errortypes.BadInput{ - Message: "Error while unmarshaling bidder extension", + if err := json.Unmarshal(impExt.Bidder, &admaticExt); err != nil { + return "", &errortypes.BadInput{ + Message: fmt.Sprintf("Failed to deserialize AdMatic extension: %v", err), } } - return &admaticExt, nil -} - -// resolveUrl "un-templates" the endpoint by replacing macroses and adding the required query parameters -func (a *adapter) resolveUrl(host string) (string, error) { - params := macros.EndpointTemplateParams{Host: host} - - endpointStr, err := macros.ResolveMacros(a.endpoint, params) - if err != nil { - return "", err + endpointParams := macros.EndpointTemplateParams{ + Host: admaticExt.Host, } - parsedUrl, err := url.Parse(endpointStr) - if err != nil { - return "", err - } - - return parsedUrl.String(), nil + return macros.ResolveMacros(a.endpoint, endpointParams) } func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.RequestData, responseData *adapters.ResponseData) (*adapters.BidderResponse, []error) { - if responseData.StatusCode == http.StatusNoContent { + 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} diff --git a/adapters/admatic/admatic_test.go b/adapters/admatic/admatic_test.go index 95f9a47894c..7a16882fe46 100644 --- a/adapters/admatic/admatic_test.go +++ b/adapters/admatic/admatic_test.go @@ -6,6 +6,7 @@ import ( "github.com/prebid/prebid-server/v2/adapters/adapterstest" "github.com/prebid/prebid-server/v2/config" "github.com/prebid/prebid-server/v2/openrtb_ext" + "github.com/stretchr/testify/assert" ) func TestJsonSamples(t *testing.T) { @@ -19,3 +20,10 @@ func TestJsonSamples(t *testing.T) { adapterstest.RunJSONBidderTest(t, "admatictest", bidder) } + +func TestEndpointTemplateMalformed(t *testing.T) { + _, buildErr := Builder(openrtb_ext.BidderAso, config.Adapter{ + Endpoint: "host={{Host}}"}, config.Server{ExternalUrl: "http://hosturl.com"}) + + assert.Error(t, buildErr) +} diff --git a/adapters/admatic/admatictest/exemplary/banner.json b/adapters/admatic/admatictest/exemplary/banner.json index 3a9736a9bf5..5950034a61e 100644 --- a/adapters/admatic/admatictest/exemplary/banner.json +++ b/adapters/admatic/admatictest/exemplary/banner.json @@ -14,7 +14,8 @@ }, "ext": { "bidder": { - "host": "admatic.rtb.admatic.com.tr" + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 } } } @@ -23,7 +24,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.admatic.com.tr?host=admatic.rtb.admatic.com.tr", + "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id-banner", "imp": [ @@ -39,7 +40,8 @@ }, "ext": { "bidder": { - "host": "admatic.rtb.admatic.com.tr" + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 } } } diff --git a/adapters/admatic/admatictest/exemplary/native.json b/adapters/admatic/admatictest/exemplary/native.json index 284a75ef654..455406d05c2 100644 --- a/adapters/admatic/admatictest/exemplary/native.json +++ b/adapters/admatic/admatictest/exemplary/native.json @@ -9,7 +9,8 @@ }, "ext": { "bidder": { - "host": "admatic.rtb.admatic.com.tr" + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 } } } @@ -18,7 +19,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.admatic.com.tr?host=admatic.rtb.admatic.com.tr", + "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id-native", "imp": [ @@ -29,7 +30,8 @@ }, "ext": { "bidder": { - "host": "admatic.rtb.admatic.com.tr" + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 } } } diff --git a/adapters/admatic/admatictest/exemplary/optional-params.json b/adapters/admatic/admatictest/exemplary/optional-params.json index 54b03f318e5..e1652c30899 100644 --- a/adapters/admatic/admatictest/exemplary/optional-params.json +++ b/adapters/admatic/admatictest/exemplary/optional-params.json @@ -14,7 +14,8 @@ }, "ext": { "bidder": { - "host": "admatic.rtb.admatic.com.tr", + "host": "layer.serve.admatic.com.tr", + "networkId": 12345, "bidFloor": 0.1, "isTest": false } @@ -25,7 +26,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.admatic.com.tr?host=admatic.rtb.admatic.com.tr", + "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id-banner", "imp": [ @@ -41,7 +42,8 @@ }, "ext": { "bidder": { - "host": "admatic.rtb.admatic.com.tr", + "host": "layer.serve.admatic.com.tr", + "networkId": 12345, "bidFloor": 0.1, "isTest": false } diff --git a/adapters/admatic/admatictest/exemplary/video.json b/adapters/admatic/admatictest/exemplary/video.json index 53357972d72..58f5e89810b 100644 --- a/adapters/admatic/admatictest/exemplary/video.json +++ b/adapters/admatic/admatictest/exemplary/video.json @@ -11,7 +11,8 @@ }, "ext": { "bidder": { - "host": "admatic.rtb.admatic.com.tr" + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 } } } @@ -20,7 +21,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.admatic.com.tr?host=admatic.rtb.admatic.com.tr", + "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id", "imp": [ @@ -33,7 +34,8 @@ }, "ext": { "bidder": { - "host": "admatic.rtb.admatic.com.tr" + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 } } } diff --git a/adapters/admatic/admatictest/supplemental/response-200-without-body.json b/adapters/admatic/admatictest/supplemental/response-200-without-body.json index 78739496513..8db31ad713f 100644 --- a/adapters/admatic/admatictest/supplemental/response-200-without-body.json +++ b/adapters/admatic/admatictest/supplemental/response-200-without-body.json @@ -5,11 +5,17 @@ { "id": "test-imp-id", "banner": { - "format": [{"w": 728, "h": 90}] + "format": [ + { + "w": 728, + "h": 90 + } + ] }, "ext": { "bidder": { - "host": "admatic.rtb.admatic.com.tr" + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 } } } @@ -19,18 +25,24 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.admatic.com.tr?host=admatic.rtb.admatic.com.tr", + "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id", "imp": [ { "id": "test-imp-id", "banner": { - "format": [{"w": 728, "h": 90}] + "format": [ + { + "w": 728, + "h": 90 + } + ] }, "ext": { "bidder": { - "host": "admatic.rtb.admatic.com.tr" + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 } } } diff --git a/adapters/admatic/admatictest/supplemental/response-204.json b/adapters/admatic/admatictest/supplemental/response-204.json index 0f9bed26449..849cc85e89b 100644 --- a/adapters/admatic/admatictest/supplemental/response-204.json +++ b/adapters/admatic/admatictest/supplemental/response-204.json @@ -5,11 +5,17 @@ { "id": "test-imp-id", "banner": { - "format": [{"w": 728, "h": 90}] + "format": [ + { + "w": 728, + "h": 90 + } + ] }, "ext": { "bidder": { - "host": "admatic.rtb.admatic.com.tr" + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 } } } @@ -19,18 +25,24 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.admatic.com.tr?host=admatic.rtb.admatic.com.tr", + "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id", "imp": [ { "id": "test-imp-id", "banner": { - "format": [{"w": 728, "h": 90}] + "format": [ + { + "w": 728, + "h": 90 + } + ] }, "ext": { "bidder": { - "host": "admatic.rtb.admatic.com.tr" + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 } } } diff --git a/adapters/admatic/admatictest/supplemental/server-error.json b/adapters/admatic/admatictest/supplemental/server-error.json index 9b5152c06ea..7bf253b5bf5 100644 --- a/adapters/admatic/admatictest/supplemental/server-error.json +++ b/adapters/admatic/admatictest/supplemental/server-error.json @@ -5,11 +5,17 @@ { "id": "test-imp-id", "banner": { - "format": [{"w": 728, "h": 90}] + "format": [ + { + "w": 728, + "h": 90 + } + ] }, "ext": { "bidder": { - "host": "admatic.rtb.admatic.com.tr" + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 } } } @@ -19,18 +25,24 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.admatic.com.tr?host=admatic.rtb.admatic.com.tr", + "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id", "imp": [ { "id": "test-imp-id", "banner": { - "format": [{"w": 728, "h": 90}] + "format": [ + { + "w": 728, + "h": 90 + } + ] }, "ext": { "bidder": { - "host": "admatic.rtb.admatic.com.tr" + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 } } } @@ -39,9 +51,16 @@ "impIDs": ["test-imp-id"] }, "mockResponse": { - "status": 204 + "status": 500, + "body": "Server error" } } ], - "expectedBidResponses": [] + "expectedBidResponses": [], + "expectedMakeBidsErrors": [ + { + "value": "Unexpected status code: 500.", + "comparison": "literal" + } + ] } diff --git a/adapters/admatic/params_test.go b/adapters/admatic/params_test.go index 2103bd3e42f..967c810cbe7 100644 --- a/adapters/admatic/params_test.go +++ b/adapters/admatic/params_test.go @@ -34,13 +34,14 @@ func TestInvalidParams(t *testing.T) { } var validParams = []string{ - `{ "host": "admatic.rtb.admatic.com.tr", + `{ "host": "layer.serve.admatic.com.tr", + "networkId": 1111, "ext": { "key1": "value1", "key2": "value2" } }`, - `{"host": "admatic.rtb.admatic.com.tr"}`, + `{"host": "layer.serve.admatic.com.tr", "networkId": 1111}`, } var invalidParams = []string{ @@ -49,5 +50,5 @@ var invalidParams = []string{ "key2": "value2" }`, `{}`, - `{"host": 123}`, + `{"host": 123, "networkId":"1111"}`, } diff --git a/openrtb_ext/imp_admatic.go b/openrtb_ext/imp_admatic.go index 2cc2f326f56..89e9acc1f72 100644 --- a/openrtb_ext/imp_admatic.go +++ b/openrtb_ext/imp_admatic.go @@ -1,5 +1,6 @@ package openrtb_ext type ImpExtAdmatic struct { - Host string `json:"host"` + Host string `json:"host"` + NetworkId int `json:"networkId"` } diff --git a/static/bidder-params/admatic.json b/static/bidder-params/admatic.json index 5cd1b6b5fb7..016a95cfb0a 100644 --- a/static/bidder-params/admatic.json +++ b/static/bidder-params/admatic.json @@ -1,15 +1,20 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Pixad Adapter Params", + "title": "AdMatic Adapter Params", "description": "A schema which validates params accepted by the AdMatic adapter", "type": "object", "properties": { "host": { "type": "string", "description": "Host Name" + }, + "networkId": { + "type": "integer", + "description": "AdMatic Network Id" } }, "required": [ - "host" + "host", + "networkId" ] } \ No newline at end of file From 9fe986d6ae59d502be41a6155049c46180ef9018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Sat, 29 Jun 2024 13:27:07 +0300 Subject: [PATCH 15/30] Update server-error.json --- .../admatic/admatictest/supplemental/server-error.json | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/adapters/admatic/admatictest/supplemental/server-error.json b/adapters/admatic/admatictest/supplemental/server-error.json index 7bf253b5bf5..c3e74a3242e 100644 --- a/adapters/admatic/admatictest/supplemental/server-error.json +++ b/adapters/admatic/admatictest/supplemental/server-error.json @@ -56,11 +56,5 @@ } } ], - "expectedBidResponses": [], - "expectedMakeBidsErrors": [ - { - "value": "Unexpected status code: 500.", - "comparison": "literal" - } - ] + "expectedBidResponses": [] } From 3dced1bd4cea7ae33cf6f0d731464c6252c73814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Sat, 29 Jun 2024 13:32:29 +0300 Subject: [PATCH 16/30] update server error --- adapters/admatic/admatic.go | 4 +++- .../admatic/admatictest/supplemental/server-error.json | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/adapters/admatic/admatic.go b/adapters/admatic/admatic.go index 7d8bed496aa..94d966dbfbe 100644 --- a/adapters/admatic/admatic.go +++ b/adapters/admatic/admatic.go @@ -89,7 +89,9 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R if adapters.IsResponseStatusCodeNoContent(responseData) { return nil, nil } - if err := adapters.CheckResponseStatusCodeForErrors(responseData); err != nil { + + err := adapters.CheckResponseStatusCodeForErrors(responseData) + if err != nil { return nil, []error{err} } var response openrtb2.BidResponse diff --git a/adapters/admatic/admatictest/supplemental/server-error.json b/adapters/admatic/admatictest/supplemental/server-error.json index c3e74a3242e..91bb22733bc 100644 --- a/adapters/admatic/admatictest/supplemental/server-error.json +++ b/adapters/admatic/admatictest/supplemental/server-error.json @@ -52,9 +52,14 @@ }, "mockResponse": { "status": 500, - "body": "Server error" + "headers": {} } } ], - "expectedBidResponses": [] + "expectedMakeBidsErrors": [ + { + "value": "Unexpected status code: 500. Run with request.debug = 1 for more info", + "comparison": "literal" + } + ] } From fa1bbba5bea14d490d25b271ff860649e7dc8077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Sat, 29 Jun 2024 15:02:03 +0300 Subject: [PATCH 17/30] Create bad-request.json --- .../admatictest/supplemental/bad-request.json | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 adapters/admatic/admatictest/supplemental/bad-request.json diff --git a/adapters/admatic/admatictest/supplemental/bad-request.json b/adapters/admatic/admatictest/supplemental/bad-request.json new file mode 100644 index 00000000000..90f6ebd6c9d --- /dev/null +++ b/adapters/admatic/admatictest/supplemental/bad-request.json @@ -0,0 +1,66 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 + } + } + } + ] + }, + + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 + } + } + } + ] + }, + "impIDs": ["test-imp-id"] + }, + "mockResponse": { + "status": 400, + "headers": {} + } + } + ], + "expectedMakeBidsErrors": [ + { + "value": "Unexpected status code: 400. Run with request.debug = 1 for more info", + "comparison": "literal" + } + ] + } + \ No newline at end of file From 5fc719d47c8a1e907b71a493fa356975464faacf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:50:16 +0300 Subject: [PATCH 18/30] solved problems --- adapters/admatic/admatic_test.go | 2 +- adapters/admatic/params_test.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/adapters/admatic/admatic_test.go b/adapters/admatic/admatic_test.go index 7a16882fe46..d9e34c1eec7 100644 --- a/adapters/admatic/admatic_test.go +++ b/adapters/admatic/admatic_test.go @@ -22,7 +22,7 @@ func TestJsonSamples(t *testing.T) { } func TestEndpointTemplateMalformed(t *testing.T) { - _, buildErr := Builder(openrtb_ext.BidderAso, config.Adapter{ + _, buildErr := Builder(openrtb_ext.BidderAdmatic, config.Adapter{ Endpoint: "host={{Host}}"}, config.Server{ExternalUrl: "http://hosturl.com"}) assert.Error(t, buildErr) diff --git a/adapters/admatic/params_test.go b/adapters/admatic/params_test.go index 967c810cbe7..817ee92e803 100644 --- a/adapters/admatic/params_test.go +++ b/adapters/admatic/params_test.go @@ -51,4 +51,6 @@ var invalidParams = []string{ }`, `{}`, `{"host": 123, "networkId":"1111"}`, + `{"host": "layer.serve.admatic.com.tr", "networkId":"1111"}`, + `{"host": 1111, "networkId":1111}`, } From 06a91e3254b7a118606642cbe3fb11e39398062e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Tue, 2 Jul 2024 17:23:32 +0300 Subject: [PATCH 19/30] Create multiple-imps-with-error.json --- .../multiple-imps-with-error.json | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json diff --git a/adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json b/adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json new file mode 100644 index 00000000000..165bd3ed150 --- /dev/null +++ b/adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json @@ -0,0 +1,136 @@ +{ + "mockBidRequest": { + "id": "test-request-id-banner", + "imp": [ + { + "id": "test-imp-id-banner", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 + } + } + }, + { + "id": "test-imp-id-banner2", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": {}, + "networkId": 12345 + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", + "body": { + "id": "test-request-id-banner", + "imp": [ + { + "id": "test-imp-id-banner", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 + } + } + }, + { + "id": "test-imp-id-banner2", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": {}, + "networkId": 12345 + } + } + } + ] + }, + "impIDs": ["test-imp-id-banner","test-imp-id-banner2"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id-banner", + "seatbid": [ + { + "seat": "admatic", + "bid": [ + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-banner", + "price": 0.5, + "adm": "some-test-ad-banner", + "crid": "crid_10", + "w": 728, + "h": 90 + } + ] + } + ], + "cur": "USD" + } + } + } + ], + "expectedMakeRequestsErrors": [ + { + "value": "Failed to deserialize AdMatic extension: json: cannot unmarshal object into Go struct field ImpExtAdmatic.host of type string", + "comparison": "literal" + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-banner", + "price": 0.5, + "adm": "some-test-ad-banner", + "crid": "crid_10", + "w": 728, + "h": 90 + }, + "type": "banner" + } + ] + } + ] +} From 9d10bdde597713ed811f26e6260f38c2e3c930f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Tue, 2 Jul 2024 17:26:15 +0300 Subject: [PATCH 20/30] Update multiple-imps-with-error.json --- .../multiple-imps-with-error.json | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json b/adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json index 165bd3ed150..c080e57c7e5 100644 --- a/adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json +++ b/adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json @@ -61,27 +61,10 @@ "networkId": 12345 } } - }, - { - "id": "test-imp-id-banner2", - "banner": { - "format": [ - { - "w": 728, - "h": 90 - } - ] - }, - "ext": { - "bidder": { - "host": {}, - "networkId": 12345 - } - } } ] }, - "impIDs": ["test-imp-id-banner","test-imp-id-banner2"] + "impIDs": ["test-imp-id-banner"] }, "mockResponse": { "status": 200, From 1df070adf141284f71152114852f4e1543c77b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Tue, 2 Jul 2024 21:57:18 +0300 Subject: [PATCH 21/30] Create multiple-imps.json --- .../admatictest/exemplary/multiple-imps.json | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 adapters/admatic/admatictest/exemplary/multiple-imps.json diff --git a/adapters/admatic/admatictest/exemplary/multiple-imps.json b/adapters/admatic/admatictest/exemplary/multiple-imps.json new file mode 100644 index 00000000000..416c33339fc --- /dev/null +++ b/adapters/admatic/admatictest/exemplary/multiple-imps.json @@ -0,0 +1,181 @@ +{ + "mockBidRequest": { + "id": "test-request-id-banner", + "imp": [ + { + "id": "test-imp-id-banner", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 + } + } + }, + { + "id": "test-imp-id-banner2", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "layer2.serve.admatic.com.tr", + "networkId": 12345 + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", + "body": { + "id": "test-request-id-banner", + "imp": [ + { + "id": "test-imp-id-banner", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 + } + } + } + ] + }, + "impIDs": ["test-imp-id-banner"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id-banner", + "seatbid": [ + { + "seat": "admatic", + "bid": [ + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-banner", + "price": 0.5, + "adm": "some-test-ad-banner", + "crid": "crid_10", + "w": 728, + "h": 90 + } + ] + } + ], + "cur": "USD" + } + } + }, + { + "expectedRequest": { + "uri": "http://pbs.admatic.com.tr?host=layer2.serve.admatic.com.tr", + "body": { + "id": "test-request-id-banner", + "imp": [ + { + "id": "test-imp-id-banner2", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "layer2.serve.admatic.com.tr", + "networkId": 123456 + } + } + } + ] + }, + "impIDs": ["test-imp-id-banner2"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id-banner", + "seatbid": [ + { + "seat": "admatic", + "bid": [ + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e801", + "impid": "test-imp-id-banner2", + "price": 0.5, + "adm": "some-test-ad-banner2", + "crid": "crid_11", + "w": 728, + "h": 90 + } + ] + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-banner", + "price": 0.5, + "adm": "some-test-ad-banner", + "crid": "crid_10", + "w": 728, + "h": 90 + }, + "type": "banner" + } + ] + }, + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e801", + "impid": "test-imp-id-banner2", + "price": 0.5, + "adm": "some-test-ad-banner2", + "crid": "crid_11", + "w": 728, + "h": 90 + }, + "type": "banner" + } + ] + } + ] +} From d20bbb84d41c99867b0e4c7a21dbd925d9355d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Tue, 2 Jul 2024 22:00:39 +0300 Subject: [PATCH 22/30] Update multiple-imps.json --- adapters/admatic/admatictest/exemplary/multiple-imps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapters/admatic/admatictest/exemplary/multiple-imps.json b/adapters/admatic/admatictest/exemplary/multiple-imps.json index 416c33339fc..8738fbb7f95 100644 --- a/adapters/admatic/admatictest/exemplary/multiple-imps.json +++ b/adapters/admatic/admatictest/exemplary/multiple-imps.json @@ -32,7 +32,7 @@ "ext": { "bidder": { "host": "layer2.serve.admatic.com.tr", - "networkId": 12345 + "networkId": 123456 } } } From 8cc81a7a32796693353296c9c2b11466f565a035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Sun, 1 Dec 2024 13:47:28 +0300 Subject: [PATCH 23/30] add adapter headers --- adapters/admatic/admatic.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/adapters/admatic/admatic.go b/adapters/admatic/admatic.go index 94d966dbfbe..eaae18d6338 100644 --- a/adapters/admatic/admatic.go +++ b/adapters/admatic/admatic.go @@ -34,6 +34,22 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte var requests []*adapters.RequestData var errs []error + headers := http.Header{} + headers.Add("Content-Type", "application/json;charset=utf-8") + headers.Add("Accept", "application/json") + if request.Device != nil { + if len(request.Device.UA) > 0 { + headers.Add("User-Agent", request.Device.UA) + } + + if len(request.Device.IPv6) > 0 { + headers.Add("X-Forwarded-For", request.Device.IPv6) + } + + if len(request.Device.IP) > 0 { + headers.Add("X-Forwarded-For", request.Device.IP) + } + } requestCopy := *request for _, imp := range request.Imp { requestCopy.Imp = []openrtb2.Imp{imp} @@ -54,6 +70,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte Method: http.MethodPost, Body: requestJSON, Uri: endpoint, + Headers: headers, ImpIDs: openrtb_ext.GetImpIDs(requestCopy.Imp), } From 26e50b2daecc0ebc32c1a1ab1c012f6f2ed018bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Sun, 1 Dec 2024 13:51:59 +0300 Subject: [PATCH 24/30] pretty file --- adapters/admatic/admatic.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adapters/admatic/admatic.go b/adapters/admatic/admatic.go index f8b4758fdac..435eaba09e3 100644 --- a/adapters/admatic/admatic.go +++ b/adapters/admatic/admatic.go @@ -68,11 +68,11 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte } request := &adapters.RequestData{ - Method: http.MethodPost, - Body: requestJSON, - Uri: endpoint, + Method: http.MethodPost, + Body: requestJSON, + Uri: endpoint, Headers: headers, - ImpIDs: openrtb_ext.GetImpIDs(requestCopy.Imp), + ImpIDs: openrtb_ext.GetImpIDs(requestCopy.Imp), } requests = append(requests, request) From 313c6a119da5a6addce59d7f36194c5caa477698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:12:13 +0300 Subject: [PATCH 25/30] add test headers to test json --- adapters/admatic/admatictest/exemplary/banner.json | 14 ++++++++++++++ .../admatictest/exemplary/multiple-imps.json | 14 ++++++++++++++ adapters/admatic/admatictest/exemplary/native.json | 14 ++++++++++++++ .../admatictest/exemplary/optional-params.json | 14 ++++++++++++++ adapters/admatic/admatictest/exemplary/video.json | 14 ++++++++++++++ .../admatictest/supplemental/bad-request.json | 14 ++++++++++++++ .../supplemental/multiple-imps-with-error.json | 14 ++++++++++++++ .../supplemental/response-200-without-body.json | 14 ++++++++++++++ .../admatictest/supplemental/response-204.json | 14 ++++++++++++++ .../admatictest/supplemental/server-error.json | 14 ++++++++++++++ 10 files changed, 140 insertions(+) diff --git a/adapters/admatic/admatictest/exemplary/banner.json b/adapters/admatic/admatictest/exemplary/banner.json index 5950034a61e..d61576b02e6 100644 --- a/adapters/admatic/admatictest/exemplary/banner.json +++ b/adapters/admatic/admatictest/exemplary/banner.json @@ -24,6 +24,20 @@ "httpCalls": [ { "expectedRequest": { + "headers": { + "Content-Type": [ + "application/json;charset=utf-8" + ], + "Accept": [ + "application/json" + ], + "User-Agent": [ + "test-user-agent" + ], + "X-Forwarded-For": [ + "123.123.123.123" + ] + }, "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id-banner", diff --git a/adapters/admatic/admatictest/exemplary/multiple-imps.json b/adapters/admatic/admatictest/exemplary/multiple-imps.json index 8738fbb7f95..031b68ccee3 100644 --- a/adapters/admatic/admatictest/exemplary/multiple-imps.json +++ b/adapters/admatic/admatictest/exemplary/multiple-imps.json @@ -41,6 +41,20 @@ "httpCalls": [ { "expectedRequest": { + "headers": { + "Content-Type": [ + "application/json;charset=utf-8" + ], + "Accept": [ + "application/json" + ], + "User-Agent": [ + "test-user-agent" + ], + "X-Forwarded-For": [ + "123.123.123.123" + ] + }, "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id-banner", diff --git a/adapters/admatic/admatictest/exemplary/native.json b/adapters/admatic/admatictest/exemplary/native.json index 455406d05c2..60b7ed31f25 100644 --- a/adapters/admatic/admatictest/exemplary/native.json +++ b/adapters/admatic/admatictest/exemplary/native.json @@ -19,6 +19,20 @@ "httpCalls": [ { "expectedRequest": { + "headers": { + "Content-Type": [ + "application/json;charset=utf-8" + ], + "Accept": [ + "application/json" + ], + "User-Agent": [ + "test-user-agent" + ], + "X-Forwarded-For": [ + "123.123.123.123" + ] + }, "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id-native", diff --git a/adapters/admatic/admatictest/exemplary/optional-params.json b/adapters/admatic/admatictest/exemplary/optional-params.json index e1652c30899..3c704008e51 100644 --- a/adapters/admatic/admatictest/exemplary/optional-params.json +++ b/adapters/admatic/admatictest/exemplary/optional-params.json @@ -26,6 +26,20 @@ "httpCalls": [ { "expectedRequest": { + "headers": { + "Content-Type": [ + "application/json;charset=utf-8" + ], + "Accept": [ + "application/json" + ], + "User-Agent": [ + "test-user-agent" + ], + "X-Forwarded-For": [ + "123.123.123.123" + ] + }, "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id-banner", diff --git a/adapters/admatic/admatictest/exemplary/video.json b/adapters/admatic/admatictest/exemplary/video.json index 58f5e89810b..4b5cb4cab4e 100644 --- a/adapters/admatic/admatictest/exemplary/video.json +++ b/adapters/admatic/admatictest/exemplary/video.json @@ -21,6 +21,20 @@ "httpCalls": [ { "expectedRequest": { + "headers": { + "Content-Type": [ + "application/json;charset=utf-8" + ], + "Accept": [ + "application/json" + ], + "User-Agent": [ + "test-user-agent" + ], + "X-Forwarded-For": [ + "123.123.123.123" + ] + }, "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id", diff --git a/adapters/admatic/admatictest/supplemental/bad-request.json b/adapters/admatic/admatictest/supplemental/bad-request.json index 90f6ebd6c9d..ad1fbdf6adc 100644 --- a/adapters/admatic/admatictest/supplemental/bad-request.json +++ b/adapters/admatic/admatictest/supplemental/bad-request.json @@ -25,6 +25,20 @@ "httpCalls": [ { "expectedRequest": { + "headers": { + "Content-Type": [ + "application/json;charset=utf-8" + ], + "Accept": [ + "application/json" + ], + "User-Agent": [ + "test-user-agent" + ], + "X-Forwarded-For": [ + "123.123.123.123" + ] + }, "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id", diff --git a/adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json b/adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json index b23c794c1ba..343ee211f0d 100644 --- a/adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json +++ b/adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json @@ -41,6 +41,20 @@ "httpCalls": [ { "expectedRequest": { + "headers": { + "Content-Type": [ + "application/json;charset=utf-8" + ], + "Accept": [ + "application/json" + ], + "User-Agent": [ + "test-user-agent" + ], + "X-Forwarded-For": [ + "123.123.123.123" + ] + }, "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id-banner", diff --git a/adapters/admatic/admatictest/supplemental/response-200-without-body.json b/adapters/admatic/admatictest/supplemental/response-200-without-body.json index 6cded7606e2..5423c311f93 100644 --- a/adapters/admatic/admatictest/supplemental/response-200-without-body.json +++ b/adapters/admatic/admatictest/supplemental/response-200-without-body.json @@ -25,6 +25,20 @@ "httpCalls": [ { "expectedRequest": { + "headers": { + "Content-Type": [ + "application/json;charset=utf-8" + ], + "Accept": [ + "application/json" + ], + "User-Agent": [ + "test-user-agent" + ], + "X-Forwarded-For": [ + "123.123.123.123" + ] + }, "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id", diff --git a/adapters/admatic/admatictest/supplemental/response-204.json b/adapters/admatic/admatictest/supplemental/response-204.json index 849cc85e89b..0ed00b3a911 100644 --- a/adapters/admatic/admatictest/supplemental/response-204.json +++ b/adapters/admatic/admatictest/supplemental/response-204.json @@ -25,6 +25,20 @@ "httpCalls": [ { "expectedRequest": { + "headers": { + "Content-Type": [ + "application/json;charset=utf-8" + ], + "Accept": [ + "application/json" + ], + "User-Agent": [ + "test-user-agent" + ], + "X-Forwarded-For": [ + "123.123.123.123" + ] + }, "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id", diff --git a/adapters/admatic/admatictest/supplemental/server-error.json b/adapters/admatic/admatictest/supplemental/server-error.json index 91bb22733bc..51107c42cbd 100644 --- a/adapters/admatic/admatictest/supplemental/server-error.json +++ b/adapters/admatic/admatictest/supplemental/server-error.json @@ -25,6 +25,20 @@ "httpCalls": [ { "expectedRequest": { + "headers": { + "Content-Type": [ + "application/json;charset=utf-8" + ], + "Accept": [ + "application/json" + ], + "User-Agent": [ + "test-user-agent" + ], + "X-Forwarded-For": [ + "123.123.123.123" + ] + }, "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id", From b46d9697e852afbf9f73bffa712d590b675b983b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:50:20 +0300 Subject: [PATCH 26/30] add device object to test json --- .../admatic/admatictest/exemplary/banner.json | 12 ++++++ .../admatictest/exemplary/multiple-imps.json | 18 +++++++++ .../admatic/admatictest/exemplary/native.json | 12 ++++++ .../exemplary/optional-params.json | 12 ++++++ .../admatic/admatictest/exemplary/video.json | 12 ++++++ .../admatictest/supplemental/bad-request.json | 38 ++++++++++++------- .../multiple-imps-with-error.json | 12 ++++++ .../response-200-without-body.json | 12 ++++++ .../supplemental/response-204.json | 12 ++++++ .../supplemental/server-error.json | 18 ++++++--- 10 files changed, 139 insertions(+), 19 deletions(-) diff --git a/adapters/admatic/admatictest/exemplary/banner.json b/adapters/admatic/admatictest/exemplary/banner.json index d61576b02e6..c1cba18493c 100644 --- a/adapters/admatic/admatictest/exemplary/banner.json +++ b/adapters/admatic/admatictest/exemplary/banner.json @@ -1,6 +1,12 @@ { "mockBidRequest": { "id": "test-request-id-banner", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id-banner", @@ -41,6 +47,12 @@ "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id-banner", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id-banner", diff --git a/adapters/admatic/admatictest/exemplary/multiple-imps.json b/adapters/admatic/admatictest/exemplary/multiple-imps.json index 031b68ccee3..5390ee4b0ca 100644 --- a/adapters/admatic/admatictest/exemplary/multiple-imps.json +++ b/adapters/admatic/admatictest/exemplary/multiple-imps.json @@ -1,6 +1,12 @@ { "mockBidRequest": { "id": "test-request-id-banner", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id-banner", @@ -58,6 +64,12 @@ "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id-banner", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id-banner", @@ -109,6 +121,12 @@ "uri": "http://pbs.admatic.com.tr?host=layer2.serve.admatic.com.tr", "body": { "id": "test-request-id-banner", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id-banner2", diff --git a/adapters/admatic/admatictest/exemplary/native.json b/adapters/admatic/admatictest/exemplary/native.json index 60b7ed31f25..37572c0fd5f 100644 --- a/adapters/admatic/admatictest/exemplary/native.json +++ b/adapters/admatic/admatictest/exemplary/native.json @@ -1,6 +1,12 @@ { "mockBidRequest": { "id": "test-request-id-native", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id-native", @@ -36,6 +42,12 @@ "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id-native", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id-native", diff --git a/adapters/admatic/admatictest/exemplary/optional-params.json b/adapters/admatic/admatictest/exemplary/optional-params.json index 3c704008e51..b710cd3a7f6 100644 --- a/adapters/admatic/admatictest/exemplary/optional-params.json +++ b/adapters/admatic/admatictest/exemplary/optional-params.json @@ -1,6 +1,12 @@ { "mockBidRequest": { "id": "test-request-id-banner", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id-banner", @@ -43,6 +49,12 @@ "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id-banner", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id-banner", diff --git a/adapters/admatic/admatictest/exemplary/video.json b/adapters/admatic/admatictest/exemplary/video.json index 4b5cb4cab4e..0acd8258d2e 100644 --- a/adapters/admatic/admatictest/exemplary/video.json +++ b/adapters/admatic/admatictest/exemplary/video.json @@ -1,6 +1,12 @@ { "mockBidRequest": { "id": "test-request-id", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-video-id", @@ -38,6 +44,12 @@ "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-video-id", diff --git a/adapters/admatic/admatictest/supplemental/bad-request.json b/adapters/admatic/admatictest/supplemental/bad-request.json index ad1fbdf6adc..98f3deca28d 100644 --- a/adapters/admatic/admatictest/supplemental/bad-request.json +++ b/adapters/admatic/admatictest/supplemental/bad-request.json @@ -1,6 +1,12 @@ { "mockBidRequest": { "id": "test-request-id", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id", @@ -26,22 +32,28 @@ { "expectedRequest": { "headers": { - "Content-Type": [ - "application/json;charset=utf-8" - ], - "Accept": [ - "application/json" - ], - "User-Agent": [ - "test-user-agent" - ], - "X-Forwarded-For": [ - "123.123.123.123" - ] - }, + "Content-Type": [ + "application/json;charset=utf-8" + ], + "Accept": [ + "application/json" + ], + "User-Agent": [ + "test-user-agent" + ], + "X-Forwarded-For": [ + "123.123.123.123" + ] + }, "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id", diff --git a/adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json b/adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json index 343ee211f0d..74415320484 100644 --- a/adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json +++ b/adapters/admatic/admatictest/supplemental/multiple-imps-with-error.json @@ -1,6 +1,12 @@ { "mockBidRequest": { "id": "test-request-id-banner", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id-banner", @@ -58,6 +64,12 @@ "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id-banner", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id-banner", diff --git a/adapters/admatic/admatictest/supplemental/response-200-without-body.json b/adapters/admatic/admatictest/supplemental/response-200-without-body.json index 5423c311f93..c87608e7ba7 100644 --- a/adapters/admatic/admatictest/supplemental/response-200-without-body.json +++ b/adapters/admatic/admatictest/supplemental/response-200-without-body.json @@ -1,6 +1,12 @@ { "mockBidRequest": { "id": "test-request-id", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id", @@ -42,6 +48,12 @@ "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id", diff --git a/adapters/admatic/admatictest/supplemental/response-204.json b/adapters/admatic/admatictest/supplemental/response-204.json index 0ed00b3a911..8da63adf145 100644 --- a/adapters/admatic/admatictest/supplemental/response-204.json +++ b/adapters/admatic/admatictest/supplemental/response-204.json @@ -1,6 +1,12 @@ { "mockBidRequest": { "id": "test-request-id", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id", @@ -42,6 +48,12 @@ "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id", diff --git a/adapters/admatic/admatictest/supplemental/server-error.json b/adapters/admatic/admatictest/supplemental/server-error.json index 51107c42cbd..de2e3301981 100644 --- a/adapters/admatic/admatictest/supplemental/server-error.json +++ b/adapters/admatic/admatictest/supplemental/server-error.json @@ -1,6 +1,12 @@ { "mockBidRequest": { "id": "test-request-id", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id", @@ -31,17 +37,17 @@ ], "Accept": [ "application/json" - ], - "User-Agent": [ - "test-user-agent" - ], - "X-Forwarded-For": [ - "123.123.123.123" ] }, "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, "imp": [ { "id": "test-imp-id", From c10cd117cbd24a4b8d94ef1bd495eee6bf2121b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:52:30 +0300 Subject: [PATCH 27/30] Update server-error.json --- .../admatictest/supplemental/server-error.json | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/adapters/admatic/admatictest/supplemental/server-error.json b/adapters/admatic/admatictest/supplemental/server-error.json index de2e3301981..5db3c0d90e5 100644 --- a/adapters/admatic/admatictest/supplemental/server-error.json +++ b/adapters/admatic/admatictest/supplemental/server-error.json @@ -1,12 +1,6 @@ { "mockBidRequest": { "id": "test-request-id", - "device": { - "ua": "test-user-agent", - "ip": "123.123.123.123", - "language": "en", - "dnt": 0 - }, "imp": [ { "id": "test-imp-id", @@ -42,12 +36,6 @@ "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", "body": { "id": "test-request-id", - "device": { - "ua": "test-user-agent", - "ip": "123.123.123.123", - "language": "en", - "dnt": 0 - }, "imp": [ { "id": "test-imp-id", From 6e301903234ce286d33cf4acfd9aa1bd78ac0f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Mon, 27 Jan 2025 12:50:15 +0300 Subject: [PATCH 28/30] added ipv6 --- .../admatictest/exemplary/headers_ipv4.json | 122 +++++++++++++++++ .../admatictest/exemplary/headers_ipv6.json | 123 ++++++++++++++++++ 2 files changed, 245 insertions(+) create mode 100644 adapters/admatic/admatictest/exemplary/headers_ipv4.json create mode 100644 adapters/admatic/admatictest/exemplary/headers_ipv6.json diff --git a/adapters/admatic/admatictest/exemplary/headers_ipv4.json b/adapters/admatic/admatictest/exemplary/headers_ipv4.json new file mode 100644 index 00000000000..c1cba18493c --- /dev/null +++ b/adapters/admatic/admatictest/exemplary/headers_ipv4.json @@ -0,0 +1,122 @@ +{ + "mockBidRequest": { + "id": "test-request-id-banner", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, + "imp": [ + { + "id": "test-imp-id-banner", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "headers": { + "Content-Type": [ + "application/json;charset=utf-8" + ], + "Accept": [ + "application/json" + ], + "User-Agent": [ + "test-user-agent" + ], + "X-Forwarded-For": [ + "123.123.123.123" + ] + }, + "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", + "body": { + "id": "test-request-id-banner", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, + "imp": [ + { + "id": "test-imp-id-banner", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 + } + } + } + ] + }, + "impIDs": ["test-imp-id-banner"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id-banner", + "seatbid": [ + { + "seat": "admatic", + "bid": [ + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-banner", + "price": 0.5, + "adm": "some-test-ad-banner", + "crid": "crid_10", + "w": 728, + "h": 90 + } + ] + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-banner", + "price": 0.5, + "adm": "some-test-ad-banner", + "crid": "crid_10", + "w": 728, + "h": 90 + }, + "type": "banner" + } + ] + } + ] +} diff --git a/adapters/admatic/admatictest/exemplary/headers_ipv6.json b/adapters/admatic/admatictest/exemplary/headers_ipv6.json new file mode 100644 index 00000000000..3d8aafadc59 --- /dev/null +++ b/adapters/admatic/admatictest/exemplary/headers_ipv6.json @@ -0,0 +1,123 @@ +{ + "mockBidRequest": { + "id": "test-request-id-banner", + "device": { + "ua": "test-user-agent", + "ipv6": "2607:fb90:f27:4512:d800:cb23:a603:e245", + "language": "en", + "dnt": 0 + }, + "imp": [ + { + "id": "test-imp-id-banner", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "headers": { + "Content-Type": [ + "application/json;charset=utf-8" + ], + "Accept": [ + "application/json" + ], + "User-Agent": [ + "test-user-agent" + ], + "X-Forwarded-For": [ + "2607:fb90:f27:4512:d800:cb23:a603:e245" + ] + }, + "uri": "http://pbs.admatic.com.tr?host=layer.serve.admatic.com.tr", + "body": { + "id": "test-request-id-banner", + "device": { + "ua": "test-user-agent", + "ipv6": "2607:fb90:f27:4512:d800:cb23:a603:e245", + "language": "en", + "dnt": 0 + }, + "imp": [ + { + "id": "test-imp-id-banner", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "host": "layer.serve.admatic.com.tr", + "networkId": 12345 + } + } + } + ] + }, + "impIDs": ["test-imp-id-banner"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id-banner", + "seatbid": [ + { + "seat": "admatic", + "bid": [ + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-banner", + "price": 0.5, + "adm": "some-test-ad-banner", + "crid": "crid_10", + "w": 728, + "h": 90 + } + ] + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-banner", + "price": 0.5, + "adm": "some-test-ad-banner", + "crid": "crid_10", + "w": 728, + "h": 90 + }, + "type": "banner" + } + ] + } + ] + } + \ No newline at end of file From 85c2ee1d26686ea26c20711b659278050e3ea5cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Wed, 29 Jan 2025 12:16:58 +0300 Subject: [PATCH 29/30] Admatic: add alias Adt --- static/bidder-info/adt.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 static/bidder-info/adt.yml diff --git a/static/bidder-info/adt.yml b/static/bidder-info/adt.yml new file mode 100644 index 00000000000..e9791a797b3 --- /dev/null +++ b/static/bidder-info/adt.yml @@ -0,0 +1,4 @@ +aliasOf: "admatic" +maintainer: + email: "kamil@adtarget.com.tr" +gvlVendorID: 779 \ No newline at end of file From 71fe17f2f37f631e0262df31624e2f7c50cb7559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulbaki=20=C3=87am?= <71071893+bakicam@users.noreply.github.com> Date: Mon, 10 Feb 2025 23:21:23 +0300 Subject: [PATCH 30/30] change file name and email --- static/bidder-info/{adt.yml => adt.yaml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename static/bidder-info/{adt.yml => adt.yaml} (55%) diff --git a/static/bidder-info/adt.yml b/static/bidder-info/adt.yaml similarity index 55% rename from static/bidder-info/adt.yml rename to static/bidder-info/adt.yaml index e9791a797b3..29520d5e515 100644 --- a/static/bidder-info/adt.yml +++ b/static/bidder-info/adt.yaml @@ -1,4 +1,4 @@ aliasOf: "admatic" maintainer: - email: "kamil@adtarget.com.tr" + email: "publisher@adtarget.com.tr" gvlVendorID: 779 \ No newline at end of file