Skip to content

Commit 14abf2f

Browse files
authoredJan 21, 2025
New Adapter: Ads Interactive (prebid#3929)
1 parent 0a24410 commit 14abf2f

21 files changed

+1714
-0
lines changed
 
+158
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
package ads_interactive
2+
3+
import (
4+
"encoding/json"
5+
"fmt"
6+
"net/http"
7+
8+
"github.com/prebid/openrtb/v20/openrtb2"
9+
"github.com/prebid/prebid-server/v3/adapters"
10+
"github.com/prebid/prebid-server/v3/config"
11+
"github.com/prebid/prebid-server/v3/openrtb_ext"
12+
"github.com/prebid/prebid-server/v3/util/jsonutil"
13+
)
14+
15+
type adapter struct {
16+
endpoint string
17+
}
18+
19+
type reqBodyExt struct {
20+
AdsInteractiveBidderExt reqBodyExtBidder `json:"bidder"`
21+
}
22+
23+
type reqBodyExtBidder struct {
24+
Type string `json:"type"`
25+
PlacementID string `json:"placementId,omitempty"`
26+
EndpointID string `json:"endpointId,omitempty"`
27+
}
28+
29+
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) {
30+
bidder := &adapter{
31+
endpoint: config.Endpoint,
32+
}
33+
return bidder, nil
34+
}
35+
36+
func (a *adapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
37+
var errs []error
38+
var adapterRequests []*adapters.RequestData
39+
40+
for _, imp := range request.Imp {
41+
reqCopy := *request
42+
reqCopy.Imp = []openrtb2.Imp{imp}
43+
44+
var bidderExt adapters.ExtImpBidder
45+
var adsInteractiveExt openrtb_ext.ImpExtAdsInteractive
46+
47+
if err := jsonutil.Unmarshal(imp.Ext, &bidderExt); err != nil {
48+
errs = append(errs, err)
49+
continue
50+
}
51+
if err := jsonutil.Unmarshal(bidderExt.Bidder, &adsInteractiveExt); err != nil {
52+
errs = append(errs, err)
53+
continue
54+
}
55+
56+
impExt := reqBodyExt{AdsInteractiveBidderExt: reqBodyExtBidder{}}
57+
58+
if adsInteractiveExt.PlacementID != "" {
59+
impExt.AdsInteractiveBidderExt.PlacementID = adsInteractiveExt.PlacementID
60+
impExt.AdsInteractiveBidderExt.Type = "publisher"
61+
} else if adsInteractiveExt.EndpointID != "" {
62+
impExt.AdsInteractiveBidderExt.EndpointID = adsInteractiveExt.EndpointID
63+
impExt.AdsInteractiveBidderExt.Type = "network"
64+
}
65+
66+
finalImpExt, err := json.Marshal(impExt)
67+
if err != nil {
68+
errs = append(errs, err)
69+
continue
70+
}
71+
72+
reqCopy.Imp[0].Ext = finalImpExt
73+
74+
adapterReq, err := a.makeRequest(&reqCopy)
75+
if err != nil {
76+
errs = append(errs, err)
77+
continue
78+
}
79+
80+
if adapterReq != nil {
81+
adapterRequests = append(adapterRequests, adapterReq)
82+
}
83+
}
84+
85+
if len(adapterRequests) == 0 {
86+
return nil, errs
87+
}
88+
89+
return adapterRequests, nil
90+
}
91+
92+
func (a *adapter) makeRequest(request *openrtb2.BidRequest) (*adapters.RequestData, error) {
93+
reqJSON, err := json.Marshal(request)
94+
if err != nil {
95+
return nil, err
96+
}
97+
98+
headers := http.Header{}
99+
headers.Add("Content-Type", "application/json;charset=utf-8")
100+
headers.Add("Accept", "application/json")
101+
return &adapters.RequestData{
102+
Method: "POST",
103+
Uri: a.endpoint,
104+
Body: reqJSON,
105+
Headers: headers,
106+
ImpIDs: openrtb_ext.GetImpIDs(request.Imp),
107+
}, nil
108+
}
109+
110+
func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.RequestData, responseData *adapters.ResponseData) (*adapters.BidderResponse, []error) {
111+
if adapters.IsResponseStatusCodeNoContent(responseData) {
112+
return nil, nil
113+
}
114+
115+
if err := adapters.CheckResponseStatusCodeForErrors(responseData); err != nil {
116+
return nil, []error{err}
117+
}
118+
119+
var response openrtb2.BidResponse
120+
if err := jsonutil.Unmarshal(responseData.Body, &response); err != nil {
121+
return nil, []error{err}
122+
}
123+
124+
bidResponse := adapters.NewBidderResponseWithBidsCapacity(len(request.Imp))
125+
if len(response.Cur) != 0 {
126+
bidResponse.Currency = response.Cur
127+
}
128+
129+
for _, seatBid := range response.SeatBid {
130+
for i := range seatBid.Bid {
131+
bidType, err := getBidType(seatBid.Bid[i])
132+
if err != nil {
133+
return nil, []error{err}
134+
}
135+
136+
b := &adapters.TypedBid{
137+
Bid: &seatBid.Bid[i],
138+
BidType: bidType,
139+
}
140+
bidResponse.Bids = append(bidResponse.Bids, b)
141+
}
142+
}
143+
return bidResponse, nil
144+
}
145+
146+
func getBidType(bid openrtb2.Bid) (openrtb_ext.BidType, error) {
147+
// determinate media type by bid response field mtype
148+
switch bid.MType {
149+
case openrtb2.MarkupBanner:
150+
return openrtb_ext.BidTypeBanner, nil
151+
case openrtb2.MarkupVideo:
152+
return openrtb_ext.BidTypeVideo, nil
153+
case openrtb2.MarkupNative:
154+
return openrtb_ext.BidTypeNative, nil
155+
}
156+
157+
return "", fmt.Errorf("could not define media type for impression: %s", bid.ImpID)
158+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package ads_interactive
2+
3+
import (
4+
"testing"
5+
6+
"github.com/prebid/prebid-server/v3/adapters/adapterstest"
7+
"github.com/prebid/prebid-server/v3/config"
8+
"github.com/prebid/prebid-server/v3/openrtb_ext"
9+
)
10+
11+
func TestJsonSamples(t *testing.T) {
12+
bidder, buildErr := Builder(openrtb_ext.BidderAdsInteractive, config.Adapter{
13+
Endpoint: "https://example.com"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})
14+
15+
if buildErr != nil {
16+
t.Fatalf("Builder returned unexpected error %v", buildErr)
17+
}
18+
19+
adapterstest.RunJSONBidderTest(t, "ads_interactivetest", bidder)
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
{
2+
"mockBidRequest": {
3+
"id": "test-request-id",
4+
"device": {
5+
"ip": "123.123.123.123",
6+
"ua": "iPad"
7+
},
8+
"app": {
9+
"id": "1",
10+
"bundle": "com.wls.testwlsapplication"
11+
},
12+
"imp": [
13+
{
14+
"id": "test-imp-id",
15+
"tagid": "test",
16+
"banner": {
17+
"format": [
18+
{
19+
"w": 300,
20+
"h": 250
21+
},
22+
{
23+
"w": 300,
24+
"h": 600
25+
}
26+
]
27+
},
28+
"ext": {
29+
"bidder": {
30+
"endpointId": "test"
31+
}
32+
}
33+
}
34+
]
35+
},
36+
"httpCalls": [
37+
{
38+
"expectedRequest": {
39+
"uri": "https://example.com",
40+
"body": {
41+
"id": "test-request-id",
42+
"imp": [
43+
{
44+
"id": "test-imp-id",
45+
"tagid": "test",
46+
"banner": {
47+
"format": [
48+
{
49+
"w": 300,
50+
"h": 250
51+
},
52+
{
53+
"w": 300,
54+
"h": 600
55+
}
56+
]
57+
},
58+
"ext": {
59+
"bidder": {
60+
"endpointId": "test",
61+
"type": "network"
62+
}
63+
}
64+
}
65+
],
66+
"app": {
67+
"id": "1",
68+
"bundle": "com.wls.testwlsapplication"
69+
},
70+
"device": {
71+
"ip": "123.123.123.123",
72+
"ua": "iPad"
73+
}
74+
},
75+
"impIDs":["test-imp-id"]
76+
},
77+
"mockResponse": {
78+
"status": 200,
79+
"body": {
80+
"id": "test-request-id",
81+
"seatbid": [
82+
{
83+
"bid": [
84+
{
85+
"id": "test_bid_id",
86+
"impid": "test-imp-id",
87+
"price": 0.27543,
88+
"adm": "<iframe id=\"adm-banner-16\" width=\"300\" height=\"250\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" style=\"{overflow:hidden}\" src=\"https://example.com&k=882b2510ed6d6c94fa69c99aa522a708\"></iframe>",
89+
"cid": "test_cid",
90+
"crid": "test_crid",
91+
"dealid": "test_dealid",
92+
"mtype": 1,
93+
"w": 300,
94+
"h": 250,
95+
"ext": {
96+
"prebid": {
97+
"type": "banner"
98+
}
99+
}
100+
}
101+
],
102+
"seat": "ads_interactive"
103+
}
104+
],
105+
"cur": "USD"
106+
}
107+
}
108+
}
109+
],
110+
"expectedBidResponses": [
111+
{
112+
"bids": [
113+
{
114+
"bid": {
115+
"id": "test_bid_id",
116+
"impid": "test-imp-id",
117+
"price": 0.27543,
118+
"adm": "<iframe id=\"adm-banner-16\" width=\"300\" height=\"250\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" style=\"{overflow:hidden}\" src=\"https://example.com&k=882b2510ed6d6c94fa69c99aa522a708\"></iframe>",
119+
"cid": "test_cid",
120+
"crid": "test_crid",
121+
"dealid": "test_dealid",
122+
"mtype": 1,
123+
"w": 300,
124+
"h": 250,
125+
"ext": {
126+
"prebid": {
127+
"type": "banner"
128+
}
129+
}
130+
},
131+
"type": "banner"
132+
}
133+
]
134+
}
135+
]
136+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"mockBidRequest": {
3+
"id": "test-request-id",
4+
"device": {
5+
"ip": "123.123.123.123",
6+
"ua": "iPad"
7+
},
8+
"app": {
9+
"id": "1",
10+
"bundle": "com.wls.testwlsapplication"
11+
},
12+
"imp": [
13+
{
14+
"id": "test-imp-id",
15+
"tagid": "test",
16+
"banner": {
17+
"format": [
18+
{
19+
"w": 300,
20+
"h": 250
21+
},
22+
{
23+
"w": 300,
24+
"h": 600
25+
}
26+
]
27+
},
28+
"video": {
29+
"mimes": [
30+
"video/mp4"
31+
],
32+
"protocols": [
33+
2,
34+
5
35+
],
36+
"w": 1024,
37+
"h": 576
38+
},
39+
"ext": {
40+
"bidder": {
41+
"endpointId": "test"
42+
}
43+
}
44+
}
45+
]
46+
},
47+
"httpCalls": [
48+
{
49+
"expectedRequest": {
50+
"uri": "https://example.com",
51+
"body": {
52+
"id": "test-request-id",
53+
"imp": [
54+
{
55+
"id": "test-imp-id",
56+
"tagid": "test",
57+
"banner": {
58+
"format": [
59+
{
60+
"w": 300,
61+
"h": 250
62+
},
63+
{
64+
"w": 300,
65+
"h": 600
66+
}
67+
]
68+
},
69+
"video": {
70+
"mimes": [
71+
"video/mp4"
72+
],
73+
"protocols": [
74+
2,
75+
5
76+
],
77+
"w": 1024,
78+
"h": 576
79+
},
80+
"ext": {
81+
"bidder": {
82+
"endpointId": "test",
83+
"type": "network"
84+
}
85+
}
86+
}
87+
],
88+
"app": {
89+
"id": "1",
90+
"bundle": "com.wls.testwlsapplication"
91+
},
92+
"device": {
93+
"ip": "123.123.123.123",
94+
"ua": "iPad"
95+
}
96+
},
97+
"impIDs":["test-imp-id"]
98+
},
99+
"mockResponse": {
100+
"status": 204
101+
}
102+
}
103+
],
104+
"expectedBidResponses": []
105+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
{
2+
"mockBidRequest": {
3+
"id": "test-request-id",
4+
"device": {
5+
"ip": "123.123.123.123",
6+
"ua": "iPad"
7+
},
8+
"app": {
9+
"id": "1",
10+
"bundle": "com.wls.testwlsapplication"
11+
},
12+
"imp": [
13+
{
14+
"id": "test-imp-id",
15+
"tagid": "test",
16+
"banner": {
17+
"format": [
18+
{
19+
"w": 300,
20+
"h": 250
21+
},
22+
{
23+
"w": 300,
24+
"h": 600
25+
}
26+
]
27+
},
28+
"ext": {
29+
"bidder": {
30+
"endpointId": "test"
31+
}
32+
}
33+
},
34+
{
35+
"id": "test-imp-id2",
36+
"tagid": "test2",
37+
"banner": {
38+
"format": [
39+
{
40+
"w": 3000,
41+
"h": 2500
42+
},
43+
{
44+
"w": 3000,
45+
"h": 6000
46+
}
47+
]
48+
},
49+
"ext": {
50+
"bidder": {
51+
"endpointId": "test2"
52+
}
53+
}
54+
}
55+
]
56+
},
57+
"httpCalls": [
58+
{
59+
"expectedRequest": {
60+
"uri": "https://example.com",
61+
"body": {
62+
"id": "test-request-id",
63+
"imp": [
64+
{
65+
"id": "test-imp-id",
66+
"tagid": "test",
67+
"banner": {
68+
"format": [
69+
{
70+
"w": 300,
71+
"h": 250
72+
},
73+
{
74+
"w": 300,
75+
"h": 600
76+
}
77+
]
78+
},
79+
"ext": {
80+
"bidder": {
81+
"endpointId": "test",
82+
"type": "network"
83+
}
84+
}
85+
}
86+
],
87+
"app": {
88+
"id": "1",
89+
"bundle": "com.wls.testwlsapplication"
90+
},
91+
"device": {
92+
"ip": "123.123.123.123",
93+
"ua": "iPad"
94+
}
95+
},
96+
"impIDs":["test-imp-id"]
97+
},
98+
"mockResponse": {
99+
"status": 200,
100+
"body": {
101+
"id": "test-request-id",
102+
"seatbid": [
103+
{
104+
"bid": [
105+
{
106+
"id": "test_bid_id",
107+
"impid": "test-imp-id",
108+
"price": 0.27543,
109+
"adm": "<iframe id=\"adm-banner-16\" width=\"300\" height=\"250\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" style=\"{overflow:hidden}\" src=\"https://example.com&k=882b2510ed6d6c94fa69c99aa522a708\"></iframe>",
110+
"cid": "test_cid",
111+
"crid": "test_crid",
112+
"dealid": "test_dealid",
113+
"mtype": 1,
114+
"w": 300,
115+
"h": 250,
116+
"ext": {
117+
"prebid": {
118+
"type": "banner"
119+
}
120+
}
121+
}
122+
],
123+
"seat": "ads_interactive"
124+
}
125+
],
126+
"cur": "USD"
127+
}
128+
}
129+
},
130+
{
131+
"expectedRequest": {
132+
"uri": "https://example.com",
133+
"body": {
134+
"id": "test-request-id",
135+
"imp": [
136+
{
137+
"id": "test-imp-id2",
138+
"tagid": "test2",
139+
"banner": {
140+
"format": [
141+
{
142+
"w": 3000,
143+
"h": 2500
144+
},
145+
{
146+
"w": 3000,
147+
"h": 6000
148+
}
149+
]
150+
},
151+
"ext": {
152+
"bidder": {
153+
"endpointId": "test2",
154+
"type": "network"
155+
}
156+
}
157+
}
158+
],
159+
"app": {
160+
"id": "1",
161+
"bundle": "com.wls.testwlsapplication"
162+
},
163+
"device": {
164+
"ip": "123.123.123.123",
165+
"ua": "iPad"
166+
}
167+
},
168+
"impIDs":["test-imp-id2"]
169+
},
170+
"mockResponse": {
171+
"status": 200,
172+
"body": {
173+
"id": "test-request-id",
174+
"seatbid": [
175+
{
176+
"bid": [
177+
{
178+
"id": "test_bid_id",
179+
"impid": "test-imp-id2",
180+
"price": 0.27543,
181+
"adm": "<iframe id=\"adm-banner-16\" width=\"300\" height=\"250\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" style=\"{overflow:hidden}\" src=\"https://example.com&k=882b2510ed6d6c94fa69c99aa522a708\"></iframe>",
182+
"cid": "test_cid",
183+
"crid": "test_crid",
184+
"dealid": "test_dealid",
185+
"mtype": 1,
186+
"w": 3000,
187+
"h": 2500,
188+
"ext": {
189+
"prebid": {
190+
"type": "banner"
191+
}
192+
}
193+
}
194+
],
195+
"seat": "ads_interactive"
196+
}
197+
],
198+
"cur": "USD"
199+
}
200+
}
201+
}
202+
],
203+
"expectedBidResponses": [
204+
{
205+
"bids": [
206+
{
207+
"bid": {
208+
"id": "test_bid_id",
209+
"impid": "test-imp-id",
210+
"price": 0.27543,
211+
"adm": "<iframe id=\"adm-banner-16\" width=\"300\" height=\"250\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" style=\"{overflow:hidden}\" src=\"https://example.com&k=882b2510ed6d6c94fa69c99aa522a708\"></iframe>",
212+
"cid": "test_cid",
213+
"crid": "test_crid",
214+
"dealid": "test_dealid",
215+
"mtype": 1,
216+
"w": 300,
217+
"h": 250,
218+
"ext": {
219+
"prebid": {
220+
"type": "banner"
221+
}
222+
}
223+
},
224+
"type": "banner"
225+
}
226+
]
227+
},
228+
{
229+
"bids": [
230+
{
231+
"bid": {
232+
"id": "test_bid_id",
233+
"impid": "test-imp-id2",
234+
"price": 0.27543,
235+
"adm": "<iframe id=\"adm-banner-16\" width=\"300\" height=\"250\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" style=\"{overflow:hidden}\" src=\"https://example.com&k=882b2510ed6d6c94fa69c99aa522a708\"></iframe>",
236+
"cid": "test_cid",
237+
"crid": "test_crid",
238+
"dealid": "test_dealid",
239+
"mtype": 1,
240+
"w": 3000,
241+
"h": 2500,
242+
"ext": {
243+
"prebid": {
244+
"type": "banner"
245+
}
246+
}
247+
},
248+
"type": "banner"
249+
}
250+
]
251+
}
252+
]
253+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
{
2+
"mockBidRequest": {
3+
"id": "test-request-id",
4+
"device": {
5+
"ip": "123.123.123.123",
6+
"ua": "iPad"
7+
},
8+
"app": {
9+
"id": "1",
10+
"bundle": "com.wls.testwlsapplication"
11+
},
12+
"imp": [
13+
{
14+
"id": "test-imp-id",
15+
"tagid": "test",
16+
"banner": {
17+
"format": [
18+
{
19+
"w": 300,
20+
"h": 250
21+
},
22+
{
23+
"w": 300,
24+
"h": 600
25+
}
26+
]
27+
},
28+
"ext": {
29+
"bidder": {
30+
"placementId": "test"
31+
}
32+
}
33+
}
34+
]
35+
},
36+
"httpCalls": [
37+
{
38+
"expectedRequest": {
39+
"uri": "https://example.com",
40+
"body": {
41+
"id": "test-request-id",
42+
"imp": [
43+
{
44+
"id": "test-imp-id",
45+
"tagid": "test",
46+
"banner": {
47+
"format": [
48+
{
49+
"w": 300,
50+
"h": 250
51+
},
52+
{
53+
"w": 300,
54+
"h": 600
55+
}
56+
]
57+
},
58+
"ext": {
59+
"bidder": {
60+
"placementId": "test",
61+
"type": "publisher"
62+
}
63+
}
64+
}
65+
],
66+
"app": {
67+
"id": "1",
68+
"bundle": "com.wls.testwlsapplication"
69+
},
70+
"device": {
71+
"ip": "123.123.123.123",
72+
"ua": "iPad"
73+
}
74+
},
75+
"impIDs":["test-imp-id"]
76+
},
77+
"mockResponse": {
78+
"status": 200,
79+
"body": {
80+
"id": "test-request-id",
81+
"seatbid": [
82+
{
83+
"bid": [
84+
{
85+
"id": "test_bid_id",
86+
"impid": "test-imp-id",
87+
"price": 0.27543,
88+
"adm": "<iframe id=\"adm-banner-16\" width=\"300\" height=\"250\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" style=\"{overflow:hidden}\" src=\"https://example.com&k=882b2510ed6d6c94fa69c99aa522a708\"></iframe>",
89+
"cid": "test_cid",
90+
"crid": "test_crid",
91+
"dealid": "test_dealid",
92+
"mtype": 1,
93+
"w": 300,
94+
"h": 250,
95+
"ext": {
96+
"prebid": {
97+
"type": "banner"
98+
}
99+
}
100+
}
101+
],
102+
"seat": "ads_interactive"
103+
}
104+
],
105+
"cur": "USD"
106+
}
107+
}
108+
}
109+
],
110+
"expectedBidResponses": [
111+
{
112+
"bids": [
113+
{
114+
"bid": {
115+
"id": "test_bid_id",
116+
"impid": "test-imp-id",
117+
"price": 0.27543,
118+
"adm": "<iframe id=\"adm-banner-16\" width=\"300\" height=\"250\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" style=\"{overflow:hidden}\" src=\"https://example.com&k=882b2510ed6d6c94fa69c99aa522a708\"></iframe>",
119+
"cid": "test_cid",
120+
"crid": "test_crid",
121+
"dealid": "test_dealid",
122+
"mtype": 1,
123+
"w": 300,
124+
"h": 250,
125+
"ext": {
126+
"prebid": {
127+
"type": "banner"
128+
}
129+
}
130+
},
131+
"type": "banner"
132+
}
133+
]
134+
}
135+
]
136+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
{
2+
"mockBidRequest": {
3+
"id": "test-request-id",
4+
"device": {
5+
"ip": "123.123.123.123",
6+
"ua": "iPad"
7+
},
8+
"app": {
9+
"id": "1",
10+
"bundle": "com.wls.testwlsapplication"
11+
},
12+
"imp": [
13+
{
14+
"id": "test-imp-id",
15+
"tagid": "test",
16+
"native": {
17+
"request": "{\"ver\":\"1.1\",\"layout\":1,\"adunit\":2,\"plcmtcnt\":6,\"plcmttype\":4,\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":75}},{\"id\":2,\"required\":1,\"img\":{\"wmin\":492,\"hmin\":328,\"type\":3,\"mimes\":[\"image/jpeg\",\"image/jpg\",\"image/png\"]}},{\"id\":4,\"required\":0,\"data\":{\"type\":6}},{\"id\":5,\"required\":0,\"data\":{\"type\":7}},{\"id\":6,\"required\":0,\"data\":{\"type\":1,\"len\":20}}]}",
18+
"ver": "1.1"
19+
},
20+
"ext": {
21+
"bidder": {
22+
"placementId": "test"
23+
}
24+
}
25+
}
26+
]
27+
},
28+
"httpCalls": [
29+
{
30+
"expectedRequest": {
31+
"uri": "https://example.com",
32+
"body": {
33+
"id": "test-request-id",
34+
"imp": [
35+
{
36+
"id": "test-imp-id",
37+
"tagid": "test",
38+
"native": {
39+
"request": "{\"ver\":\"1.1\",\"layout\":1,\"adunit\":2,\"plcmtcnt\":6,\"plcmttype\":4,\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":75}},{\"id\":2,\"required\":1,\"img\":{\"wmin\":492,\"hmin\":328,\"type\":3,\"mimes\":[\"image/jpeg\",\"image/jpg\",\"image/png\"]}},{\"id\":4,\"required\":0,\"data\":{\"type\":6}},{\"id\":5,\"required\":0,\"data\":{\"type\":7}},{\"id\":6,\"required\":0,\"data\":{\"type\":1,\"len\":20}}]}",
40+
"ver": "1.1"
41+
},
42+
"ext": {
43+
"bidder": {
44+
"placementId": "test",
45+
"type": "publisher"
46+
}
47+
}
48+
}
49+
],
50+
"app": {
51+
"id": "1",
52+
"bundle": "com.wls.testwlsapplication"
53+
},
54+
"device": {
55+
"ip": "123.123.123.123",
56+
"ua": "iPad"
57+
}
58+
},
59+
"impIDs":["test-imp-id"]
60+
},
61+
"mockResponse": {
62+
"status": 200,
63+
"body": {
64+
"id": "test-request-id",
65+
"seatbid": [
66+
{
67+
"bid": [
68+
{
69+
"id": "test_bid_id",
70+
"impid": "test-imp-id",
71+
"price": 0.27543,
72+
"adm": "<iframe id=\"adm-banner-16\" width=\"300\" height=\"250\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" style=\"{overflow:hidden}\" src=\"https://example.com&k=882b2510ed6d6c94fa69c99aa522a708\"></iframe>",
73+
"cid": "test_cid",
74+
"crid": "test_crid",
75+
"dealid": "test_dealid",
76+
"mtype": 4,
77+
"w": 300,
78+
"h": 250,
79+
"ext": {
80+
"prebid": {
81+
"type": "native"
82+
}
83+
}
84+
}
85+
],
86+
"seat": "ads_interactive"
87+
}
88+
],
89+
"cur": "USD"
90+
}
91+
}
92+
}
93+
],
94+
"expectedBidResponses": [
95+
{
96+
"bids": [
97+
{
98+
"bid": {
99+
"id": "test_bid_id",
100+
"impid": "test-imp-id",
101+
"price": 0.27543,
102+
"adm": "<iframe id=\"adm-banner-16\" width=\"300\" height=\"250\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" style=\"{overflow:hidden}\" src=\"https://example.com&k=882b2510ed6d6c94fa69c99aa522a708\"></iframe>",
103+
"cid": "test_cid",
104+
"crid": "test_crid",
105+
"dealid": "test_dealid",
106+
"mtype": 4,
107+
"w": 300,
108+
"h": 250,
109+
"ext": {
110+
"prebid": {
111+
"type": "native"
112+
}
113+
}
114+
},
115+
"type": "native"
116+
}
117+
]
118+
}
119+
]
120+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
{
2+
"mockBidRequest": {
3+
"id": "test-request-id",
4+
"device": {
5+
"ip": "123.123.123.123",
6+
"ua": "iPad"
7+
},
8+
"app": {
9+
"id": "1",
10+
"bundle": "com.wls.testwlsapplication"
11+
},
12+
"imp": [
13+
{
14+
"id": "test-imp-id",
15+
"tagid": "test",
16+
"video": {
17+
"mimes": [
18+
"video/mp4"
19+
],
20+
"protocols": [
21+
2,
22+
5
23+
],
24+
"w": 1024,
25+
"h": 576
26+
},
27+
"ext": {
28+
"bidder": {
29+
"placementId": "test"
30+
}
31+
}
32+
}
33+
]
34+
},
35+
"httpCalls": [
36+
{
37+
"expectedRequest": {
38+
"uri": "https://example.com",
39+
"body": {
40+
"id": "test-request-id",
41+
"device": {
42+
"ip": "123.123.123.123",
43+
"ua": "iPad"
44+
},
45+
"app": {
46+
"id": "1",
47+
"bundle": "com.wls.testwlsapplication"
48+
},
49+
"imp": [
50+
{
51+
"id": "test-imp-id",
52+
"tagid": "test",
53+
"video": {
54+
"mimes": [
55+
"video/mp4"
56+
],
57+
"protocols": [
58+
2,
59+
5
60+
],
61+
"w": 1024,
62+
"h": 576
63+
},
64+
"ext": {
65+
"bidder": {
66+
"placementId": "test",
67+
"type": "publisher"
68+
}
69+
}
70+
}
71+
]
72+
},
73+
"impIDs":["test-imp-id"]
74+
},
75+
"mockResponse": {
76+
"status": 200,
77+
"body": {
78+
"id": "test-request-id",
79+
"seatbid": [
80+
{
81+
"bid": [
82+
{
83+
"id": "test_bid_id",
84+
"impid": "test-imp-id",
85+
"price": 0.27543,
86+
"adm": "<VAST version=\"3.0\"><Ad id=\"20001\" sequence=\"1\"><InLine><AdSystem version=\"4.0\"><![CDATA[iabtechlab]]></AdSystem><AdTitle><![CDATA[Inline Simple Ad]]></AdTitle><Impression><![CDATA[]]></Impression><Creatives><Creative id=\"5480\" sequence=\"1\"><Linear><Duration>00:01:00</Duration><MediaFiles><MediaFile id=\"5246\" delivery=\"progressive\" type=\"video/mp4\" bitrate=\"600\" width=\"640\" height=\"360\" minBitrate=\"500\" maxBitrate=\"700\" scalable=\"1\" maintainAspectRatio=\"1\" codec=\"0\"><![CDATA[https://s0.2mdn.net/4253510/google_ddm_animation_480P.mp4]]></MediaFile></MediaFiles><VideoClicks><ClickThrough id=\"blog\"><![CDATA[https://example.com]]></ClickThrough></VideoClicks></Linear></Creative></Creatives></InLine></Ad></VAST>",
87+
"cid": "test_cid",
88+
"crid": "test_crid",
89+
"dealid": "test_dealid",
90+
"mtype": 2,
91+
"ext": {
92+
"prebid": {
93+
"type": "video"
94+
}
95+
}
96+
}
97+
],
98+
"seat": "ads_interactive"
99+
}
100+
],
101+
"cur": "USD"
102+
}
103+
}
104+
}
105+
],
106+
"expectedBidResponses": [
107+
{
108+
"currency": "USD",
109+
"bids": [
110+
{
111+
"bid": {
112+
"id": "test_bid_id",
113+
"impid": "test-imp-id",
114+
"price": 0.27543,
115+
"adm": "<VAST version=\"3.0\"><Ad id=\"20001\" sequence=\"1\"><InLine><AdSystem version=\"4.0\"><![CDATA[iabtechlab]]></AdSystem><AdTitle><![CDATA[Inline Simple Ad]]></AdTitle><Impression><![CDATA[]]></Impression><Creatives><Creative id=\"5480\" sequence=\"1\"><Linear><Duration>00:01:00</Duration><MediaFiles><MediaFile id=\"5246\" delivery=\"progressive\" type=\"video/mp4\" bitrate=\"600\" width=\"640\" height=\"360\" minBitrate=\"500\" maxBitrate=\"700\" scalable=\"1\" maintainAspectRatio=\"1\" codec=\"0\"><![CDATA[https://s0.2mdn.net/4253510/google_ddm_animation_480P.mp4]]></MediaFile></MediaFiles><VideoClicks><ClickThrough id=\"blog\"><![CDATA[https://example.com]]></ClickThrough></VideoClicks></Linear></Creative></Creatives></InLine></Ad></VAST>",
116+
"cid": "test_cid",
117+
"crid": "test_crid",
118+
"dealid": "test_dealid",
119+
"mtype": 2,
120+
"ext": {
121+
"prebid": {
122+
"type": "video"
123+
}
124+
}
125+
},
126+
"type": "video"
127+
}
128+
]
129+
}
130+
]
131+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
{
2+
"mockBidRequest": {
3+
"id": "test-request-id",
4+
"imp": [
5+
{
6+
"id": "test-imp-id",
7+
"tagid": "test",
8+
"banner": {
9+
"format": [
10+
{
11+
"w": 300,
12+
"h": 250
13+
},
14+
{
15+
"w": 300,
16+
"h": 600
17+
}
18+
]
19+
},
20+
"ext": {
21+
"bidder": {
22+
"placementId": "test"
23+
}
24+
}
25+
}
26+
],
27+
"site": {
28+
"id": "1",
29+
"domain": "test.com"
30+
},
31+
"device": {
32+
"ip": "123.123.123.123",
33+
"ua": "Ubuntu"
34+
}
35+
},
36+
"httpCalls": [
37+
{
38+
"expectedRequest": {
39+
"uri": "https://example.com",
40+
"body": {
41+
"id": "test-request-id",
42+
"imp": [
43+
{
44+
"id": "test-imp-id",
45+
"tagid": "test",
46+
"banner": {
47+
"format": [
48+
{
49+
"w": 300,
50+
"h": 250
51+
},
52+
{
53+
"w": 300,
54+
"h": 600
55+
}
56+
]
57+
},
58+
"ext": {
59+
"bidder": {
60+
"placementId": "test",
61+
"type": "publisher"
62+
}
63+
}
64+
}
65+
],
66+
"site": {
67+
"id": "1",
68+
"domain": "test.com"
69+
},
70+
"device": {
71+
"ip": "123.123.123.123",
72+
"ua": "Ubuntu"
73+
}
74+
},
75+
"impIDs":["test-imp-id"]
76+
},
77+
"mockResponse": {
78+
"status": 200,
79+
"body": {
80+
"id": "test-request-id",
81+
"seatbid": [
82+
{
83+
"bid": [
84+
{
85+
"id": "test_bid_id",
86+
"impid": "test-imp-id",
87+
"price": 0.27543,
88+
"adm": "<iframe id=\"adm-banner-1\" width=\"468\" height=\"60\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" style=\"{overflow:hidden}\" src=\"https://example.com&k=bc2d316f39931a07d9a8dd249bf85fc0\"></iframe>",
89+
"cid": "test_cid",
90+
"crid": "test_crid",
91+
"dealid": "test_dealid",
92+
"mtype": 1,
93+
"w": 468,
94+
"h": 60,
95+
"ext": {
96+
"prebid": {
97+
"type": "banner"
98+
}
99+
}
100+
}
101+
],
102+
"seat": "ads_interactive"
103+
}
104+
],
105+
"cur": "USD"
106+
}
107+
}
108+
}
109+
],
110+
"expectedBidResponses": [
111+
{
112+
"bids": [
113+
{
114+
"bid": {
115+
"id": "test_bid_id",
116+
"impid": "test-imp-id",
117+
"price": 0.27543,
118+
"adm": "<iframe id=\"adm-banner-1\" width=\"468\" height=\"60\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" style=\"{overflow:hidden}\" src=\"https://example.com&k=bc2d316f39931a07d9a8dd249bf85fc0\"></iframe>",
119+
"cid": "test_cid",
120+
"crid": "test_crid",
121+
"dealid": "test_dealid",
122+
"mtype": 1,
123+
"w": 468,
124+
"h": 60,
125+
"ext": {
126+
"prebid": {
127+
"type": "banner"
128+
}
129+
}
130+
},
131+
"type": "banner"
132+
}
133+
]
134+
}
135+
]
136+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"mockBidRequest": {
3+
"id": "test-request-id",
4+
"imp": [
5+
{
6+
"id": "test-imp-id",
7+
"ext": {
8+
"bidder": {
9+
"placementId": "test"
10+
}
11+
}
12+
}
13+
],
14+
"app": {
15+
"id": "1",
16+
"bundle": "com.wls.testwlsapplication"
17+
},
18+
"device": {
19+
"ip": "123.123.123.123",
20+
"ifa": "sdjfksdf-dfsds-dsdg-dsgg"
21+
}
22+
},
23+
"httpCalls": [{
24+
"expectedRequest": {
25+
"uri": "https://example.com",
26+
"body": {
27+
"id": "test-request-id",
28+
"imp": [
29+
{
30+
"id": "test-imp-id",
31+
"ext": {
32+
"bidder": {
33+
"placementId": "test",
34+
"type": "publisher"
35+
}
36+
}
37+
}
38+
],
39+
"app": {
40+
"id": "1",
41+
"bundle": "com.wls.testwlsapplication"
42+
},
43+
"device": {
44+
"ip": "123.123.123.123",
45+
"ifa": "sdjfksdf-dfsds-dsdg-dsgg"
46+
}
47+
},
48+
"impIDs":["test-imp-id"]
49+
},
50+
"mockResponse": {
51+
"status": 200,
52+
"body": {
53+
"id": "test-request-id",
54+
"seatbid": [
55+
{
56+
"bid": [
57+
{
58+
"id": "test_bid_id",
59+
"impid": "test-imp-id",
60+
"price": 0.27543,
61+
"adm": "<iframe id=\"adm-banner-16\" width=\"300\" height=\"250\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" style=\"{overflow:hidden}\" src=\"https://example.com&k=882b2510ed6d6c94fa69c99aa522a708\"></iframe>",
62+
"cid": "test_cid",
63+
"crid": "test_crid",
64+
"dealid": "test_dealid",
65+
"w": 300,
66+
"h": 250,
67+
"ext": {}
68+
}
69+
],
70+
"seat": "ads_interactive"
71+
}
72+
],
73+
"cur": "USD"
74+
}
75+
}
76+
}],
77+
"expectedMakeBidsErrors": [
78+
{
79+
"value": "could not define media type for impression: test-imp-id",
80+
"comparison": "literal"
81+
}
82+
]
83+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"mockBidRequest": {
3+
"id": "test-request-id",
4+
"imp": [
5+
{
6+
"id": "test-imp-id",
7+
"banner": {
8+
"format": [
9+
{
10+
"w": 300,
11+
"h": 250
12+
},
13+
{
14+
"w": 300,
15+
"h": 600
16+
}
17+
]
18+
},
19+
"ext": {
20+
"bidder": {
21+
"placementId": "test"
22+
}
23+
}
24+
}
25+
],
26+
"app": {
27+
"id": "1",
28+
"bundle": "com.wls.testwlsapplication"
29+
},
30+
"device": {
31+
"ip": "123.123.123.123",
32+
"ifa": "sdjfksdf-dfsds-dsdg-dsgg"
33+
}
34+
},
35+
"httpCalls": [{
36+
"expectedRequest": {
37+
"uri": "https://example.com",
38+
"body": {
39+
"id": "test-request-id",
40+
"imp": [
41+
{
42+
"id": "test-imp-id",
43+
"banner": {
44+
"format": [
45+
{
46+
"w": 300,
47+
"h": 250
48+
},
49+
{
50+
"w": 300,
51+
"h": 600
52+
}
53+
]
54+
},
55+
"ext": {
56+
"bidder": {
57+
"placementId": "test",
58+
"type": "publisher"
59+
}
60+
}
61+
}
62+
],
63+
"app": {
64+
"id": "1",
65+
"bundle": "com.wls.testwlsapplication"
66+
},
67+
"device": {
68+
"ip": "123.123.123.123",
69+
"ifa": "sdjfksdf-dfsds-dsdg-dsgg"
70+
}
71+
},
72+
"impIDs":["test-imp-id"]
73+
},
74+
"mockResponse": {
75+
"status": 200,
76+
"body": ""
77+
}
78+
}],
79+
"expectedMakeBidsErrors": [
80+
{
81+
"value": "expect { or n, but found \"",
82+
"comparison": "literal"
83+
}
84+
]
85+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"mockBidRequest": {
3+
"id": "test-request-id",
4+
"device": {
5+
"ip": "123.123.123.123",
6+
"ua": "iPad"
7+
},
8+
"app": {
9+
"id": "1",
10+
"bundle": "com.wls.testwlsapplication"
11+
},
12+
"imp": [
13+
{
14+
"id": "test-imp-id",
15+
"tagid": "test",
16+
"banner": {
17+
"format": [
18+
{
19+
"w": 300,
20+
"h": 250
21+
},
22+
{
23+
"w": 300,
24+
"h": 600
25+
}
26+
]
27+
},
28+
"ext": {
29+
"bidder": {
30+
"endpointId": []
31+
}
32+
}
33+
}
34+
]
35+
},
36+
"expectedMakeRequestsErrors": [
37+
{
38+
"value": "cannot unmarshal openrtb_ext.ImpExtAdsInteractive.EndpointID: expects \" or n, but found [",
39+
"comparison": "literal"
40+
}
41+
]
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"mockBidRequest": {
3+
"id": "test-request-id",
4+
"device": {
5+
"ip": "123.123.123.123",
6+
"ua": "iPad"
7+
},
8+
"app": {
9+
"id": "1",
10+
"bundle": "com.wls.testwlsapplication"
11+
},
12+
"imp": [
13+
{
14+
"id": "test-imp-id",
15+
"tagid": "test",
16+
"banner": {
17+
"format": [
18+
{
19+
"w": 300,
20+
"h": 250
21+
},
22+
{
23+
"w": 300,
24+
"h": 600
25+
}
26+
]
27+
},
28+
"ext": "invalid"
29+
}
30+
]
31+
},
32+
"expectedMakeRequestsErrors": [
33+
{
34+
"value": "expect { or n, but found \"",
35+
"comparison": "literal"
36+
}
37+
]
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"mockBidRequest": {
3+
"id": "test-request-id",
4+
"imp": [
5+
{
6+
"id": "test-imp-id",
7+
"banner": {
8+
"format": [
9+
{
10+
"w": 300,
11+
"h": 250
12+
},
13+
{
14+
"w": 300,
15+
"h": 600
16+
}
17+
]
18+
},
19+
"ext": {
20+
"bidder": {
21+
"placementId": "test"
22+
}
23+
}
24+
}
25+
],
26+
"app": {
27+
"id": "1",
28+
"bundle": "com.wls.testwlsapplication"
29+
},
30+
"device": {
31+
"ip": "123.123.123.123",
32+
"ifa": "sdjfksdf-dfsds-dsdg-dsgg"
33+
}
34+
},
35+
"httpCalls": [{
36+
"expectedRequest": {
37+
"uri": "https://example.com",
38+
"body": {
39+
"id": "test-request-id",
40+
"imp": [
41+
{
42+
"id": "test-imp-id",
43+
"banner": {
44+
"format": [
45+
{
46+
"w": 300,
47+
"h": 250
48+
},
49+
{
50+
"w": 300,
51+
"h": 600
52+
}
53+
]
54+
},
55+
"ext": {
56+
"bidder": {
57+
"placementId": "test",
58+
"type": "publisher"
59+
}
60+
}
61+
}
62+
],
63+
"app": {
64+
"id": "1",
65+
"bundle": "com.wls.testwlsapplication"
66+
},
67+
"device": {
68+
"ip": "123.123.123.123",
69+
"ifa": "sdjfksdf-dfsds-dsdg-dsgg"
70+
}
71+
},
72+
"impIDs":["test-imp-id"]
73+
},
74+
"mockResponse": {
75+
"status": 204,
76+
"body": {}
77+
}
78+
}],
79+
"expectedBidResponses": []
80+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"mockBidRequest": {
3+
"id": "test-request-id",
4+
"imp": [
5+
{
6+
"id": "test-imp-id",
7+
"banner": {
8+
"format": [
9+
{
10+
"w": 300,
11+
"h": 250
12+
},
13+
{
14+
"w": 300,
15+
"h": 600
16+
}
17+
]
18+
},
19+
"ext": {
20+
"bidder": {
21+
"placementId": "test"
22+
}
23+
}
24+
}
25+
],
26+
"app": {
27+
"id": "1",
28+
"bundle": "com.wls.testwlsapplication"
29+
},
30+
"device": {
31+
"ip": "123.123.123.123",
32+
"ifa": "sdjfksdf-dfsds-dsdg-dsgg"
33+
}
34+
},
35+
"httpCalls": [{
36+
"expectedRequest": {
37+
"uri": "https://example.com",
38+
"body": {
39+
"id": "test-request-id",
40+
"imp": [
41+
{
42+
"id": "test-imp-id",
43+
"banner": {
44+
"format": [
45+
{
46+
"w": 300,
47+
"h": 250
48+
},
49+
{
50+
"w": 300,
51+
"h": 600
52+
}
53+
]
54+
},
55+
"ext": {
56+
"bidder": {
57+
"placementId": "test",
58+
"type": "publisher"
59+
}
60+
}
61+
}
62+
],
63+
"app": {
64+
"id": "1",
65+
"bundle": "com.wls.testwlsapplication"
66+
},
67+
"device": {
68+
"ip": "123.123.123.123",
69+
"ifa": "sdjfksdf-dfsds-dsdg-dsgg"
70+
}
71+
},
72+
"impIDs":["test-imp-id"]
73+
},
74+
"mockResponse": {
75+
"status": 404,
76+
"body": {}
77+
}
78+
}],
79+
"expectedMakeBidsErrors": [
80+
{
81+
"value": "Unexpected status code: 404. Run with request.debug = 1 for more info",
82+
"comparison": "literal"
83+
}
84+
]
85+
}
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package ads_interactive
2+
3+
import (
4+
"encoding/json"
5+
"testing"
6+
7+
"github.com/prebid/prebid-server/v3/openrtb_ext"
8+
)
9+
10+
func TestValidParams(t *testing.T) {
11+
validator, err := openrtb_ext.NewBidderParamsValidator("../../static/bidder-params")
12+
if err != nil {
13+
t.Fatalf("Failed to fetch the json schema. %v", err)
14+
}
15+
16+
for _, p := range validParams {
17+
if err := validator.Validate(openrtb_ext.BidderAdsInteractive, json.RawMessage(p)); err != nil {
18+
t.Errorf("Schema rejected valid params: %s", p)
19+
}
20+
}
21+
}
22+
23+
func TestInvalidParams(t *testing.T) {
24+
validator, err := openrtb_ext.NewBidderParamsValidator("../../static/bidder-params")
25+
if err != nil {
26+
t.Fatalf("Failed to fetch the json schema. %v", err)
27+
}
28+
29+
for _, p := range invalidParams {
30+
if err := validator.Validate(openrtb_ext.BidderAdsInteractive, json.RawMessage(p)); err == nil {
31+
t.Errorf("Schema allowed invalid params: %s", p)
32+
}
33+
}
34+
}
35+
36+
var validParams = []string{
37+
`{"placementId": "test"}`,
38+
`{"placementId": "1"}`,
39+
`{"endpointId": "test"}`,
40+
`{"endpointId": "1"}`,
41+
`{"placementId": "test", "unknownField": "value"}`,
42+
}
43+
44+
var invalidParams = []string{
45+
`{}`,
46+
`{"placementId": 42}`,
47+
`{"endpointId": 42}`,
48+
`{"placementId": "1", "endpointId": "1"}`,
49+
`{"placementId": ""}`,
50+
`{"endpointId": ""}`,
51+
`{"randomField": "value"}`,
52+
}

‎exchange/adapter_builders.go

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/prebid/prebid-server/v3/adapters/adprime"
2424
"github.com/prebid/prebid-server/v3/adapters/adquery"
2525
"github.com/prebid/prebid-server/v3/adapters/adrino"
26+
"github.com/prebid/prebid-server/v3/adapters/ads_interactive"
2627
"github.com/prebid/prebid-server/v3/adapters/adsinteractive"
2728
"github.com/prebid/prebid-server/v3/adapters/adtarget"
2829
"github.com/prebid/prebid-server/v3/adapters/adtelligent"
@@ -258,6 +259,7 @@ func newAdapterBuilders() map[openrtb_ext.BidderName]adapters.Builder {
258259
openrtb_ext.BidderAdprime: adprime.Builder,
259260
openrtb_ext.BidderAdquery: adquery.Builder,
260261
openrtb_ext.BidderAdrino: adrino.Builder,
262+
openrtb_ext.BidderAdsInteractive: ads_interactive.Builder,
261263
openrtb_ext.BidderAdsinteractive: adsinteractive.Builder,
262264
openrtb_ext.BidderAdtarget: adtarget.Builder,
263265
openrtb_ext.BidderAdtrgtme: adtrgtme.Builder,

‎openrtb_ext/bidders.go

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ var coreBidderNames []BidderName = []BidderName{
3939
BidderAdprime,
4040
BidderAdquery,
4141
BidderAdrino,
42+
BidderAdsInteractive,
4243
BidderAdsinteractive,
4344
BidderAdtarget,
4445
BidderAdtrgtme,
@@ -381,6 +382,7 @@ const (
381382
BidderAdprime BidderName = "adprime"
382383
BidderAdquery BidderName = "adquery"
383384
BidderAdrino BidderName = "adrino"
385+
BidderAdsInteractive BidderName = "ads_interactive"
384386
BidderAdsinteractive BidderName = "adsinteractive"
385387
BidderAdtarget BidderName = "adtarget"
386388
BidderAdtrgtme BidderName = "adtrgtme"

‎openrtb_ext/imp_ads_interactive.go

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package openrtb_ext
2+
3+
type ImpExtAdsInteractive struct {
4+
PlacementID string `json:"placementId"`
5+
EndpointID string `json:"endpointId"`
6+
}
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
endpoint: "https://bntb.adsinteractive.com/pserver"
2+
gvlVendorID: 1212
3+
maintainer:
4+
email: "it@adsinteractive.com"
5+
capabilities:
6+
site:
7+
mediaTypes:
8+
- banner
9+
- video
10+
- native
11+
app:
12+
mediaTypes:
13+
- banner
14+
- video
15+
- native
16+
userSync:
17+
redirect:
18+
url: "https://cstb.adsinteractive.com/pbserver?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&ccpa={{.USPrivacy}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}}&redir={{.RedirectURL}}"
19+
userMacro: "[UID]"
20+
iframe:
21+
url: "https://cstb.adsinteractive.com/pbserverIframe?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&ccpa={{.USPrivacy}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}}&pbserverUrl={{.RedirectURL}}"
22+
userMacro: "[UID]"
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "Ads Interactive Adapter Params",
4+
"description": "A schema which validates params accepted by the Ads Interactive adapter",
5+
"type": "object",
6+
"properties": {
7+
"placementId": {
8+
"type": "string",
9+
"minLength": 1,
10+
"description": "Placement ID"
11+
},
12+
"endpointId": {
13+
"type": "string",
14+
"minLength": 1,
15+
"description": "Endpoint ID"
16+
}
17+
},
18+
"oneOf": [
19+
{ "required": ["placementId"] },
20+
{ "required": ["endpointId"] }
21+
]
22+
}

0 commit comments

Comments
 (0)
Please sign in to comment.