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

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

Open
rBeefrz opened this issue Dec 16, 2024 · 6 comments
Open

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

rBeefrz opened this issue Dec 16, 2024 · 6 comments
Assignees

Comments

@rBeefrz
Copy link

rBeefrz commented Dec 16, 2024

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

@YuriyVelichkoPI
Copy link
Contributor

@ValentinPostindustria please make sure that #805 will fix this issue as well.

@rBeefrz
Copy link
Author

rBeefrz commented Dec 16, 2024

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

@ValentinPostindustria
Copy link
Collaborator

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

@rBeefrz
Copy link
Author

rBeefrz commented Dec 18, 2024

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

@YuriyVelichkoPI
Copy link
Contributor

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: prebid/prebid.github.io#5759

@rBeefrz
Copy link
Author

rBeefrz commented Dec 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

No branches or pull requests

3 participants