-
Notifications
You must be signed in to change notification settings - Fork 873
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
NTP SI: update default counts and reset to initial counts on SI data update, browser restart and every 24hr #19823
Conversation
constexpr base::FeatureParam<int> kInitialCountToBrandedWallpaper{ | ||
&kBraveNTPBrandedWallpaper, "initial_count_to_branded_wallpaper", 1}; | ||
&kBraveNTPBrandedWallpaper, "initial_count_to_branded_wallpaper", 0}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend leaving the default value and testing this initial count via this Griffin feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The griffin value won't apply to first run. A restart is required. But seems we may separate first-run value from after-restart initial values.
|
||
// Show branded wallpaper every nth new tab page. | ||
constexpr base::FeatureParam<int> kCountToBrandedWallpaper{ | ||
&kBraveNTPBrandedWallpaper, "count_to_branded_wallpaper", 3}; | ||
&kBraveNTPBrandedWallpaper, "count_to_branded_wallpaper", 2}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend leaving the default value and testing this count via this Griffin feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we go to 2 I'm not sure I see us have the desire to go back to 3, since numbers would be worse and UX impact doesn't seem huge? Also it's less work and moving pieces in different repos syncing to when this PR hits various channels if we can combine with this PR, since we have to uplift anyway.
@@ -17,8 +17,10 @@ namespace ntp_background_images { | |||
ViewCounterModel::ViewCounterModel(PrefService* prefs) : prefs_(prefs) { | |||
CHECK(prefs); | |||
|
|||
// When browser is restarted or component is updated, we reset to "initial" | |||
// count. | |||
count_to_branded_wallpaper_ = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have to reset this value from ViewCounterModel::Reset()
.
It's called whenever component is updated.
registry->RegisterBooleanPref( | ||
prefs::kBrandedWallpaperNotificationDismissed, false); | ||
registry->RegisterIntegerPref( | ||
prefs::kCountToBrandedWallpaper, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we delete prefs::kCountToBrandedWallpaper
, it would be good to clear it from Preferences file.
We usually do this from brave::RegisterProfilePrefsForMigration()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed via 22c14c5
#include "brave/components/ntp_background_images/browser/features.h" | ||
#include "brave/components/ntp_background_images/common/pref_names.h" | ||
#include "components/prefs/pref_service.h" | ||
|
||
namespace ntp_background_images { | ||
|
||
namespace { | ||
|
||
constexpr base::TimeDelta kCountsResetTimeDelay = base::Days(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to have this configurable via Griffin, so that if the value needs changing in the future we do not need to wait for the trains
I pushed another PR #19896. |
Found another NTP issue(brave/brave-browser#32577) and I think it also could happen easily after this PR merging. Pushed #19915. |
Hi @petemill @tmancey @simonhong do we have an eta for when this is likely to be committed? I'd heard we were aiming for the release this week, but it looks like this is still in progress. Asking so I can give sales team an update on this too. Thanks. |
components/ntp_background_images/browser/view_counter_model_unittest.cc
Outdated
Show resolved
Hide resolved
Hi all, apologies for the bump, but wanted to follow-up on my prior note above from last week. Thanks @tmancey @petemill @simonhong |
I left some trivial comments but this PR looks good to me except that. |
@tmancey @petemill given @simonhong comment above, can we please prioritize getting this committed and merged? Team is pretty eager to get a read on potential volume increases with some large customers deploying campaigns over the next two weeks. Thanks! |
Sorry @lukemulks, I missed the countless notifications somehow. And as far as I can tell, we decided to not do some of this:
The argument for keeping (3) despite also keeping initial NTT count to the second NTP view is that it ensures that users: a) see at least one NTT on the second NTP each day and b) have their first NTP of the day be not a NTT. So the improvement over only implementing (2) is that users who only open 2 NTP a day will always see 1 NTT. If we don't implement (3), then those users will see 0 NTT. Since this is a test to see the effect, I'm inclined to suggest we keep (3). Just want to make sure we're clear where we're landing as there were a few opinions. EDIT |
64d8f1b
to
f90bc02
Compare
f90bc02
to
649c917
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chromium_src
++
Thanks @petemill agree on keeping item 3 for purposes of testing. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chromium_src changes ok
Thank you all for the team effort getting this through. Much appreciated 🫡 |
NTP SI count defaults updated to 1st view after install and every 3rd thereafter. Previously it was 2nd view after install and every 4th thereafter. In addition, the initial view count (now 1st) is used after browser restart and after the SI data gets updated. This avoids the problem of missing the SI data for the 1st pageview after install.
Lastly, the count gets reset to the "initial" value every 24 hours. This ensures a user is likely to see a multi-day campaign each day even if they open fewer NTPs than the regular count-to-branded-wallpaper.
Resolves brave/brave-browser#31551
Resolves brave/brave-browser#33228
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run lint
,npm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: