-
Notifications
You must be signed in to change notification settings - Fork 868
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Brave Ads Serving Improvements
Currently, ad serving is done by randomly picking ads based on matching segments. The approach has several problems like under-delivery of creatives and users not seeing as many ads as they could. This PR aims to solve these short comings by introducing a statistical model for ad selection. We assume that the click probability can be approximated by a linear function of features related to locally observed user behaviour. The function is weighted by a control-parameter called pass-through rate (ptr) to throttle delivery of individual ads.
- Loading branch information
Moritz Haller
committed
Sep 21, 2021
1 parent
3cc9930
commit 0f2aac6
Showing
90 changed files
with
2,770 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
vendor/bat-native-ads/src/bat/ads/internal/ad_events/ad_event_unittest_util.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* Copyright (c) 2021 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "bat/ads/internal/ad_events/ad_event_unittest_util.h" | ||
|
||
#include <cstdint> | ||
|
||
#include "base/guid.h" | ||
#include "bat/ads/confirmation_type.h" | ||
#include "bat/ads/internal/ad_events/ad_event_info.h" | ||
#include "bat/ads/internal/bundle/creative_ad_info.h" | ||
|
||
namespace ads { | ||
|
||
AdEventInfo GetAdEvent(const CreativeAdInfo& creative_ad, | ||
const ConfirmationType confirmation_type, | ||
const base::Time& time) { | ||
AdEventInfo ad_event; | ||
ad_event.uuid = base::GenerateGUID(); | ||
ad_event.confirmation_type = confirmation_type; | ||
ad_event.creative_instance_id = creative_ad.creative_instance_id; | ||
ad_event.advertiser_id = creative_ad.advertiser_id; | ||
ad_event.timestamp = static_cast<int64_t>(time.ToDoubleT()); | ||
|
||
return ad_event; | ||
} | ||
|
||
} // namespace ads |
23 changes: 23 additions & 0 deletions
23
vendor/bat-native-ads/src/bat/ads/internal/ad_events/ad_event_unittest_util.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* Copyright (c) 2021 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifndef BRAVE_VENDOR_BAT_NATIVE_ADS_SRC_BAT_ADS_INTERNAL_AD_EVENTS_AD_EVENT_UNITTEST_UTIL_H_ | ||
#define BRAVE_VENDOR_BAT_NATIVE_ADS_SRC_BAT_ADS_INTERNAL_AD_EVENTS_AD_EVENT_UNITTEST_UTIL_H_ | ||
|
||
#include "base/time/time.h" | ||
|
||
namespace ads { | ||
|
||
struct AdEventInfo; | ||
class ConfirmationType; | ||
struct CreativeAdInfo; | ||
|
||
AdEventInfo GetAdEvent(const CreativeAdInfo& creative_ad, | ||
const ConfirmationType confirmation_type, | ||
const base::Time& time); | ||
|
||
} // namespace ads | ||
|
||
#endif // BRAVE_VENDOR_BAT_NATIVE_ADS_SRC_BAT_ADS_INTERNAL_AD_EVENTS_AD_EVENT_UNITTEST_UTIL_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.