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

Improve Brave Ads logging for frequency capping #14106

Merged
merged 1 commit into from
Jul 11, 2022
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 @@ -11,6 +11,7 @@
#include "bat/ads/internal/account/account.h"
#include "bat/ads/internal/ads/ad_events/inline_content_ads/inline_content_ad_event_handler.h"
#include "bat/ads/internal/ads/serving/inline_content_ad_serving.h"
#include "bat/ads/internal/base/logging_util.h"
#include "bat/ads/internal/deprecated/client/client_state_manager.h"
#include "bat/ads/internal/geographic/subdivision/subdivision_targeting.h"
#include "bat/ads/internal/history/history_manager.h"
Expand Down Expand Up @@ -60,6 +61,11 @@ void InlineContentAd::TriggerEvent(

///////////////////////////////////////////////////////////////////////////////

void InlineContentAd::OnOpportunityAroseToServeInlineContentAd(
const SegmentList& segments) {
BLOG(1, "Opportunity arose to serve an inline content ad");
}

void InlineContentAd::OnDidServeInlineContentAd(const InlineContentAdInfo& ad) {
TriggerEvent(ad.placement_id, ad.creative_instance_id,
mojom::InlineContentAdEventType::kServed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class InlineContentAd final : public inline_content_ads::EventHandlerObserver,

private:
// inline_content_ads::ServingObserver:
void OnOpportunityAroseToServeInlineContentAd(
const SegmentList& segments) override;
void OnDidServeInlineContentAd(const InlineContentAdInfo& ad) override;

// inline_content_ads::EventHandlerObserver:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "bat/ads/internal/account/account.h"
#include "bat/ads/internal/ads/ad_events/new_tab_page_ads/new_tab_page_ad_event_handler.h"
#include "bat/ads/internal/ads/serving/new_tab_page_ad_serving.h"
#include "bat/ads/internal/base/logging_util.h"
#include "bat/ads/internal/deprecated/client/client_state_manager.h"
#include "bat/ads/internal/geographic/subdivision/subdivision_targeting.h"
#include "bat/ads/internal/history/history_manager.h"
Expand Down Expand Up @@ -55,6 +56,11 @@ void NewTabPageAd::TriggerEvent(const std::string& placement_id,

///////////////////////////////////////////////////////////////////////////////

void NewTabPageAd::OnOpportunityAroseToServeNewTabPageAd(
const SegmentList& segments) {
BLOG(1, "Opportunity arose to serve a new tab page ad");
}

void NewTabPageAd::OnDidServeNewTabPageAd(const NewTabPageAdInfo& ad) {
TriggerEvent(ad.placement_id, ad.creative_instance_id,
mojom::NewTabPageAdEventType::kServed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class NewTabPageAd final : public new_tab_page_ads::EventHandlerObserver,

private:
// new_tab_page_ads::ServingObserver:
void OnOpportunityAroseToServeNewTabPageAd(
const SegmentList& segments) override;
void OnDidServeNewTabPageAd(const NewTabPageAdInfo& ad) override;

// new_tab_page_ads::EventHandlerObserver:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ void NotificationAd::OnUserDidBecomeActive(const base::TimeDelta idle_time,

void NotificationAd::OnOpportunityAroseToServeNotificationAd(
const SegmentList& segments) {
BLOG(1, "Opportunity arose to serve a notification ad");

privacy::p2a::RecordAdOpportunityForSegments(AdType::kNotificationAd,
segments);
}
Expand Down