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

Expire ads respectively to the seatbid.bid.exp #850

Open
YuriyVelichkoPI opened this issue May 19, 2023 · 2 comments
Open

Expire ads respectively to the seatbid.bid.exp #850

YuriyVelichkoPI opened this issue May 19, 2023 · 2 comments

Comments

@YuriyVelichkoPI
Copy link
Contributor

YuriyVelichkoPI commented May 19, 2023

Background

The OpenRTB protocol defines the bid.exp property that:

Advisory as to the number of seconds the bidder is willing to wait between the auction and the actual impression.

Since the In-App Native API and Rendering API, in fact, cache the bid until it isn't displayed, the SDK should utilize the bid.exp field to expire the cache or the respective Ad Object - BannerView, Interstitial controller, etc.

Objectives

In-App Native

It looks like the CacheManager for In-App Native ads utilizes the value of bid.exp to invalidate the cached bid. However, there are no unit tests not for Bid class not for the CacheManager.shared.save with the expireInterval.

So for the scope of the Native Ads need to add unit tests for the Bid.exp property. And for
the CacheManager.shared.save method.

Also, we need to add tests to verify the invocation of NativeAd.cacheExpired delegate method because it is essential to notify the app properly and not break this behavior in the future.

Rendering API

  • Parse the bid.exp and make it a part of the ad model (most probably CreativeModel).
  • Once the bid is received and the model is created, if bid.exp is not empty - create an async call after the bid.exp time to notify the SDK and the application that the ad is expired and can't be displayed anymore.
  • Introduce the delegate method the adDidExpire in Rendering API - banner, interstitial, and rewarded.
  • Once the expiration callback is triggered and the ad is still alive (in the memory):
    • Mark the ad as expired
    • Call the adDidExpire delegate method
    • If the ad is not displayed on the screen - destroy it.
    • For interstitial ad units, the isReady property should return false for expired ad
    • The show method for interstitial ad units should do nothing
    • For the banner - follow the current ad unit config - refresh the unit or act like the ad is failed to load.
  • Don't add the API property to signal $.imp[n].exp in the request. Let's keep it on Support collecting arbitrary ORTB parameters #877.
  • Add unit tests
  • Add integration cases and tests into Internal Test App
@YuriyVelichkoPI YuriyVelichkoPI changed the title [DRAFT] Expire ads respectively to the seatbid.bid.exp Expire ads respectively to the seatbid.bid.exp Aug 3, 2023
@jsligh
Copy link
Collaborator

jsligh commented Jun 3, 2024

@YuriyVelichkoPI is this still relevant?

@YuriyVelichkoPI
Copy link
Contributor Author

Yes

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

2 participants