Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support collecting arbitrary ORTB parameters #877

Closed
bretg opened this issue Jul 10, 2023 · 8 comments · Fixed by #956 or prebid/prebid-mobile-android#738
Closed

Support collecting arbitrary ORTB parameters #877

bretg opened this issue Jul 10, 2023 · 8 comments · Fixed by #956 or prebid/prebid-mobile-android#738
Assignees

Comments

@bretg
Copy link
Contributor

bretg commented Jul 10, 2023

Describe the solution you'd like

Adding Arbitrary ORTB Request Fields

We're building a separate GPID feature in issue #925, but it would be great to be able to pass arbitrary ORTB fields into the request. The SDK could support flexible ORTB entry. e.g.

   addOrtbGlobal('{"ext":{"prebid":{"debug":1,"trace":"verbose"}}}');
   adUnit = BannerAdUnit(configId: CONFIG_ID, size: adSize, ORTB_OBJECT)

Where ORTB_OBJECT is an imp-specific block of JSON that can get merged into the PBS request under that imp object as a last step. e.g. in the case of GPID, it would be {ext: {gpid: "blah"}}

We have to decide the merge precedence for when a JSON block is supplied by both the API and the generic interface. Based on PBS experience, I would suggest something simple like:

  • Shallow merge: stop at the first array
  • API-specified fields take precedence

Additional context

Prebid.js has supported accepting arbitrary ORTB for a year now and it's worked quite well to handle new use cases.

@ChrisHuie ChrisHuie moved this from Triage to Ready for Dev in Prebid Mobile Prioritization Jul 20, 2023
@bretg bretg changed the title Support collecting GPID Support collecting ORTB parameters Jul 20, 2023
@bretg bretg changed the title Support collecting ORTB parameters Support collecting and receiving ORTB parameters Oct 3, 2023
@bretg
Copy link
Contributor Author

bretg commented Oct 3, 2023

Expanded the request to add the response side of the ORTB.

@bretg
Copy link
Contributor Author

bretg commented Oct 5, 2023

After discussion, this has been broken into separate issue

@bretg bretg changed the title Support collecting and receiving ORTB parameters Support collecting arbitrary ORTB parameters Oct 5, 2023
@bretg bretg unassigned jsligh Oct 5, 2023
@alexsavelyev alexsavelyev assigned jsligh and unassigned ChrisHuie Nov 30, 2023
@jsligh
Copy link
Collaborator

jsligh commented Dec 6, 2023

@bretg It looks like under the ext there is prebid/dlp, skadn, data, keywords, and GPID. Does the object with the arbitrary fields only need to go through if these don't exist or how does it need to go through in the json with things like GPID?

@bretg
Copy link
Contributor Author

bretg commented Dec 6, 2023

Not sure I understand the question so let me give a pseudo-code example:

   adUnit = BannerAdUnit(configId: "my-stored-request", size: adSize, "{instl:1, ext:{ gpid: "222", data: { foo: "bar" }})

What should get sent in the Prebid Server imp object is:

{
   "imp":[{
      "banner" {
          ... existing logic to write out the sizes ...
      },
      "instl":1,
      "ext": {
        "gpid": "222",
        "data": {
          "foo": "bar"
        },
        "prebid": {
          "storedrequest": {
            "id": "my-stored-request"
          }
        }
      }
   }]
}

@jsligh
Copy link
Collaborator

jsligh commented Dec 6, 2023

Not sure I understand the question so let me give a pseudo-code example:

   adUnit = BannerAdUnit(configId: "my-stored-request", size: adSize, "{instl:1, ext:{ gpid: "222", data: { foo: "bar" }})

What should get sent in the Prebid Server imp object is:

{
   "imp":[{
      "banner" {
          ... existing logic to write out the sizes ...
      },
      "instl":1,
      "ext": {
        "gpid": "222",
        "data": {
          "foo": "bar"
        },
        "prebid": {
          "storedrequest": {
            "id": "my-stored-request"
          }
        }
      }
   }]
}

Ah okay, so it just needs to be added under the "data" section in "ext". That answers my question, thanks!

@bretg
Copy link
Contributor Author

bretg commented Dec 6, 2023

What I'm saying is that the object supplied on BannerAdUnit needs to be merged at the imp level.

  • Some of the fields there go directly under imp
  • Others are sub-objects

Does the object with the arbitrary fields only need to go through if these don't exist

Really anything under "ext" is arbitrary and might change over time. The code that does the merging should be simple and not assume or validate anything other than valid JSON.

@bretg
Copy link
Contributor Author

bretg commented Mar 11, 2024

@jsligh - was there a docs PR opened?

@jsligh
Copy link
Collaborator

jsligh commented Mar 11, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment