Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions adapters/connatix/connatix.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,20 @@ func buildRequestImp(imp *openrtb2.Imp, ext impExtIncoming, displayManagerVer st
imp.BidFloor = convertedValue
}

impExt := impExt{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, impExt defined in adapters/connatix/models.go is no longer used. Should we remove it?

11   type impExtIncoming struct {
12       Bidder openrtb_ext.ExtImpConnatix `json:"bidder"`
13   }
14   
15 - type impExt struct {
16 -     Connatix impExtConnatix `json:"connatix"`
17 - }
18   
19   type impExtConnatix struct {
adapters/connatix/models.go

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guscarreon thank you! addressed

Connatix: impExtConnatix{
PlacementId: ext.Bidder.PlacementId,
ViewabilityPercentage: ext.Bidder.ViewabilityPercentage,
},
var incomingExt map[string]interface{}
if err := jsonutil.Unmarshal(imp.Ext, &incomingExt); err != nil {
incomingExt = make(map[string]interface{})
}

delete(incomingExt, "bidder")

incomingExt["connatix"] = impExtConnatix{
PlacementId: ext.Bidder.PlacementId,
ViewabilityPercentage: ext.Bidder.ViewabilityPercentage,
}

var err error
imp.Ext, err = json.Marshal(impExt)
imp.Ext, err = json.Marshal(incomingExt)

return err
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
{
"mockBidRequest": {
"id": "some-request-id",
"device": {
"ua": "test-user-agent",
"ip": "123.123.123.123",
"language": "en",
"dnt": 0
},
"tmax": 500,
"user": {
"buyeruid": "1-some-user"
},
"app": {
"publisher": {
"id": "123456789"
},
"cat": [
"IAB22-1"
],
"bundle": "com.app.awesome",
"name": "Awesome App",
"domain": "awesomeapp.com",
"id": "123456789",
"ext": {
"prebid": {
"source": "test",
"version": "1.0.0"
}
}
},
"imp": [
{
"id": "some-imp-id",
"tagid": "some-tag-id",
"banner": {
"format":[
{
"w": 320,
"h": 50
}
]
},
"ext": {
"bidder": {
"placementId": "some-placement-id",
"viewabilityPercentage": 0.6
},
"random": {
"data_a": {
"data_1": "data_1"
},
"data_b": {
"data_2": "data_2"
}
},
"gpid": "test-gpid"
}
Comment on lines +49 to +58
Copy link
Copy Markdown
Contributor

@VeronikaSolovei9 VeronikaSolovei9 Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note: PBS will only pass bidder related data to bidder adapters. No other bidders data or imp.ext[].prebid will be passed. However extra data gpid and tid will be passed along with bidder parameters.

}
]
},
"httpCalls": [
{
"expectedRequest": {
"uri": "http://example.com?dc=us-east-2",
"body": {
"id": "some-request-id",
"device": {
"ua": "test-user-agent",
"ip": "123.123.123.123",
"language": "en",
"dnt": 0
},
"imp": [
{
"id": "some-imp-id",
"tagid": "some-tag-id",
"banner": {
"w": 320,
"h": 50,
"format": [
{
"w": 320,
"h": 50
}
]
},
"displaymanagerver": "test-1.0.0",
"ext": {
"connatix": {
"placementId": "some-placement-id",
"viewabilityPercentage": 0.6
},
"random": {
"data_a": {
"data_1": "data_1"
},
"data_b": {
"data_2": "data_2"
}
},
"gpid": "test-gpid"
}
}
],
"app": {
"id": "123456789",
"name": "Awesome App",
"bundle": "com.app.awesome",
"domain": "awesomeapp.com",
"cat": [
"IAB22-1"
],
"publisher": {
"id": "123456789"
},
"ext": {
"prebid": {
"source": "test",
"version": "1.0.0"
}
}
},
"user": {
"buyeruid": "1-some-user"
},
"tmax": 500
},
"impIDs": [
"some-imp-id"
]
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-response-id",
"seatbid": [
{
"bid": [
{
"id": "some-bid-id",
"impid": "some-imp-id",
"price": 0.52,
"adm": "some-test-ad",
"adomain": [
"test.com"
],
"crid": "112233",
"w": 320,
"h": 50,
"ext": {
"connatix": {
"mediaType": "banner"
}
}
}
],
"seat": "connatix",
"group": 0
}
],
"cur": "USD"
}
}
}
],
"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "some-bid-id",
"impid": "some-imp-id",
"price": 0.52,
"adm": "some-test-ad",
"crid": "112233",
"adomain": [
"test.com"
],
"w": 320,
"h": 50,
"ext": {
"connatix": {
"mediaType": "banner"
}
}
},
"type": "banner"
}
]
}
]
}
4 changes: 0 additions & 4 deletions adapters/connatix/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ type impExtIncoming struct {
Bidder openrtb_ext.ExtImpConnatix `json:"bidder"`
}

type impExt struct {
Connatix impExtConnatix `json:"connatix"`
}

type impExtConnatix struct {
PlacementId string `json:"placementId,omitempty"`
ViewabilityPercentage float64 `json:"viewabilityPercentage,omitempty"`
Expand Down
Loading