-
Notifications
You must be signed in to change notification settings - Fork 84
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
Prefetch the advertising info #696
Comments
YuriyVelichkoPI
changed the title
[DRAFT] Prefetch the advertising info
Prefetch the advertising info
Sep 27, 2023
History note. The motivation for the proposed changes was raised in the discussion of this PR. This is not the first time we have experienced problems with the sequential retrieval of the advertising info while preparing the bid request. |
alexsavelyev
moved this from Triage
to Needs Requirements
in Prebid Mobile Prioritization
Feb 22, 2024
alexsavelyev
moved this from Needs Requirements
to Ready for Dev
in Prebid Mobile Prioritization
Feb 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background
In the current implementation, the SDK requests the advertising info on each bid request. To avoid blocking, it is performed async in the background thread. However, the Prebid SDK in any case, is waiting until the OS returns the current advertising info. See the class
AdIdManager
of the SDK for the details.This implementation has two major disadvantages:
To avoid runtime issues and get rid of delays in creating the bid request, the SDK should prefetch the advertising info so it's always available. The prefetching should take into consideration the Android policy to request the updated info each time it's needed and not cache it.
Proposal
Even though Android docs advise not to cache the ID, it's clear that this property won't be changed too often, especially during the single app session. So, if the SDK will fetch it on the initialization and refresh on each following bid request, it shouldn't violate privacy settings and other policies.
The general approach is displayed in the following diagram:
Step 1: The SDK on the initialization step runs the background task to fetch the advertising info and save it in memory. No saving to the persistent memory.
Step 2: Once the SDK is initialized, publishers can run bid requests
Step 3: Publisher calls the
fetchDemand
method, or any other, that leads to creating and sending the Bid Request.Step 4: Prebid SDK uses the prefetched advertising info to build the Bid Request
Step 5: Prebid SDK updates the advertising info, starting the background task. The SDK doesn't wait for the result.
Step 6: SDK makes the bid request with prefetched advertising info
Once the updating task is finished, the advertising info will be actualized and used in the subsequent bid request.
Note: the diagram and description don't contain, but assume that fetching the advertising info is performed according to the user consent and permission as it is happening now.
Objectives
Once the proposal is reviewed, finalized, and approved, the implementation will assume the following steps:
AdIdManager.updateAdvertizingId()
should check the last update time before starting a new background task.initilizeSDK
method to understand the impact of the new task.The text was updated successfully, but these errors were encountered: