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

Impression tracker for original API #804

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

ValentinPostindustria
Copy link
Collaborator

No description provided.

@@ -449,6 +477,8 @@ public void onFetchCompleted(BidResponse response) {
HashMap<String, String> keywords = response.getTargeting();
Util.apply(keywords, adObject);
originalListener.onComplete(ResultCode.SUCCESS);

registerVisibilityTrackerIfNeeded(bidResponse);
Copy link
Contributor

@YuriyVelichkoPI YuriyVelichkoPI Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach doesn't look reliable. Switching the tracker on/off for each result of the bid fetching may lead to gaps in tracking.

Let's implement it in the following.

  • start viewability tracking on calling of activatePrebidImpressionTracker
  • stop tracking on destroying the AdUnit object
  • once the tracked view meets the impression tracking criteria - check the content, and if it contains PUC - track the respective impression.

@@ -65,7 +72,11 @@ public abstract class AdUnit {
@Nullable
protected BidResponse bidResponse;

protected final VisibilityMonitor visibilityMonitor = new VisibilityMonitor();
protected WeakReference<View> adViewReference = new WeakReference<>(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we hold adViewReference in VisibilityMonitor?

@ValentinPostindustria
Copy link
Collaborator Author

Charles session.

@ValentinPostindustria
Copy link
Collaborator Author

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

Successfully merging this pull request may close these issues.

2 participants