adUnit?.ortbConfig sets object to parent & not imp array.
Describe the bug
In a similar vein to this issue when attempting to arbitrary ortb data to the imp array the object is appended to the parent object instead (as if we were looking to add / modify global objects).
To Reproduce Steps to reproduce the behavior:
- Prebid-mobile-android-master
- Modify one of the gam original activities (say GamOriginalApiDisplayBanner300x250) and add:
adUnit?.ortbConfig = "{"ext":{"gpid":"/21808260008/prebid_demo_app_original_api_banner_300x250_order","data":{"pbadslot":"/21808260008/prebid_demo_app_original_api_banner_300x250_order"}}}"
- Run PrebidDemoKotlin & retrieve the request for the 300x250 banner.
Expected behavior Unlike when using specific native functions (adUnit?.gpid or adUnit?.pbAdSlot) the tester should see that the object does not end up in the imp[].ext object but rather at the bottom of the parent object.
Screenshots
Smartphone (please complete the following information):
- Device: Emulated pixel 6.
Additional Info My best guess here is that these is a issue / misuse of .put in the BidRequest.java...
@ValentinPostindustria please make sure that https://github.com/prebid/prebid-mobile-android/pull/805 will fix this issue as well.
@YuriyVelichkoPI thanks for linking that, was just looking over it. Chat Thursday in the mob pmc.
It's fixed in the PR #805. So it just adds these parameters to the root ext object.
With the new implementation just add:
TargetingParams.setGlobalOrtbConfig(
"{\"ext\":{\"gpid\":\"/21808260008/prebid_demo_app_original_api_banner_300x250_order\",\"data\":{\"pbadslot\":\"/21808260008/prebid_demo_app_original_api_banner_300x250_order\"}}}"
)
Hey @ValentinPostindustria @YuriyVelichkoPI
Unfortunately the goal here is that the datas object make their way into the imp[].ext ( and not the root when using adUnit?.ortbConfig).
Right now adUnit?.ortbConfig mimics TargetingParams.setGlobalOrtbConfig by adding to the root already.
As each potential imp in the array may require different ortb datas (f.ex adding impression level first party data or adding pbAdSlot (whilst adUnit?.pbAdSlot is being ammended) ).
Hope this makes sense
Hi @rBeefrz ! Yes, it makes perfect sense.
@ValentinPostindustria please ensure that AdUnit.setImportbConfig does what is needed.
@rBeefrz in the fix, we introduced two new methods. One is to set global parameters. second one is to set imp level params. Here you can find the doc changes: https://github.com/prebid/prebid.github.io/pull/5759
Hey @YuriyVelichkoPI Thanks for linking, I hadn't seen the "setImpOrtbConfig" thats a great addition. Cheers!