prebid-mobile-android icon indicating copy to clipboard operation
prebid-mobile-android copied to clipboard

adUnit?.ortbConfig sets object to parent & not imp array.

Open rBeefrz opened this issue 1 year ago • 6 comments

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:

  1. Prebid-mobile-android-master
  2. 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"}}}"

  1. 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 image

image

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...

image

rBeefrz avatar Dec 16 '24 08:12 rBeefrz

@ValentinPostindustria please make sure that https://github.com/prebid/prebid-mobile-android/pull/805 will fix this issue as well.

YuriyVelichkoPI avatar Dec 16 '24 08:12 YuriyVelichkoPI

@YuriyVelichkoPI thanks for linking that, was just looking over it. Chat Thursday in the mob pmc.

rBeefrz avatar Dec 16 '24 08:12 rBeefrz

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\"}}}"
)

ValentinPostindustria avatar Dec 16 '24 11:12 ValentinPostindustria

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

rBeefrz avatar Dec 18 '24 07:12 rBeefrz

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

YuriyVelichkoPI avatar Dec 18 '24 07:12 YuriyVelichkoPI

Hey @YuriyVelichkoPI Thanks for linking, I hadn't seen the "setImpOrtbConfig" thats a great addition. Cheers!

rBeefrz avatar Dec 18 '24 10:12 rBeefrz