diff --git a/adapters/improvedigital/improvedigital.go b/adapters/improvedigital/improvedigital.go index 0d5c043ef60..b1cc3640714 100644 --- a/adapters/improvedigital/improvedigital.go +++ b/adapters/improvedigital/improvedigital.go @@ -114,6 +114,10 @@ func getMediaTypeForImp(impID string, imps []openrtb.Imp) (openrtb_ext.BidType, return openrtb_ext.BidTypeVideo, nil } + if imp.Native != nil { + return openrtb_ext.BidTypeNative, nil + } + return "", &errortypes.BadServerResponse{ Message: fmt.Sprintf("Unknown impression type for ID: \"%s\"", impID), } diff --git a/adapters/improvedigital/improvedigitaltest/exemplary/native.json b/adapters/improvedigital/improvedigitaltest/exemplary/native.json new file mode 100644 index 00000000000..3309b35a753 --- /dev/null +++ b/adapters/improvedigital/improvedigitaltest/exemplary/native.json @@ -0,0 +1,161 @@ +{ + "mockBidRequest": { + "id": "26f14780-8ef8-4f41-b70c-c4d062237df6", + "source": { + "tid": "26f14780-8ef8-4f41-b70c-c4d062237df6", + "ext": { + "schain": { + "ver": "1.0", + "complete": 1, + "nodes": [ + { "asi": "example.com", "hp": 1, "sid": "1234abc" } + ] + } + } + }, + "tmax": 1000, + "imp": [ + { + "id": "native", + "ext": { "improvedigital": { "placementId": 1234 } }, + "native": { + "request": "{\"context\":1,\"plcmttype\":1,\"eventtrackers\":[{\"event\":1,\"methods\":[1]}],\"assets\":[{\"required\":1,\"title\":{\"len\":80}},{\"required\":1,\"data\":{\"type\":2}},{\"required\":0,\"data\":{\"type\":12}},{\"required\":0,\"img\":{\"type\":3,\"wmin\":300,\"hmin\":225,\"ext\":{\"aspectratios\":[\"4:3\"]}}},{\"required\":0,\"img\":{\"type\":1,\"w\":128,\"h\":128}},{\"required\":0,\"data\":{\"type\":3}},{\"required\":0,\"data\":{\"type\":6}}]}", + "ver": "1.2" + } + } + ], + "ext": { + "prebid": { + "targeting": { + "includewinners": true, + "includebidderkeys": false + } + } + }, + "site": { + "publisher": { "id": "pubid" }, + "page": "example.com" + }, + "device": { "w": 1581, "h": 922, "ip": "1.1.1.1" }, + "regs": { "ext": { "gdpr": 0 } }, + "user": { + "ext": { + "consent": "XYZ" + } + } + }, + "httpcalls": [ + { + "expectedRequest": { + "uri": "http://localhost/pbs", + "body": { + "id": "26f14780-8ef8-4f41-b70c-c4d062237df6", + "imp": [ + { + "id": "native", + "native": { + "request": "{\"context\":1,\"plcmttype\":1,\"eventtrackers\":[{\"event\":1,\"methods\":[1]}],\"assets\":[{\"required\":1,\"title\":{\"len\":80}},{\"required\":1,\"data\":{\"type\":2}},{\"required\":0,\"data\":{\"type\":12}},{\"required\":0,\"img\":{\"type\":3,\"wmin\":300,\"hmin\":225,\"ext\":{\"aspectratios\":[\"4:3\"]}}},{\"required\":0,\"img\":{\"type\":1,\"w\":128,\"h\":128}},{\"required\":0,\"data\":{\"type\":3}},{\"required\":0,\"data\":{\"type\":6}}]}", + "ver": "1.2" + }, + "ext": { "improvedigital": { "placementId": 1234 } } + } + ], + "site": { + "page": "example.com", + "publisher": { "id": "pubid" } + }, + "device": { + "ip": "1.1.1.1", + "h": 922, + "w": 1581 + }, + "user": { + "ext": { + "consent": "XYZ" + } + }, + "tmax": 1000, + "source": { + "tid": "26f14780-8ef8-4f41-b70c-c4d062237df6", + "ext": { + "schain": { + "ver": "1.0", + "complete": 1, + "nodes": [ + { + "asi": "example.com", + "hp": 1, + "sid": "1234abc" + } + ] + } + } + }, + "regs": { "ext": { "gdpr": 0 } }, + "ext": { + "prebid": { + "targeting": { + "includewinners": true, + "includebidderkeys": false + } + } + } + } + }, + "mockResponse": { + "status": 200, + "body": { + "id": "26f14780-8ef8-4f41-b70c-c4d062237df6", + "cur": "USD", + "seatbid": [ + { + "bid": [ + { + "ext": { + "improvedigital": { + "brand_name": "AdvertiserABC", + "bidder_id": 301 + } + }, + "crid": "14065", + "id": "d4f04449-ba04-4d7c-bb34-dc0fc5240f59", + "price": 0.01, + "adm": "{\"assets\":[{\"title\":{\"text\":\"Luxury Mars Cruises\"},\"id\":1},{\"id\":2,\"data\":{\"type\":2,\"value\":\"Visit the planet in a luxury spaceship.\"}},{\"id\":3,\"data\":{\"type\":12,\"value\":\"Book today\"}},{\"id\":4,\"img\":{\"h\":250,\"type\":3,\"url\":\"http://hb.improvedigital.com/creatives/display/300x250.jpg\",\"w\":300}},{\"id\":6,\"data\":{\"type\":3,\"value\":\"3.8\"}},{\"id\":7,\"data\":{\"type\":6,\"value\":\"FREE\"}}],\"link\":{\"clicktrackers\":[\"http://localhost.localdomain/click/\"],\"url\":\"http://www.iponweb.com/careers/\"}}", + "adomain": ["example.com"], + "impid": "native", + "cid": "25076" + } + ], + "seat": "improvedigital" + } + ] + } + } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "d4f04449-ba04-4d7c-bb34-dc0fc5240f59", + "impid": "native", + "price": 0.01, + "adm": "{\"assets\":[{\"title\":{\"text\":\"Luxury Mars Cruises\"},\"id\":1},{\"id\":2,\"data\":{\"type\":2,\"value\":\"Visit the planet in a luxury spaceship.\"}},{\"id\":3,\"data\":{\"type\":12,\"value\":\"Book today\"}},{\"id\":4,\"img\":{\"h\":250,\"type\":3,\"url\":\"http://hb.improvedigital.com/creatives/display/300x250.jpg\",\"w\":300}},{\"id\":6,\"data\":{\"type\":3,\"value\":\"3.8\"}},{\"id\":7,\"data\":{\"type\":6,\"value\":\"FREE\"}}],\"link\":{\"clicktrackers\":[\"http://localhost.localdomain/click/\"],\"url\":\"http://www.iponweb.com/careers/\"}}", + "adomain": ["example.com"], + "cid": "25076", + "crid": "14065", + "ext": { + "improvedigital": { + "brand_name": "AdvertiserABC", + "bidder_id": 301 + } + } + }, + "type": "native" + } + ] + } + ] +} diff --git a/adapters/improvedigital/improvedigitaltest/params/race/native.json b/adapters/improvedigital/improvedigitaltest/params/race/native.json new file mode 100644 index 00000000000..0de1d580215 --- /dev/null +++ b/adapters/improvedigital/improvedigitaltest/params/race/native.json @@ -0,0 +1,12 @@ +{ + "placementId": 123, + "publisherId": 321, + "placementKey": "uniq_name", + "size": { + "w": 100, + "h": 100 + }, + "keyValues": { + "testKey1": ["testValueA", "testValueB"] + } +} diff --git a/adapters/improvedigital/improvedigitaltest/supplemental/native.json b/adapters/improvedigital/improvedigitaltest/supplemental/native.json deleted file mode 100644 index 3090700a275..00000000000 --- a/adapters/improvedigital/improvedigitaltest/supplemental/native.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-request-id", - "imp": [{ - "id": "test-imp-id", - "native": { - "ver": "1.1" - }, - "ext": { - "bidder": { - "placementId": 13245 - } - } - }] - }, - "httpCalls": [{ - "expectedRequest": { - "uri": "http://localhost/pbs", - "body": { - "id": "test-request-id", - "imp": [{ - "id": "test-imp-id", - "native": { - "request": "", - "ver": "1.1" - }, - "ext": { - "bidder": { - "placementId": 13245 - } - } - }] - } - }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [{ - "seat": "improvedigital", - "bid": [{ - "id": "randomid", - "impid": "test-imp-id", - "price": 0.500000, - "adid": "12345678", - "adm": "some-test-native", - "cid": "987", - "crid": "12345678", - "h": 250, - "w": 300 - }] - }], - "cur": "USD" - } - } - }], - - "expectedMakeBidsErrors": [ - { - "value": "Unknown impression type for ID: \"test-imp-id\"", - "comparison": "literal" - } - ] -} diff --git a/static/bidder-info/improvedigital.yaml b/static/bidder-info/improvedigital.yaml index 6c31d26826a..f7fea4a8402 100644 --- a/static/bidder-info/improvedigital.yaml +++ b/static/bidder-info/improvedigital.yaml @@ -6,7 +6,9 @@ capabilities: mediaTypes: - banner - video + - native site: mediaTypes: - banner - video + - native