google/openrtb

Bid categories mapping

jihonrado opened this issue · 3 comments

Hi,

I found a unexpected behaviour when creating an OpenRtb.BidResponse object from a JSON. Categories specified in the Bid object are not mapped correctly.

Here is what I am using:

 OpenRtb.BidResponse googleOpenRtbResponse = jsonFactory.newReader().readBidResponse(json);

Here is an example of JSON:

{
  "id": "CXc2BjQQXCRKFtNe1Rj1HQ",
  "seatbid": [
    {
      "bid": [
        {
          "id": "a197de04-0d97-4d9b-8661-96ec9590bbd9",
          "impid": "54",
          "price": 5.45,
          "adid": "...",
          "adm": "...",
          "adomain": [
            "domain.com"
          ],
          "iurl": "http://someurl.com/fafa43v53.png",
          "cid": "57085882",
          "crid": "9f0c998dfa5a042f643285a60c6eb21a",
          "h": 50,
          "w": 320,
          "ext": {
            "attr": [
              47
            ],
            "click_through_url": [
              "http://www.domain.com"
            ]
          },
          "cat": [
            "IAB9-30",
            "IAB14-1",
            "IAB23",
            "IAB23-1",
            "IAB23-2",
            "IAB23-3",
            "IAB23-4",
            "IAB23-5",
            "IAB23-6",
            "IAB23-7",
            "IAB23-8",
            "IAB23-9",
            "IAB23-10"
          ]
        }
      ],
      "seat": "38528903462562"
    }
  ]
}

So, the categories are:

[IAB9-30, IAB14-1, IAB23, IAB23-1, IAB23-2, IAB23-3, IAB23-4, IAB23-5, IAB23-6, IAB23-7, IAB23-8, IAB23-9, IAB23-10]

And the result I am obtaining from "googleOpenRtbResponse.getSeatbid(0).getBid(0).getCat()" is:

IAB1

The first question is, shouldn't be "cat" within "OpenRtb.BidResponse.SeatBid.Bid" a collection of categories?

The second question is, why is it mapping to IAB1?

Thanks

The Bid.cat field should be repeated indeed, and this was just recently fixed but it's not released yet. I have just merged this fix to the main repo with #40 (and google/openrtb-doubleclick#39 if you use that library too) so it's easier to test. Planning to make a small release in the next few days to address this, but let's make sure you don't see any other problem here.

On the second question, maybe some side effect of the buggy single-value field; I double-checked the current code and this problem certainly doesn't happen there but please update and confirm for me.

Hi @opinali,

I have just tested the 0.8.5-SNAPSHOT version of doubleclick-openrtb and it is working as expected.

Thanks!!

Great; next release should be out soon then. Should have happened already but good thing it didn't, before you've found this bug. :)