From 31c327cc3f347f116210a814d2c94fd306974753 Mon Sep 17 00:00:00 2001 From: Karim Mourra Date: Fri, 5 Sep 2025 18:56:20 -0300 Subject: [PATCH 1/4] keeps data from incoming imp[i].ext --- adapters/connatix/connatix.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/adapters/connatix/connatix.go b/adapters/connatix/connatix.go index 11cf7a146ab..45978e2d96e 100644 --- a/adapters/connatix/connatix.go +++ b/adapters/connatix/connatix.go @@ -222,15 +222,18 @@ func buildRequestImp(imp *openrtb2.Imp, ext impExtIncoming, displayManagerVer st imp.BidFloor = convertedValue } - impExt := impExt{ - 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{}) + } + + 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 } From ba06037275a31c8b305f29299cce4a43bfdcc599 Mon Sep 17 00:00:00 2001 From: Karim Mourra Date: Fri, 5 Sep 2025 19:08:52 -0300 Subject: [PATCH 2/4] deletes bidder --- adapters/connatix/connatix.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/adapters/connatix/connatix.go b/adapters/connatix/connatix.go index 45978e2d96e..c479a2892fd 100644 --- a/adapters/connatix/connatix.go +++ b/adapters/connatix/connatix.go @@ -227,6 +227,8 @@ func buildRequestImp(imp *openrtb2.Imp, ext impExtIncoming, displayManagerVer st incomingExt = make(map[string]interface{}) } + delete(incomingExt, "bidder") + incomingExt["connatix"] = impExtConnatix{ PlacementId: ext.Bidder.PlacementId, ViewabilityPercentage: ext.Bidder.ViewabilityPercentage, From 9d04f1dc51894fdac7aa1fcefa9ed84997bc1170 Mon Sep 17 00:00:00 2001 From: Karim Mourra Date: Fri, 5 Sep 2025 19:21:23 -0300 Subject: [PATCH 3/4] adds test --- .../bid-request-imp-ext-presistence.json | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 adapters/connatix/connatixtest/supplemental/bid-request-imp-ext-presistence.json diff --git a/adapters/connatix/connatixtest/supplemental/bid-request-imp-ext-presistence.json b/adapters/connatix/connatixtest/supplemental/bid-request-imp-ext-presistence.json new file mode 100644 index 00000000000..00b99b8188f --- /dev/null +++ b/adapters/connatix/connatixtest/supplemental/bid-request-imp-ext-presistence.json @@ -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" + } + } + ] + }, + "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" + } + ] + } + ] + } From 9c19eaaa7072e88ca8a12b0e605f6a4f392a1848 Mon Sep 17 00:00:00 2001 From: Karim Mourra Date: Fri, 19 Sep 2025 12:40:06 -0300 Subject: [PATCH 4/4] deletes obsolete struct --- ...-presistence.json => bid-request-imp-ext-persistence.json} | 0 adapters/connatix/models.go | 4 ---- 2 files changed, 4 deletions(-) rename adapters/connatix/connatixtest/supplemental/{bid-request-imp-ext-presistence.json => bid-request-imp-ext-persistence.json} (100%) diff --git a/adapters/connatix/connatixtest/supplemental/bid-request-imp-ext-presistence.json b/adapters/connatix/connatixtest/supplemental/bid-request-imp-ext-persistence.json similarity index 100% rename from adapters/connatix/connatixtest/supplemental/bid-request-imp-ext-presistence.json rename to adapters/connatix/connatixtest/supplemental/bid-request-imp-ext-persistence.json diff --git a/adapters/connatix/models.go b/adapters/connatix/models.go index 95317d7e23a..aebd51d0975 100644 --- a/adapters/connatix/models.go +++ b/adapters/connatix/models.go @@ -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"`