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

Fixes new tab page and promoted content ads should reward users for up to 4 ads per hour and 20 ads per day - 1.28.x #9651

Merged
merged 1 commit into from
Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ void NewTabPageAd::FireEvent(const NewTabPageAdInfo& ad,
return;
}

if (event_type == NewTabPageAdEventType::kViewed) {
// TODO(tmancey): We need to fire an ad served event until new tab page
// ads are served by the ads library
FireEvent(uuid, creative_instance_id, NewTabPageAdEventType::kServed);
}

const auto ad_event = new_tab_page_ads::AdEventFactory::Build(event_type);
ad_event->FireEvent(ad);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ void PromotedContentAd::FireEvent(const PromotedContentAdInfo& ad,
return;
}

if (event_type == PromotedContentAdEventType::kViewed) {
// TODO(tmancey): We need to fire an ad served event until promoted
// content ads are served by the ads library
FireEvent(uuid, creative_instance_id,
PromotedContentAdEventType::kServed);
}

const auto ad_event =
promoted_content_ads::AdEventFactory::Build(event_type);
ad_event->FireEvent(ad);
Expand Down
14 changes: 0 additions & 14 deletions vendor/bat-native-ads/src/bat/ads/internal/ads_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -313,27 +313,13 @@ void AdsImpl::OnAdNotificationEvent(const std::string& uuid,
void AdsImpl::OnNewTabPageAdEvent(const std::string& uuid,
const std::string& creative_instance_id,
const NewTabPageAdEventType event_type) {
if (event_type == NewTabPageAdEventType::kViewed) {
// TODO(tmancey): We need to fire an ad served event until new tab page ads
// are served by the ads library
new_tab_page_ad_->FireEvent(uuid, creative_instance_id,
NewTabPageAdEventType::kServed);
}

new_tab_page_ad_->FireEvent(uuid, creative_instance_id, event_type);
}

void AdsImpl::OnPromotedContentAdEvent(
const std::string& uuid,
const std::string& creative_instance_id,
const PromotedContentAdEventType event_type) {
if (event_type == PromotedContentAdEventType::kViewed) {
// TODO(tmancey): We need to fire an ad served event until promoted content
// ads are served by the ads library
promoted_content_ad_->FireEvent(uuid, creative_instance_id,
PromotedContentAdEventType::kServed);
}

promoted_content_ad_->FireEvent(uuid, creative_instance_id, event_type);
}

Expand Down