Add pixel instrumentation for NTP after idle feature#8177
Merged
YoussefKeyrouz merged 2 commits intodevelopfrom Apr 17, 2026
Merged
Add pixel instrumentation for NTP after idle feature#8177YoussefKeyrouz merged 2 commits intodevelopfrom
YoussefKeyrouz merged 2 commits intodevelopfrom
Conversation
fafc2a4 to
cab9144
Compare
Collaborator
This stack of pull requests is managed by Graphite. Learn more about stacking. |
cab9144 to
21fd2c2
Compare
21fd2c2 to
acf773b
Compare
Contributor
|
Privacy Review task: https://app.asana.com/0/69071770703008/1214104974677733 |
acf773b to
4e2f5d5
Compare
joshliebe
reviewed
Apr 17, 2026
4e2f5d5 to
a021a5e
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a021a5e. Configure here.
…and fix hatch pixels on later NTPs
a021a5e to
41ec2df
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Task/Issue URL: https://app.asana.com/1/137249556945/project/1174433894299346/task/1213542861384504?focus=true
Description
Adds pixel instrumentation to measure user behaviour for the "NTP after idle" feature. Tracks whether the NTP was shown due to inactivity or by the user, and attributes downstream interactions accordingly.
New pixels (count + daily for each):
m_ntp_after_idle_ntp_shown_after_idle— NTP shown because idle threshold was metm_ntp_after_idle_ntp_shown_user_initiated— NTP opened by the userm_ntp_after_idle_return_to_page_tapped_after_idle/user_initiated— hatch card tappedm_ntp_after_idle_bar_used_from_ntp_after_idle/user_initiated— search submitted from NTPm_ntp_after_idle_timeout_selected_[seconds]+ daily — user selects an idle timeout valueImplementation:
NtpAfterIdleRepository(new-tab-page-api) stores whether the last NTP was shown after idle, propagating context to downstream events in other modulesFirstScreenHandlersets the flag and fires shown pixels at the decision pointBrowserTabFragmentandInputScreenFragmentfire hatch tapped pixels in theirHatchListener.onHatchPressed()implementationsOmnibarLayoutViewModelfires bar used pixels ononEnterKeyPressedwhen in NTP contextShowOnAppLaunchViewModelfires timeout selected pixels alongside the existingm_settings_after_inactivity_timeout_changedpixelSteps to test this PR
showNTPAfterIdleReturnfeature flag via remote config or internal overridem_ntp_after_idle_ntp_shown_after_idlefires in logsm_ntp_after_idle_ntp_shown_user_initiatedfiresreturn_to_page_tapped_*pixel fires based on how the NTP was shownbar_used_from_ntp_*pixel firesm_ntp_after_idle_timeout_selected_[seconds]firesUpdates since review
While reviewing the initial version I spotted a few issues and decided to address them in this PR rather than defer to another one. The main fix is a bug where hatch/search pixels on any NTP opened after the initial idle-return were still being classified as after-idle, and where pixels fired incorrectly when other options (LastOpenedTab, SpecificPage) are selected. The rest is scope that fell out of that.
NtpAfterIdleManagermethods renamed to clean them up and hide implementation details.onIdleReturnTriggered()now fires from ShowOnAppLaunchOptionHandler's NewTabPage branch, so the shown pixel only fires when an NTP actually renders.UI changes
N/A
Note
Medium Risk
Adds new cross-module event tracking tied into tab selection, app-launch routing, and omnibar submission paths; while mostly analytics, the new hooks and state classification could misfire or regress NTP/launch behavior if edge cases are missed.
Overview
Adds a new
NtpAfterIdleManager(+ impl) that classifies NTP renders as after-idle vs user-initiated and fires new count+daily pixels for NTP shown, return-to-page hatch taps, NTP searches, and idle-timeout selections.Wires this manager into app launch and browsing flows:
ShowOnAppLaunchOptionHandlernow marks true idle-triggered returns before creating an NTP tab,BrowserViewModelobserves selected-tab changes to detect NTP visibility,BrowserTabViewModelrecords searches submitted from an NTP, and hatch tap handlers inBrowserTabFragment/InputScreenFragmentnotify the manager. Tests are updated/added to cover the new notifications and classification behavior, and a pixel param-removal plugin is added for the new pixel set.Reviewed by Cursor Bugbot for commit 41ec2df. Bugbot is set up for automated code reviews on this repo. Configure here.