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

PrebidMobile.setExternalUserIds is not adding external users

Open kwchan22 opened this issue 1 year ago • 6 comments

Describe the bug PrebidMobile.setExternalUserIds(...) does not set the userIds in the Prebid bid request user section. However if using TargetingParams.storeExternalUserId then I see the userId in the bid request.

To Reproduce Steps to reproduce the behavior:

  1. Git clone Prebid Android SDK Project
  2. Go to PrebidDemoKotlin -> CustomApplication.kt
  3. Add in onCreate() this code: PrebidMobile.setExternalUserIds(mutableListOf(ExternalUserId("PrebidMobile", "prebidMobile-123", null, null)))
  4. Run app with App inspection
  5. See under the network inspector -> "/auctions" endpoint, I do not see the user added.

Expected behavior All the users set with PrebidMobile.setExternalUserIds should be added to the Prebid bid request user section.

Screenshots With PrebidMobile.setExternalUserIds, bid request user is empty

Screenshot 2024-10-03 at 2 31 12 PM

With TargetingParams.storeExternalUserId, user has the externalUserId

Screenshot 2024-10-03 at 2 32 24 PM

Desktop (please complete the following information): MacBook Pro Apple M3 Pro

Smartphone (please complete the following information):

  • Device: Google Pixel 4
  • OS: Android 11

Additional context None

kwchan22 avatar Oct 03 '24 18:10 kwchan22

Same here on android with prebid version 2.2.3 This happens also with prebid 2.1.1

sarbyn avatar Jan 03 '25 11:01 sarbyn

@OlenaPostindustria, please check the behaviour on iOS.

YuriyVelichkoPI avatar Jan 06 '25 09:01 YuriyVelichkoPI

Hi, on iOS both methods for setting external users - using Targeting or Prebid - work properly. However, when both methods are applied, the data set through Targeting takes priority over the data set via Prebid.

Ref: https://github.com/prebid/prebid-mobile-ios/blob/46e330f6a683f2086914a861af4b9fbfefd8e33d/PrebidMobile/ConfigurationAndTargeting/Targeting.swift#L239

OlenaPostindustria avatar Jan 06 '25 13:01 OlenaPostindustria

Hi @sarbyn! I'd like to propose the following fix:

  1. Deprecate PrebidMobile.setExternalUserIds
  2. Introduce TargetingParams.setExternalUserIds that will accept the array of IDs.

The motivation for this is as follows:

  • The class PrebidMobile should be used to tune the SDK behavior, such as request timeout.
  • The class TargetingParams should be used to modify the bid request.

YuriyVelichkoPI avatar Jan 06 '25 13:01 YuriyVelichkoPI

Hello. We compared implementation with OpenRTB standard. During testing, we found some problems and limitations of ExternalUserId.

  1. The SDK sends adtype instead of atype.
                {
                    "source": "sharedid.org",
                    "uids": [
                        {
                            "adtype": 1,
                            "ext": {
                                "third": "01ERJWE5FS4RAZKG6SKQ3ZYSKV"
                            },
                            "id": "111111111111"
                        }
                    ]
                }
  1. It's impossible to set many uids objects for one source in the code. But according to the documentation it is acceptable.
          "uids": [
            {
              "id": "yyy",
              "atype": 1
            },
            {
              "id": "zzz",
              "atype": 1
            },
            {
              "id": "DB700403-9A24-4A4B-A8D5-8A0B4BE777D2",
              "atype": 2
            }
          ]
  1. Currently the SDK stores Extended Identifiers in the permanent storage, so they will be restored after restarting the app. Do we need to store them like this?

ValentinPostindustria avatar Jan 07 '25 13:01 ValentinPostindustria

Note: On the committee call, it was decided that SDK shouldn't store these values in application storage.

YuriyVelichkoPI avatar Jan 20 '25 08:01 YuriyVelichkoPI