diff --git a/adapters/insticator/insticator.go b/adapters/insticator/insticator.go index fc8487971b6..e6e3866376f 100644 --- a/adapters/insticator/insticator.go +++ b/adapters/insticator/insticator.go @@ -3,6 +3,7 @@ package insticator import ( "fmt" "net/http" + "net/url" "strings" "github.com/prebid/openrtb/v20/openrtb2" @@ -24,7 +25,12 @@ type impInsticatorExt struct { } type adapter struct { - endpoint string + endpoint string + extraInfo ExtraInfo +} + +type ExtraInfo struct { + AppEndpoint string `json:"app_endpoint,omitempty"` } type reqExt struct { @@ -54,12 +60,53 @@ type bidInsticatorExt struct { // Builder builds a new instance of the Insticator adapter with the given config. func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) { + extraInfo, err := parseExtraInfo(config.ExtraAdapterInfo) + if err != nil { + return nil, err + } + bidder := &adapter{ - endpoint: config.Endpoint, + endpoint: config.Endpoint, + extraInfo: extraInfo, } return bidder, nil } +func parseExtraInfo(v string) (ExtraInfo, error) { + if len(v) == 0 { + return ExtraInfo{}, nil + } + + var extraInfo ExtraInfo + if err := jsonutil.Unmarshal([]byte(v), &extraInfo); err != nil { + return extraInfo, fmt.Errorf("invalid extra info: %v", err) + } + + return extraInfo, nil +} + +// buildEndpointURL builds the endpoint URL with publisherId query parameter +func (a *adapter) buildEndpointURL(publisherId string, request *openrtb2.BidRequest) string { + // Use app endpoint from extra_info if this is an app request + baseEndpoint := a.endpoint + if request.App != nil && a.extraInfo.AppEndpoint != "" { + baseEndpoint = a.extraInfo.AppEndpoint + } + + // Append publisherId as query parameter + if publisherId != "" { + parsedURL, err := url.Parse(baseEndpoint) + if err == nil { + query := parsedURL.Query() + query.Set("publisherId", publisherId) + parsedURL.RawQuery = query.Encode() + return parsedURL.String() + } + } + + return baseEndpoint +} + // getMediaTypeForBid figures out which media type this bid is for func getMediaTypeForBid(bid *openrtb2.Bid) openrtb_ext.BidType { switch bid.MType { @@ -76,6 +123,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte var errs []error var adapterRequests []*adapters.RequestData var groupedImps = make(map[string][]openrtb2.Imp) + var publisherId string reqExt, err := makeReqExt(request) if err != nil { @@ -89,14 +137,15 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte isPublisherIdPopulated := false // Flag to track if populatePublisherId has been called for i := 0; i < len(request.Imp); i++ { - impCopy, impKey, publisherId, err := makeImps(request.Imp[i]) + impCopy, impKey, impPublisherId, err := makeImps(request.Imp[i]) if err != nil { errs = append(errs, err) continue } - // Populate publisher.id from imp extension + // Populate publisher.id from imp extension (only once) if !isPublisherIdPopulated { + publisherId = impPublisherId populatePublisherId(publisherId, &requestCopy) isPublisherIdPopulated = true } @@ -118,7 +167,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte } for _, impList := range groupedImps { - if adapterReq, err := a.makeRequest(&requestCopy, impList); err == nil { + if adapterReq, err := a.makeRequest(&requestCopy, impList, publisherId); err == nil { adapterRequests = append(adapterRequests, adapterReq) } else { errs = append(errs, err) @@ -127,7 +176,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte return adapterRequests, errs } -func (a *adapter) makeRequest(request *openrtb2.BidRequest, impList []openrtb2.Imp) (*adapters.RequestData, error) { +func (a *adapter) makeRequest(request *openrtb2.BidRequest, impList []openrtb2.Imp, publisherId string) (*adapters.RequestData, error) { request.Imp = impList reqJSON, err := jsonutil.Marshal(request) @@ -135,6 +184,9 @@ func (a *adapter) makeRequest(request *openrtb2.BidRequest, impList []openrtb2.I return nil, err } + // Build endpoint URL with publisherId query parameter + endpointURL := a.buildEndpointURL(publisherId, request) + headers := http.Header{} headers.Add("Content-Type", "application/json;charset=utf-8") headers.Add("Accept", "application/json") @@ -156,7 +208,7 @@ func (a *adapter) makeRequest(request *openrtb2.BidRequest, impList []openrtb2.I return &adapters.RequestData{ Method: "POST", - Uri: a.endpoint, + Uri: endpointURL, Body: reqJSON, Headers: headers, ImpIDs: openrtb_ext.GetImpIDs(request.Imp), @@ -186,8 +238,11 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R bid := &seatBid.Bid[i] bidType := getMediaTypeForBid(bid) b := &adapters.TypedBid{ - Bid: &seatBid.Bid[i], - BidType: bidType, + Bid: &seatBid.Bid[i], + BidType: bidType, + BidMeta: getBidMeta(bid, bidType), + BidVideo: getBidVideo(bid, bidType), + Seat: openrtb_ext.BidderName(seatBid.Seat), } bidResponse.Bids = append(bidResponse.Bids, b) } @@ -195,6 +250,41 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R return bidResponse, nil } +// getBidMeta extracts metadata from the bid for brand safety and reporting +func getBidMeta(bid *openrtb2.Bid, bidType openrtb_ext.BidType) *openrtb_ext.ExtBidPrebidMeta { + meta := &openrtb_ext.ExtBidPrebidMeta{ + MediaType: string(bidType), + } + + if len(bid.ADomain) > 0 { + meta.AdvertiserDomains = bid.ADomain + } + + if len(bid.Cat) > 0 { + meta.PrimaryCategoryID = bid.Cat[0] + meta.SecondaryCategoryIDs = bid.Cat[1:] + } + + return meta +} + +// getBidVideo extracts video-specific metadata from the bid +func getBidVideo(bid *openrtb2.Bid, bidType openrtb_ext.BidType) *openrtb_ext.ExtBidPrebidVideo { + if bidType != openrtb_ext.BidTypeVideo { + return nil + } + + var primaryCategory string + if len(bid.Cat) > 0 { + primaryCategory = bid.Cat[0] + } + + return &openrtb_ext.ExtBidPrebidVideo{ + Duration: int(bid.Dur), + PrimaryCategory: primaryCategory, + } +} + func makeImps(imp openrtb2.Imp) (openrtb2.Imp, string, string, error) { var bidderExt adapters.ExtImpBidder if err := jsonutil.Unmarshal(imp.Ext, &bidderExt); err != nil { @@ -229,13 +319,13 @@ func makeImps(imp openrtb2.Imp) (openrtb2.Imp, string, string, error) { // Validate Video if it exists if imp.Video != nil { if err := validateVideoParams(imp.Video); err != nil { - return openrtb2.Imp{}, insticatorExt.AdUnitId, insticatorExt.PublisherId, &errortypes.BadInput{ + return openrtb2.Imp{}, "", insticatorExt.PublisherId, &errortypes.BadInput{ Message: err.Error(), } } } - // Return the imp, AdUnitId, and no error + // Return the imp, adUnitId as groupKey, publisherId, and no error return imp, insticatorExt.AdUnitId, insticatorExt.PublisherId, nil } diff --git a/adapters/insticator/insticator_test.go b/adapters/insticator/insticator_test.go index b557aedce4e..10006978005 100644 --- a/adapters/insticator/insticator_test.go +++ b/adapters/insticator/insticator_test.go @@ -10,7 +10,9 @@ import ( func TestJsonSamples(t *testing.T) { bidder, buildErr := Builder(openrtb_ext.BidderInsticator, config.Adapter{ - Endpoint: "https://insticator.example.com/v1/pbs"}, + Endpoint: "https://insticator.example.com/v1/pbs", + ExtraAdapterInfo: `{"app_endpoint": "https://insticator-app.example.com/v1/pbs"}`, + }, config.Server{ExternalUrl: "https://insticator.example.com/v1/pbs", GvlID: 1, DataCenter: "2"}) if buildErr != nil { diff --git a/adapters/insticator/insticatortest/exemplary/app-banner.json b/adapters/insticator/insticatortest/exemplary/app-banner.json index 4c71760a73e..4b32c066ada 100644 --- a/adapters/insticator/insticatortest/exemplary/app-banner.json +++ b/adapters/insticator/insticatortest/exemplary/app-banner.json @@ -1,85 +1,99 @@ { - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "bidder": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 728, + "h": 90 } + ] + }, + "ext": { + "bidder": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" } } - ], - "app": { - "publisher": { - "id": "test-publisher-id" - } - }, - "device": { - "ua": "", - "ip": "1.1.1.2", - "ipv6": "" + } + ], + "app": { + "publisher": { + "id": "test-publisher-id" } }, - - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://insticator.example.com/v1/pbs", - "body": { - "device":{ - "ip": "1.1.1.2" - }, - "ext": { - "insticator": { - "caller": [ + "device": { + "ua": "", + "ip": "1.1.1.2", + "ipv6": "" + } + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://insticator-app.example.com/v1/pbs?publisherId=test-publisher-id", + "body": { + "device": { + "ip": "1.1.1.2" + }, + "ext": { + "insticator": { + "caller": [ + { + "name": "Prebid-Server", + "version": "n/a" + } + ] + } + }, + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ { - "name": "Prebid-Server", - "version": "n/a" + "w": 728, + "h": 90 } ] - } - }, - "id": "test-request-id", - "imp": [ - { - "id":"test-imp-id", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "insticator": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" - } + }, + "ext": { + "insticator": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" } } - ], - "app": { - "publisher": { - "id": "test-publisher-id" - } } - }, - "impIDs":["test-imp-id"] + ], + "app": { + "publisher": { + "id": "test-publisher-id" + } + } }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "seat": "insticator", - "bid": [{ + "impIDs": [ + "test-imp-id" + ] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "seat": "insticator", + "bid": [ + { "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", "impid": "test-imp-id", - "price": 0.500000, + "price": 0.5, "adm": "some-test-ad", + "adomain": ["insticator.com"], + "cat": ["IAB1"], "crid": "crid_10", "h": 90, "w": 728, @@ -89,39 +103,46 @@ "mediaType": "banner" } } - }] - } - ], - "cur": "USD" - } + } + ] + } + ], + "cur": "USD" } } - ], - - "expectedBidResponses": [ - { - "currency": "USD", - "bids": [ - { - "bid": { - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id", - "price": 0.5, - "adm": "some-test-ad", - "crid": "crid_10", - "w": 728, - "h": 90, - "mtype": 1, - "ext": { - "insticator": { - "mediaType": "banner" - } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id", + "price": 0.5, + "adm": "some-test-ad", + "adomain": ["insticator.com"], + "cat": ["IAB1"], + "crid": "crid_10", + "w": 728, + "h": 90, + "mtype": 1, + "ext": { + "insticator": { + "mediaType": "banner" } - }, - "type": "banner" - } - ] - } - ] - } - \ No newline at end of file + } + }, + "BidMeta": { + "advertiserDomains": ["insticator.com"], + "mediaType": "banner", + "primaryCatId": "IAB1" + }, + "type": "banner", + "seat": "insticator" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/insticator/insticatortest/exemplary/app-video.json b/adapters/insticator/insticatortest/exemplary/app-video.json index 2f0143fe961..1002fe9a0c4 100644 --- a/adapters/insticator/insticatortest/exemplary/app-video.json +++ b/adapters/insticator/insticatortest/exemplary/app-video.json @@ -59,7 +59,7 @@ "1.22.22.1" ] }, - "uri": "https://insticator.example.com/v1/pbs", + "uri": "https://insticator-app.example.com/v1/pbs?publisherId=test-publisher-id", "body": { "device": { "ip": "1.22.22.1", @@ -125,8 +125,11 @@ { "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", "impid": "test-imp-id", - "price": 0.500000, + "price": 0.5, "adm": "some-test-vast-ad", + "adomain": ["insticator.com"], + "cat": ["IAB1-1"], + "dur": 30, "mtype": 2, "crid": "crid_10", "h": 90, @@ -155,6 +158,9 @@ "impid": "test-imp-id", "price": 0.5, "adm": "some-test-vast-ad", + "adomain": ["insticator.com"], + "cat": ["IAB1-1"], + "dur": 30, "crid": "crid_10", "w": 728, "mtype": 2, @@ -165,7 +171,17 @@ } } }, - "type": "video" + "BidMeta": { + "advertiserDomains": ["insticator.com"], + "mediaType": "video", + "primaryCatId": "IAB1-1" + }, + "BidVideo": { + "duration": 30, + "primary_category": "IAB1-1" + }, + "type": "video", + "seat": "insticator" } ] } diff --git a/adapters/insticator/insticatortest/exemplary/multi-format.json b/adapters/insticator/insticatortest/exemplary/multi-format.json index 1fedfe8dc9f..30135697133 100644 --- a/adapters/insticator/insticatortest/exemplary/multi-format.json +++ b/adapters/insticator/insticatortest/exemplary/multi-format.json @@ -1,121 +1,147 @@ { - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "video": { - "w": 728, - "h": 90, - "protocols": [2], - "playbackmethod": [2], - "mimes": ["foo", "bar"] - }, - "ext": { - "bidder": { - "adUnitId": "inview", - "publisherId": "test-publisher-id" + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 728, + "h": 90 } + ] + }, + "video": { + "w": 728, + "h": 90, + "protocols": [ + 2 + ], + "playbackmethod": [ + 2 + ], + "mimes": [ + "foo", + "bar" + ] + }, + "ext": { + "bidder": { + "adUnitId": "inview", + "publisherId": "test-publisher-id" } } - ], - "site": { - "publisher": { - "id": "test-publisher-id" - } } - }, - - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://insticator.example.com/v1/pbs", - "body": { - "ext": { - "insticator": { - "caller": [ + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } + } + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://insticator.example.com/v1/pbs?publisherId=test-publisher-id", + "body": { + "ext": { + "insticator": { + "caller": [ + { + "name": "Prebid-Server", + "version": "n/a" + } + ] + } + }, + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ { - "name": "Prebid-Server", - "version": "n/a" + "w": 728, + "h": 90 } ] - } - }, - "id": "test-request-id", - "imp": [ - { - "id":"test-imp-id", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "video": { - "w": 728, - "h": 90, - "protocols": [2], - "playbackmethod": [2], - "mimes": ["foo", "bar"] - }, - "ext": { - "insticator": { - "adUnitId": "inview", - "publisherId": "test-publisher-id" - } + }, + "video": { + "w": 728, + "h": 90, + "protocols": [ + 2 + ], + "playbackmethod": [ + 2 + ], + "mimes": [ + "foo", + "bar" + ] + }, + "ext": { + "insticator": { + "adUnitId": "inview", + "publisherId": "test-publisher-id" } } - ], - "site": { - "publisher": { - "id": "test-publisher-id" - } } - }, - "impIDs":["test-imp-id"] + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } + } }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "seat": "insticator", - "bid": [{ + "impIDs": [ + "test-imp-id" + ] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "seat": "insticator", + "bid": [ + { "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", "impid": "test-imp-id", - "price": 0.500000, + "price": 0.5, "adm": "some-test-ad", "crid": "crid_10", "h": 90, "w": 728 - }] - } - ], - "cur": "USD" - } + } + ] + } + ], + "cur": "USD" } } - ], - - "expectedBidResponses": [ - { - "currency": "USD", - "bids": [ - { - "bid": { - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id", - "price": 0.5, - "adm": "some-test-ad", - "crid": "crid_10", - "w": 728, - "h": 90 - }, - "type": "banner" - } - ] - } - ] - } - \ No newline at end of file + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id", + "price": 0.5, + "adm": "some-test-ad", + "crid": "crid_10", + "w": 728, + "h": 90 + }, + "type": "banner", + "seat": "insticator" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/insticator/insticatortest/exemplary/multi-imps.json b/adapters/insticator/insticatortest/exemplary/multi-imps.json index eb744ced11e..5d5531b73ec 100644 --- a/adapters/insticator/insticatortest/exemplary/multi-imps.json +++ b/adapters/insticator/insticatortest/exemplary/multi-imps.json @@ -1,137 +1,175 @@ { - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id1", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "bidder": { - "adUnitId": "inview", - "publisherId": "test-publisher-id" + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id1", + "banner": { + "format": [ + { + "w": 728, + "h": 90 } - } + ] }, - { - "id": "test-imp-id2", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "bidder": { - "adUnitId": "inview", - "publisherId": "test-publisher-id" - } + "ext": { + "bidder": { + "adUnitId": "inview", + "publisherId": "test-publisher-id" } - }, - { - "id": "test-imp-id3", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "bidder": { - "adUnitId": "inview", - "publisherId": "test-publisher-id" + } + }, + { + "id": "test-imp-id2", + "banner": { + "format": [ + { + "w": 728, + "h": 90 } - } + ] }, - { - "id": "test-imp-id4", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "bidder": { - "adUnitId": "siab", - "publisherId": "test-publisher-id" + "ext": { + "bidder": { + "adUnitId": "inview", + "publisherId": "test-publisher-id" + } + } + }, + { + "id": "test-imp-id3", + "banner": { + "format": [ + { + "w": 728, + "h": 90 } + ] + }, + "ext": { + "bidder": { + "adUnitId": "inview", + "publisherId": "test-publisher-id" } } - ], - "site": { - "publisher": { - "id": "test-publisher-id" + }, + { + "id": "test-imp-id4", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": { + "adUnitId": "siab", + "publisherId": "test-publisher-id" + } } } - }, - - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://insticator.example.com/v1/pbs", - "body": { - "ext": { - "insticator": { - "caller": [ + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } + } + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://insticator.example.com/v1/pbs?publisherId=test-publisher-id", + "body": { + "ext": { + "insticator": { + "caller": [ + { + "name": "Prebid-Server", + "version": "n/a" + } + ] + } + }, + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id1", + "banner": { + "format": [ { - "name": "Prebid-Server", - "version": "n/a" + "w": 728, + "h": 90 } ] + }, + "ext": { + "insticator": { + "adUnitId": "inview", + "publisherId": "test-publisher-id" + } } }, - "id": "test-request-id", - "imp": [ - { - "id":"test-imp-id1", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "insticator": { - "adUnitId": "inview", - "publisherId": "test-publisher-id" + { + "id": "test-imp-id2", + "banner": { + "format": [ + { + "w": 728, + "h": 90 } - } + ] }, - { - "id":"test-imp-id2", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "insticator": { - "adUnitId": "inview", - "publisherId": "test-publisher-id" - } + "ext": { + "insticator": { + "adUnitId": "inview", + "publisherId": "test-publisher-id" } - }, - { - "id":"test-imp-id3", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "insticator": { - "adUnitId": "inview", - "publisherId": "test-publisher-id" + } + }, + { + "id": "test-imp-id3", + "banner": { + "format": [ + { + "w": 728, + "h": 90 } + ] + }, + "ext": { + "insticator": { + "adUnitId": "inview", + "publisherId": "test-publisher-id" } } - ], - "site": { - "publisher": { - "id": "test-publisher-id" - } } - }, - "impIDs":["test-imp-id1","test-imp-id2", "test-imp-id3"] + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } + } }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "seat": "insticator", - "bid": [ - { + "impIDs": [ + "test-imp-id1", + "test-imp-id2", + "test-imp-id3" + ] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "seat": "insticator", + "bid": [ + { "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", "impid": "test-imp-id1", - "price": 0.500000, + "price": 0.5, "adm": "some-test-ad", "crid": "crid_10", "h": 90, @@ -141,91 +179,98 @@ "mediaType": "banner" } } - }, - { - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id2", - "price": 0.600000, - "adm": "some-test-ad", - "crid": "crid_10", - "h": 90, - "w": 728, - "ext": { - "insticator": { - "mediaType": "banner" - } + }, + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id2", + "price": 0.6, + "adm": "some-test-ad", + "crid": "crid_10", + "h": 90, + "w": 728, + "ext": { + "insticator": { + "mediaType": "banner" } - }, - { - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id3", - "price": 0.500000, - "adm": "some-test-ad", - "crid": "crid_10", - "h": 90, - "w": 728, - "ext": { - "insticator": { - "mediaType": "banner" - } + } + }, + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id3", + "price": 0.5, + "adm": "some-test-ad", + "crid": "crid_10", + "h": 90, + "w": 728, + "ext": { + "insticator": { + "mediaType": "banner" } } - ] - } - ], - "cur": "USD" - } + } + ] + } + ], + "cur": "USD" } - }, - { - "expectedRequest": { - "uri": "https://insticator.example.com/v1/pbs", - "body": { - "ext": { - "insticator": { - "caller": [ + } + }, + { + "expectedRequest": { + "uri": "https://insticator.example.com/v1/pbs?publisherId=test-publisher-id", + "body": { + "ext": { + "insticator": { + "caller": [ + { + "name": "Prebid-Server", + "version": "n/a" + } + ] + } + }, + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id4", + "banner": { + "format": [ { - "name": "Prebid-Server", - "version": "n/a" + "w": 728, + "h": 90 } ] - } - }, - "id": "test-request-id", - "imp": [ - { - "id":"test-imp-id4", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "insticator": { - "adUnitId": "siab", - "publisherId": "test-publisher-id" - } + }, + "ext": { + "insticator": { + "adUnitId": "siab", + "publisherId": "test-publisher-id" } } - ], - "site": { - "publisher": { - "id": "test-publisher-id" - } } - }, - "impIDs":["test-imp-id4"] + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } + } }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "seat": "insticator", - "bid": [ - { + "impIDs": [ + "test-imp-id4" + ] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "seat": "insticator", + "bid": [ + { "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id4", - "price": 0.500000, + "impid": "test-imp-id4", + "price": 0.5, "adm": "some-test-ad", "crid": "crid_10", "h": 90, @@ -235,95 +280,97 @@ "mediaType": "banner" } } - } - ] - } - ], - "cur": "USD" - } + } + ] + } + ], + "cur": "USD" } } - ], - - "expectedBidResponses": [ - { - "currency": "USD", - "bids": [ - { - "bid": { - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id1", - "price": 0.5, - "adm": "some-test-ad", - "crid": "crid_10", - "w": 728, - "h": 90, - "ext": { - "insticator": { - "mediaType": "banner" - } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id1", + "price": 0.5, + "adm": "some-test-ad", + "crid": "crid_10", + "w": 728, + "h": 90, + "ext": { + "insticator": { + "mediaType": "banner" } - }, - "type": "banner" + } }, - { - "bid": { - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id2", - "price": 0.6, - "adm": "some-test-ad", - "crid": "crid_10", - "w": 728, - "h": 90, - "ext": { - "insticator": { - "mediaType": "banner" - } + "type": "banner", + "seat": "insticator" + }, + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id2", + "price": 0.6, + "adm": "some-test-ad", + "crid": "crid_10", + "w": 728, + "h": 90, + "ext": { + "insticator": { + "mediaType": "banner" } - }, - "type": "banner" + } }, - { - "bid": { - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id3", - "price": 0.5, - "adm": "some-test-ad", - "crid": "crid_10", - "w": 728, - "h": 90, - "ext": { - "insticator": { - "mediaType": "banner" - } + "type": "banner", + "seat": "insticator" + }, + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id3", + "price": 0.5, + "adm": "some-test-ad", + "crid": "crid_10", + "w": 728, + "h": 90, + "ext": { + "insticator": { + "mediaType": "banner" } - }, - "type": "banner" - } - ] - }, - { - "currency": "USD", - "bids": [ - { - "bid": { - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id4", - "price": 0.5, - "adm": "some-test-ad", - "crid": "crid_10", - "w": 728, - "h": 90, - "ext": { - "insticator": { - "mediaType": "banner" - } + } + }, + "type": "banner", + "seat": "insticator" + } + ] + }, + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id4", + "price": 0.5, + "adm": "some-test-ad", + "crid": "crid_10", + "w": 728, + "h": 90, + "ext": { + "insticator": { + "mediaType": "banner" } - }, - "type": "banner" - } - ] - } - ] - } - \ No newline at end of file + } + }, + "type": "banner", + "seat": "insticator" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/insticator/insticatortest/exemplary/site-banner.json b/adapters/insticator/insticatortest/exemplary/site-banner.json index 4586fdc1767..da7a463ce0e 100644 --- a/adapters/insticator/insticatortest/exemplary/site-banner.json +++ b/adapters/insticator/insticatortest/exemplary/site-banner.json @@ -47,7 +47,7 @@ "2001:0db8:85a3:0000:0000:8a2e:0370:7334" ] }, - "uri": "https://insticator.example.com/v1/pbs", + "uri": "https://insticator.example.com/v1/pbs?publisherId=test-publisher-id", "body": { "device": { "ipv6": "2001:0db8:85a3:0000:0000:8a2e:0370:7334", @@ -104,8 +104,10 @@ { "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", "impid": "test-imp-id", - "price": 0.500000, + "price": 0.5, "adm": "some-test-ad", + "adomain": ["insticator.com"], + "cat": ["IAB1"], "crid": "crid_10", "h": 90, "w": 728, @@ -134,6 +136,8 @@ "impid": "test-imp-id", "price": 0.5, "adm": "some-test-ad", + "adomain": ["insticator.com"], + "cat": ["IAB1"], "crid": "crid_10", "w": 728, "h": 90, @@ -144,7 +148,13 @@ } } }, - "type": "banner" + "BidMeta": { + "advertiserDomains": ["insticator.com"], + "mediaType": "banner", + "primaryCatId": "IAB1" + }, + "type": "banner", + "seat": "insticator" } ] } diff --git a/adapters/insticator/insticatortest/exemplary/site-video.json b/adapters/insticator/insticatortest/exemplary/site-video.json index bd7c40af20e..dc220773f31 100644 --- a/adapters/insticator/insticatortest/exemplary/site-video.json +++ b/adapters/insticator/insticatortest/exemplary/site-video.json @@ -5,13 +5,20 @@ { "id": "test-imp-id", "video": { - "w": 728, + "w": 728, "h": 90, - "protocols": [2], + "protocols": [ + 2 + ], "placement": 1, "startdelay": -2, - "playbackmethod": [2], - "mimes": ["foo", "bar"] + "playbackmethod": [ + 2 + ], + "mimes": [ + "foo", + "bar" + ] }, "ext": { "bidder": { @@ -27,11 +34,10 @@ } } }, - "httpCalls": [ { "expectedRequest": { - "uri": "https://insticator.example.com/v1/pbs", + "uri": "https://insticator.example.com/v1/pbs?publisherId=test-publisher-id", "body": { "ext": { "insticator": { @@ -46,15 +52,22 @@ "id": "test-request-id", "imp": [ { - "id":"test-imp-id", + "id": "test-imp-id", "video": { - "w": 728, + "w": 728, "h": 90, - "protocols": [2], + "protocols": [ + 2 + ], "placement": 1, "startdelay": -2, - "playbackmethod": [2], - "mimes": ["foo", "bar"] + "playbackmethod": [ + 2 + ], + "mimes": [ + "foo", + "bar" + ] }, "ext": { "insticator": { @@ -70,7 +83,9 @@ } } }, - "impIDs":["test-imp-id"] + "impIDs": [ + "test-imp-id" + ] }, "mockResponse": { "status": 200, @@ -79,21 +94,26 @@ "seatbid": [ { "seat": "insticator", - "bid": [{ - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id", - "price": 0.500000, - "adm": "some-test-vast-ad", - "mtype": 2, - "crid": "crid_10", - "h": 90, - "w": 728, - "ext": { - "insticator": { - "mediaType": "video" + "bid": [ + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id", + "price": 0.5, + "adm": "some-test-vast-ad", + "adomain": ["insticator.com"], + "cat": ["IAB1-1"], + "dur": 30, + "mtype": 2, + "crid": "crid_10", + "h": 90, + "w": 728, + "ext": { + "insticator": { + "mediaType": "video" + } } } - }] + ] } ], "cur": "USD" @@ -101,7 +121,6 @@ } } ], - "expectedBidResponses": [ { "currency": "USD", @@ -112,6 +131,9 @@ "impid": "test-imp-id", "price": 0.5, "adm": "some-test-vast-ad", + "adomain": ["insticator.com"], + "cat": ["IAB1-1"], + "dur": 30, "crid": "crid_10", "w": 728, "mtype": 2, @@ -122,9 +144,19 @@ } } }, - "type": "video" + "BidMeta": { + "advertiserDomains": ["insticator.com"], + "mediaType": "video", + "primaryCatId": "IAB1-1" + }, + "BidVideo": { + "duration": 30, + "primary_category": "IAB1-1" + }, + "type": "video", + "seat": "insticator" } ] } ] -} +} \ No newline at end of file diff --git a/adapters/insticator/insticatortest/supplemental/204.json b/adapters/insticator/insticatortest/supplemental/204.json index f0a43defb12..e2a7ef57878 100644 --- a/adapters/insticator/insticatortest/supplemental/204.json +++ b/adapters/insticator/insticatortest/supplemental/204.json @@ -1,71 +1,81 @@ { - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "bidder": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 728, + "h": 90 } + ] + }, + "ext": { + "bidder": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" } } - ], - "site": { - "publisher": { - "id": "test-publisher-id" - } } - }, - - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://insticator.example.com/v1/pbs", - "body": { - "ext": { - "insticator": { - "caller": [ + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } + } + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://insticator.example.com/v1/pbs?publisherId=test-publisher-id", + "body": { + "ext": { + "insticator": { + "caller": [ + { + "name": "Prebid-Server", + "version": "n/a" + } + ] + } + }, + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ { - "name": "Prebid-Server", - "version": "n/a" + "w": 728, + "h": 90 } ] - } - }, - "id": "test-request-id", - "imp": [ - { - "id":"test-imp-id", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "insticator": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" - } + }, + "ext": { + "insticator": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" } } - ], - "site": { - "publisher": { - "id": "test-publisher-id" - } } - }, - "impIDs":["test-imp-id"] + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } + } }, - "mockResponse": { - "status": 204, - "body": {} - } + "impIDs": [ + "test-imp-id" + ] + }, + "mockResponse": { + "status": 204, + "body": {} } - ], - "expectedBidResponses": [] - } - \ No newline at end of file + } + ], + "expectedBidResponses": [] +} \ No newline at end of file diff --git a/adapters/insticator/insticatortest/supplemental/app-pubid-absent.json b/adapters/insticator/insticatortest/supplemental/app-pubid-absent.json index 0fcafa58b13..8d52f59282f 100644 --- a/adapters/insticator/insticatortest/supplemental/app-pubid-absent.json +++ b/adapters/insticator/insticatortest/supplemental/app-pubid-absent.json @@ -1,77 +1,89 @@ { - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "bidder": { - "adUnitId": "fake-app-id", - "publisherId": "test-publisher-id" + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 728, + "h": 90 } + ] + }, + "ext": { + "bidder": { + "adUnitId": "fake-app-id", + "publisherId": "test-publisher-id" } } - ], - "app": { - "id": "test-app-id", - "bundle": "test-app.com" + } + ], + "app": { + "id": "test-app-id", + "bundle": "test-app.com" } - }, - - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://insticator.example.com/v1/pbs", - "body": { - "ext": { - "insticator": { - "caller": [ + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://insticator-app.example.com/v1/pbs?publisherId=test-publisher-id", + "body": { + "ext": { + "insticator": { + "caller": [ + { + "name": "Prebid-Server", + "version": "n/a" + } + ] + } + }, + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ { - "name": "Prebid-Server", - "version": "n/a" + "w": 728, + "h": 90 } ] - } - }, - "id": "test-request-id", - "imp": [ - { - "id":"test-imp-id", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "insticator": { - "adUnitId": "fake-app-id", - "publisherId": "test-publisher-id" - } + }, + "ext": { + "insticator": { + "adUnitId": "fake-app-id", + "publisherId": "test-publisher-id" } } - ], - "app": { + } + ], + "app": { "id": "test-app-id", "bundle": "test-app.com", - "publisher": { - "id": "test-publisher-id" - } + "publisher": { + "id": "test-publisher-id" } - }, - "impIDs":["test-imp-id"] + } }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "seat": "insticator", - "bid": [{ + "impIDs": [ + "test-imp-id" + ] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "seat": "insticator", + "bid": [ + { "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", "impid": "test-imp-id", - "price": 0.500000, + "price": 0.5, "adm": "some-test-ad", "crid": "crid_10", "h": 90, @@ -82,39 +94,39 @@ "mediaType": "banner" } } - }] - } - ], - "cur": "USD" - } + } + ] + } + ], + "cur": "USD" } } - ], - - "expectedBidResponses": [ - { - "currency": "USD", - "bids": [ - { - "bid": { - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id", - "price": 0.5, - "adm": "some-test-ad", - "crid": "crid_10", - "w": 728, - "h": 90, - "mtype": 1, - "ext": { - "insticator": { - "mediaType": "banner" - } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id", + "price": 0.5, + "adm": "some-test-ad", + "crid": "crid_10", + "w": 728, + "h": 90, + "mtype": 1, + "ext": { + "insticator": { + "mediaType": "banner" } - }, - "type": "banner" - } - ] - } - ] - } - \ No newline at end of file + } + }, + "type": "banner", + "seat": "insticator" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/insticator/insticatortest/supplemental/bad-imp-ext.json b/adapters/insticator/insticatortest/supplemental/bad-imp-ext.json index 2e0507791a6..71727e03f45 100644 --- a/adapters/insticator/insticatortest/supplemental/bad-imp-ext.json +++ b/adapters/insticator/insticatortest/supplemental/bad-imp-ext.json @@ -1,29 +1,32 @@ { - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "bidder": "invalid ext" - } - } - ], - "site": { - "publisher": { - "id": "test-publisher-id" + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "ext": { + "bidder": "invalid ext" } } - }, - - "expectedMakeRequestsErrors": [ - { - "value": "expect { or n, but found \"", - "comparison": "literal" - } - ] - } - \ No newline at end of file + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } + } + }, + "expectedMakeRequestsErrors": [ + { + "value": "expect { or n, but found \"", + "comparison": "literal" + } + ] +} \ No newline at end of file diff --git a/adapters/insticator/insticatortest/supplemental/currency-conversion-fail.json b/adapters/insticator/insticatortest/supplemental/currency-conversion-fail.json index 4c7082f47d8..1bdc9587da8 100644 --- a/adapters/insticator/insticatortest/supplemental/currency-conversion-fail.json +++ b/adapters/insticator/insticatortest/supplemental/currency-conversion-fail.json @@ -1,49 +1,49 @@ { - "mockBidRequest": { - "cur": [ - "GBP" - ], - "id": "test-request-id", - "imp": [ + "mockBidRequest": { + "cur": [ + "GBP" + ], + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ { - "id": "test-imp-id", - "banner": { - "format": [ - { - "w": 728, - "h": 90 - } - ] - }, - "ext": { - "bidder": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" - } - }, - "bidfloor": 1, - "bidfloorcur": "GBP" - } - ], - "site": { - "publisher": { - "id": "test-publisher-id" + "w": 728, + "h": 90 } + ] }, "ext": { - "prebid": { - "currency": { - "rates": { - "INR": { - "USD": 2 - } - }, - "usepbsrates": false - } + "bidder": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" + } + }, + "bidfloor": 1, + "bidfloorcur": "GBP" + } + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } + }, + "ext": { + "prebid": { + "currency": { + "rates": { + "INR": { + "USD": 2 } + }, + "usepbsrates": false } - }, - "expectedMakeRequestsErrors": [ + } + } + }, + "expectedMakeRequestsErrors": [ { "value": "Error in converting the provided bid floor currency from GBP to USD", "comparison": "literal" diff --git a/adapters/insticator/insticatortest/supplemental/currency-conversion.json b/adapters/insticator/insticatortest/supplemental/currency-conversion.json index 9ce11dcdfbc..61a6fa290d1 100644 --- a/adapters/insticator/insticatortest/supplemental/currency-conversion.json +++ b/adapters/insticator/insticatortest/supplemental/currency-conversion.json @@ -1,152 +1,153 @@ { - "mockBidRequest": { - "cur": [ - "GBP" - ], - "id": "test-request-id", - "imp": [ + "mockBidRequest": { + "cur": [ + "GBP" + ], + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ { - "id": "test-imp-id", - "banner": { - "format": [ - { - "w": 728, - "h": 90 - } - ] - }, - "ext": { - "bidder": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" - } - }, - "bidfloor": 1, - "bidfloorcur": "GBP" - } - ], - "site": { - "publisher": { - "id": "test-publisher-id" + "w": 728, + "h": 90 } + ] }, "ext": { - "prebid": { - "currency": { - "rates": { - "GBP": { - "USD": 2 - } - }, - "usepbsrates": false - } + "bidder": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" + } + }, + "bidfloor": 1, + "bidfloorcur": "GBP" + } + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } + }, + "ext": { + "prebid": { + "currency": { + "rates": { + "GBP": { + "USD": 2 } + }, + "usepbsrates": false } - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://insticator.example.com/v1/pbs", - "body": { - "cur": [ - "GBP" - ], - "ext": { - "insticator": { - "caller": [ - { - "name": "Prebid-Server", - "version": "n/a" - } - ] - } - }, - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [ - { - "w": 728, - "h": 90 - } - ] - }, - "ext": { - "insticator": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" - } - }, - "bidfloor": 2, - "bidfloorcur": "USD" - } - ], - "site": { - "publisher": { - "id": "test-publisher-id" - } - } - }, - "impIDs": [ - "test-imp-id" + } + } + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://insticator.example.com/v1/pbs?publisherId=test-publisher-id", + "body": { + "cur": [ + "GBP" + ], + "ext": { + "insticator": { + "caller": [ + { + "name": "Prebid-Server", + "version": "n/a" + } + ] + } + }, + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } ] - }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "seat": "insticator", - "bid": [ - { - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id", - "price": 0.500000, - "adm": "some-test-ad", - "crid": "crid_10", - "h": 90, - "w": 728, - "mtype": 1, - "ext": { - "insticator": { - "mediaType": "banner" - } - } - } - ] - } - ], - "cur": "USD" + }, + "ext": { + "insticator": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" } + }, + "bidfloor": 2, + "bidfloorcur": "USD" } - } - ], - "expectedBidResponses": [ - { - "currency": "USD", - "bids": [ + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } + } + }, + "impIDs": [ + "test-imp-id" + ] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "seat": "insticator", + "bid": [ { - "bid": { - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id", - "price": 0.5, - "adm": "some-test-ad", - "crid": "crid_10", - "w": 728, - "h": 90, - "mtype": 1, - "ext": { - "insticator": { - "mediaType": "banner" - } - } - }, - "type": "banner" + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id", + "price": 0.5, + "adm": "some-test-ad", + "crid": "crid_10", + "h": 90, + "w": 728, + "mtype": 1, + "ext": { + "insticator": { + "mediaType": "banner" + } + } } - ] + ] + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id", + "price": 0.5, + "adm": "some-test-ad", + "crid": "crid_10", + "w": 728, + "h": 90, + "mtype": 1, + "ext": { + "insticator": { + "mediaType": "banner" + } + } + }, + "type": "banner", + "seat": "insticator" } - ] + ] + } + ] } \ No newline at end of file diff --git a/adapters/insticator/insticatortest/supplemental/device-validation.json b/adapters/insticator/insticatortest/supplemental/device-validation.json index a493e1b28a2..07a243f88b8 100644 --- a/adapters/insticator/insticatortest/supplemental/device-validation.json +++ b/adapters/insticator/insticatortest/supplemental/device-validation.json @@ -56,7 +56,7 @@ "1.22.22.1" ] }, - "uri": "https://insticator.example.com/v1/pbs", + "uri": "https://insticator-app.example.com/v1/pbs?publisherId=test-publisher-id", "body": { "device": { "ip": "1.22.22.1" @@ -120,7 +120,7 @@ { "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", "impid": "test-imp-id", - "price": 0.500000, + "price": 0.5, "adm": "some-test-vast-ad", "mtype": 2, "crid": "crid_10", @@ -160,7 +160,8 @@ } } }, - "type": "video" + "type": "video", + "seat": "insticator" } ] } diff --git a/adapters/insticator/insticatortest/supplemental/multi-imp-mixed-validation.json b/adapters/insticator/insticatortest/supplemental/multi-imp-mixed-validation.json index 18fa069aedc..d98a7eebaf9 100644 --- a/adapters/insticator/insticatortest/supplemental/multi-imp-mixed-validation.json +++ b/adapters/insticator/insticatortest/supplemental/multi-imp-mixed-validation.json @@ -1,110 +1,137 @@ { - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id1", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "bidder": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id1", + "banner": { + "format": [ + { + "w": 728, + "h": 90 } - } + ] }, - { - "id": "test-imp-id2", - "video": { - "mimes": ["video/mp4"], - "minduration": 5, - "maxduration": 30, - "protocols": [2, 3, 5, 6], - "w": 640, - "h": 480 - }, - "ext": { - "bidder": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" - } + "ext": { + "bidder": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" } } - ], - "site": { - "publisher": { - "id": "test-publisher-id" + }, + { + "id": "test-imp-id2", + "video": { + "mimes": [ + "video/mp4" + ], + "minduration": 5, + "maxduration": 30, + "protocols": [ + 2, + 3, + 5, + 6 + ], + "w": 640, + "h": 480 + }, + "ext": { + "bidder": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" + } } } - }, - - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://insticator.example.com/v1/pbs", - "body": { - "ext": { - "insticator": { - "caller": [ + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } + } + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://insticator.example.com/v1/pbs?publisherId=test-publisher-id", + "body": { + "ext": { + "insticator": { + "caller": [ + { + "name": "Prebid-Server", + "version": "n/a" + } + ] + } + }, + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id1", + "banner": { + "format": [ { - "name": "Prebid-Server", - "version": "n/a" + "w": 728, + "h": 90 } ] + }, + "ext": { + "insticator": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" + } } }, - "id": "test-request-id", - "imp": [ - { - "id":"test-imp-id1", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "insticator": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" - } - } + { + "id": "test-imp-id2", + "video": { + "mimes": [ + "video/mp4" + ], + "minduration": 5, + "maxduration": 30, + "protocols": [ + 2, + 3, + 5, + 6 + ], + "w": 640, + "h": 480 }, - { - "id":"test-imp-id2", - "video": { - "mimes": ["video/mp4"], - "minduration": 5, - "maxduration": 30, - "protocols": [2, 3, 5, 6], - "w": 640, - "h": 480 - }, - "ext": { - "insticator": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" - } + "ext": { + "insticator": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" } } - ], - "site": { - "publisher": { - "id": "test-publisher-id" - } } - }, - "impIDs":["test-imp-id1", "test-imp-id2"] + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } + } }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "seat": "insticator", - "bid": [{ + "impIDs": [ + "test-imp-id1", + "test-imp-id2" + ] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "seat": "insticator", + "bid": [ + { "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", "impid": "test-imp-id1", - "price": 0.500000, + "price": 0.5, "adm": "some-test-ad", "crid": "crid_10", "h": 90, @@ -115,38 +142,39 @@ "mediaType": "banner" } } - }] - } - ], - "cur": "USD" - } + } + ] + } + ], + "cur": "USD" } } - ], - "expectedBidResponses": [ - { - "currency": "USD", - "bids": [ - { - "bid": { - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id1", - "price": 0.5, - "adm": "some-test-ad", - "crid": "crid_10", - "w": 728, - "h": 90, - "mtype": 1, - "ext": { - "insticator": { - "mediaType": "banner" - } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id1", + "price": 0.5, + "adm": "some-test-ad", + "crid": "crid_10", + "w": 728, + "h": 90, + "mtype": 1, + "ext": { + "insticator": { + "mediaType": "banner" } - }, - "type": "banner" - } - ] - } - ] - } - \ No newline at end of file + } + }, + "type": "banner", + "seat": "insticator" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/insticator/insticatortest/supplemental/request-ext-unmarshal-fail.json b/adapters/insticator/insticatortest/supplemental/request-ext-unmarshal-fail.json index 1ea883a11c5..3a99a142a19 100644 --- a/adapters/insticator/insticatortest/supplemental/request-ext-unmarshal-fail.json +++ b/adapters/insticator/insticatortest/supplemental/request-ext-unmarshal-fail.json @@ -1,17 +1,24 @@ { -"mockBidRequest": { + "mockBidRequest": { "id": "test-request-id", "imp": [ { "id": "test-imp-id", "video": { - "w": 728, + "w": 728, "h": 90, - "protocols": [2], + "protocols": [ + 2 + ], "placement": 1, "startdelay": -2, - "playbackmethod": [2], - "mimes": ["foo", "bar"] + "playbackmethod": [ + 2 + ], + "mimes": [ + "foo", + "bar" + ] }, "ext": { "bidder": "invalid" @@ -24,18 +31,17 @@ } }, "ext": { - "insticator": "invalid" + "insticator": "invalid" } }, - - "expectedMakeRequestsErrors": [ - { - "value": "cannot unmarshal insticator.reqExt.Insticator: expect { or n, but found \"", - "comparison": "literal" - }, - { - "value": "expect { or n, but found \"", - "comparison": "literal" - } - ] + "expectedMakeRequestsErrors": [ + { + "value": "cannot unmarshal insticator.reqExt.Insticator: expect { or n, but found \"", + "comparison": "literal" + }, + { + "value": "expect { or n, but found \"", + "comparison": "literal" + } + ] } \ No newline at end of file diff --git a/adapters/insticator/insticatortest/supplemental/response-unmarshal-fail.json b/adapters/insticator/insticatortest/supplemental/response-unmarshal-fail.json index a3b40b084e0..7ae1059b9cc 100644 --- a/adapters/insticator/insticatortest/supplemental/response-unmarshal-fail.json +++ b/adapters/insticator/insticatortest/supplemental/response-unmarshal-fail.json @@ -1,102 +1,102 @@ { - "mockBidRequest": { - "id": "test-request-id", - "imp": [ + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "video": { + "w": 728, + "h": 90, + "protocols": [ + 2 + ], + "placement": 1, + "startdelay": -2, + "playbackmethod": [ + 2 + ], + "mimes": [ + "foo", + "bar" + ] + }, + "ext": { + "bidder": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" + } + } + } + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } + } + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://insticator.example.com/v1/pbs?publisherId=test-publisher-id", + "body": { + "ext": { + "insticator": { + "caller": [ + { + "name": "Prebid-Server", + "version": "n/a" + } + ] + } + }, + "id": "test-request-id", + "imp": [ { - "id": "test-imp-id", - "video": { - "w": 728, - "h": 90, - "protocols": [ - 2 - ], - "placement": 1, - "startdelay": -2, - "playbackmethod": [ - 2 - ], - "mimes": [ - "foo", - "bar" - ] - }, - "ext": { - "bidder": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" - } + "id": "test-imp-id", + "video": { + "w": 728, + "h": 90, + "protocols": [ + 2 + ], + "placement": 1, + "startdelay": -2, + "playbackmethod": [ + 2 + ], + "mimes": [ + "foo", + "bar" + ] + }, + "ext": { + "insticator": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" } + } } - ], - "site": { + ], + "site": { "publisher": { - "id": "test-publisher-id" + "id": "test-publisher-id" } - } - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://insticator.example.com/v1/pbs", - "body": { - "ext": { - "insticator": { - "caller": [ - { - "name": "Prebid-Server", - "version": "n/a" - } - ] - } - }, - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "video": { - "w": 728, - "h": 90, - "protocols": [ - 2 - ], - "placement": 1, - "startdelay": -2, - "playbackmethod": [ - 2 - ], - "mimes": [ - "foo", - "bar" - ] - }, - "ext": { - "insticator": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" - } - } - } - ], - "site": { - "publisher": { - "id": "test-publisher-id" - } - } - }, - "impIDs": [ - "test-imp-id" - ] - }, - "mockResponse": { - "status": 200, - "body": "invalid json" - } - } - ], - "expectedMakeBidsErrors": [ - { - "value": "expect { or n, but found \"", - "comparison": "literal" - } - ] + } + }, + "impIDs": [ + "test-imp-id" + ] + }, + "mockResponse": { + "status": 200, + "body": "invalid json" + } + } + ], + "expectedMakeBidsErrors": [ + { + "value": "expect { or n, but found \"", + "comparison": "literal" + } + ] } \ No newline at end of file diff --git a/adapters/insticator/insticatortest/supplemental/site-pubid-absent.json b/adapters/insticator/insticatortest/supplemental/site-pubid-absent.json index 00c694a1975..74782b966ee 100644 --- a/adapters/insticator/insticatortest/supplemental/site-pubid-absent.json +++ b/adapters/insticator/insticatortest/supplemental/site-pubid-absent.json @@ -1,77 +1,89 @@ { - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "bidder": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 728, + "h": 90 } + ] + }, + "ext": { + "bidder": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" } } - ], - "site": { - "id": "test-site-id", - "domain": "test-site.com" + } + ], + "site": { + "id": "test-site-id", + "domain": "test-site.com" } - }, - - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://insticator.example.com/v1/pbs", - "body": { - "ext": { - "insticator": { - "caller": [ + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://insticator.example.com/v1/pbs?publisherId=test-publisher-id", + "body": { + "ext": { + "insticator": { + "caller": [ + { + "name": "Prebid-Server", + "version": "n/a" + } + ] + } + }, + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ { - "name": "Prebid-Server", - "version": "n/a" + "w": 728, + "h": 90 } ] - } - }, - "id": "test-request-id", - "imp": [ - { - "id":"test-imp-id", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "insticator": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" - } + }, + "ext": { + "insticator": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" } } - ], - "site": { + } + ], + "site": { "id": "test-site-id", "domain": "test-site.com", - "publisher": { - "id": "test-publisher-id" - } + "publisher": { + "id": "test-publisher-id" } - }, - "impIDs":["test-imp-id"] + } }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "seat": "insticator", - "bid": [{ + "impIDs": [ + "test-imp-id" + ] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-id", + "seatbid": [ + { + "seat": "insticator", + "bid": [ + { "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", "impid": "test-imp-id", - "price": 0.500000, + "price": 0.5, "adm": "some-test-ad", "crid": "crid_10", "h": 90, @@ -82,39 +94,39 @@ "mediaType": "banner" } } - }] - } - ], - "cur": "USD" - } + } + ] + } + ], + "cur": "USD" } } - ], - - "expectedBidResponses": [ - { - "currency": "USD", - "bids": [ - { - "bid": { - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id", - "price": 0.5, - "adm": "some-test-ad", - "crid": "crid_10", - "w": 728, - "h": 90, - "mtype": 1, - "ext": { - "insticator": { - "mediaType": "banner" - } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id", + "price": 0.5, + "adm": "some-test-ad", + "crid": "crid_10", + "w": 728, + "h": 90, + "mtype": 1, + "ext": { + "insticator": { + "mediaType": "banner" } - }, - "type": "banner" - } - ] - } - ] - } - \ No newline at end of file + } + }, + "type": "banner", + "seat": "insticator" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/insticator/insticatortest/supplemental/status-not-ok.json b/adapters/insticator/insticatortest/supplemental/status-not-ok.json index e530896e2d8..374b2bca26b 100644 --- a/adapters/insticator/insticatortest/supplemental/status-not-ok.json +++ b/adapters/insticator/insticatortest/supplemental/status-not-ok.json @@ -1,86 +1,95 @@ { - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "bidder": { - "adUnitId": "fake-invalid-site-id", - "publisherId": "test-publisher-id" + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 728, + "h": 90 } + ] + }, + "ext": { + "bidder": { + "adUnitId": "fake-invalid-site-id", + "publisherId": "test-publisher-id" } } - ], - "site": { - "publisher": { - "id": "test-publisher-id" - } } - }, - - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://insticator.example.com/v1/pbs", - "body": { - "ext": { - "insticator": { - "caller": [ + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } + } + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://insticator.example.com/v1/pbs?publisherId=test-publisher-id", + "body": { + "ext": { + "insticator": { + "caller": [ + { + "name": "Prebid-Server", + "version": "n/a" + } + ] + } + }, + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ { - "name": "Prebid-Server", - "version": "n/a" + "w": 728, + "h": 90 } ] - } - }, - "id": "test-request-id", - "imp": [ - { - "id":"test-imp-id", - "banner": { - "format": [{"w": 728, "h": 90}] - }, - "ext": { - "insticator": { - "adUnitId": "fake-invalid-site-id", - "publisherId": "test-publisher-id" - } + }, + "ext": { + "insticator": { + "adUnitId": "fake-invalid-site-id", + "publisherId": "test-publisher-id" } } - ], - "site": { - "publisher": { - "id": "test-publisher-id" - } } - }, - "impIDs":["test-imp-id"] - }, - "mockResponse": { - "status": 400, - "body": { - "error": { - "message": "Validation failed", - "details": [ - { - "message": "site.id is invalid" - } - ] + ], + "site": { + "publisher": { + "id": "test-publisher-id" + } } + }, + "impIDs": [ + "test-imp-id" + ] + }, + "mockResponse": { + "status": 400, + "body": { + "error": { + "message": "Validation failed", + "details": [ + { + "message": "site.id is invalid" + } + ] } } } - ], - - "expectedMakeBidsErrors": [ - { - "value": "Unexpected status code: 400. Run with request.debug = 1 for more info", - "comparison": "literal" - } - ] - } - \ No newline at end of file + } + ], + "expectedMakeBidsErrors": [ + { + "value": "Unexpected status code: 400. Run with request.debug = 1 for more info", + "comparison": "literal" + } + ] +} \ No newline at end of file diff --git a/adapters/insticator/insticatortest/supplemental/video-validation-fail.json b/adapters/insticator/insticatortest/supplemental/video-validation-fail.json index 553b0f68c67..51f40f8333c 100644 --- a/adapters/insticator/insticatortest/supplemental/video-validation-fail.json +++ b/adapters/insticator/insticatortest/supplemental/video-validation-fail.json @@ -1,33 +1,31 @@ { - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "video": { - "w": 728, - "h": 90 - }, - "ext": { - "bidder": { - "adUnitId": "fake-site-id", - "publisherId": "test-publisher-id" - } + "mockBidRequest": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "video": { + "w": 728, + "h": 90 + }, + "ext": { + "bidder": { + "adUnitId": "fake-site-id", + "publisherId": "test-publisher-id" } } - ], - "site": { - "publisher": { - "id": "test-publisher-id" - } } - }, - - "expectedMakeRequestsErrors": [ - { - "value": "One or more invalid or missing video field(s) w, h, mimes", - "comparison": "literal" + ], + "site": { + "publisher": { + "id": "test-publisher-id" } - ] - } - \ No newline at end of file + } + }, + "expectedMakeRequestsErrors": [ + { + "value": "One or more invalid or missing video field(s) w, h, mimes", + "comparison": "literal" + } + ] +} \ No newline at end of file diff --git a/static/bidder-info/insticator.yaml b/static/bidder-info/insticator.yaml index 907ff4a50d1..adef8536d66 100644 --- a/static/bidder-info/insticator.yaml +++ b/static/bidder-info/insticator.yaml @@ -1,7 +1,11 @@ endpoint: "https://ex.ingage.tech/v1/prebidserver" +extra_info: '{"app_endpoint":"https://aex.ingage.tech/v1/prebidserver"}' +endpointCompression: GZIP maintainer: email: "prebid@insticator.com" gvlVendorID: 910 +openrtb: + version: "2.6" capabilities: app: mediaTypes: diff --git a/static/bidder-params/insticator.json b/static/bidder-params/insticator.json index 358ec37f579..7e6f8d635d1 100644 --- a/static/bidder-params/insticator.json +++ b/static/bidder-params/insticator.json @@ -3,7 +3,7 @@ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Insticator Adapter Params", "description": "A schema which validates params accepted by Insticator", - + "type": "object", "properties": { "adUnitId": {