Skip to content

Commit

Permalink
Fixes new tab page and promoted content ads should reward users for u…
Browse files Browse the repository at this point in the history
…p to 4 ads per hour and 20 ads per day
  • Loading branch information
tmancey committed Aug 4, 2021
1 parent b9537e8 commit 7355046
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
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

0 comments on commit 7355046

Please sign in to comment.