Fix missing product surface usage pixels for autocomplete and data clearing and update website loaded pixel usage - #9348
Open
catalinradoiu wants to merge 3 commits into
Conversation
m_product_telemetry_surface_usage_autocomplete was fired from autoCompleteSuggestionsGone(), which the tap-a-suggestion path never reaches: hideNativeInput() hides the list view directly, so the renderer's isVisible guard is already false by the time the view state flips. Count the impression on the transition into "suggestions on screen" instead, matching the pixel definition and the input screen implementation. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
m_product_telemetry_surface_usage_data_clearing was only fired from the regular-mode "clear all tabs and data" branch, so clearing a single tab, burning all Fire tabs, and deleting Duck.ai chats (including from the Duck.ai chat fire button) went uncounted. Route all four actions through one helper, and let the pixel framework own the daily dedup via type = Daily() — as every other surface usage pixel does — instead of a hand-rolled FireButtonStore timestamp gate that was stored before the pixel was enqueued. https://app.asana.com/1/137249556945/project/1211724162604201/task/1216240606378290 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Duck.ai loads in the browser WebView and isn't a DuckDuckGo query URL, so every chat page load fell into the website branch of sendUriLoadedPixels and fired m_product_telemetry_surface_usage_website. Duck.ai already has its own surface pixel, so it was counted twice under the wrong surface. Split the product surface pixels out of sendUriLoadedPixels into sendSurfaceUsagePixels, and skip that call for Duck.ai URLs using DuckChat.isDuckChatUrl, which BrowserWebViewClient already injects and which also covers the duck.ai host, ia=chat and Duck.ai bangs. URI_LOADED keeps firing for Duck.ai — separate metric, unchanged. https://app.asana.com/1/137249556945/project/1211724162604201/task/1216240606378290 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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/1211724162604201/task/1216240606378290?focus=true
Tech Design URL (if applicable):
API Proposals URL(s) (if applicable): None
Description
Two product surface usage pixels were under-reporting because they were wired to the wrong moment.
m_product_telemetry_surface_usage_autocomplete: It was fired fromBrowserTabViewModel.autoCompleteSuggestionsGone(), on dismissal. Tapping a suggestion never reaches that method. It now fires on the transition into "suggestions on screen", insideonAutoCompleteResultReceived.m_product_telemetry_surface_usage_data_clearing: It was fired from only one of the four clearing actions the fire dialog offers (regular-mode "clear all tabs and data"). Clearing a single tab, burning all Fire tabs, using the fire button inside a Duck.ai chat — cleared data without counting anything.m_product_telemetry_surface_usage_website: Duck.ai loads in the browser WebView and isn't a DuckDuckGo query URL, but was counted as a website visit. Since Duck.ai already has its own surface pixel (m_product_telemetry_surface_usage_duck_ai), the same surface was being counted twice — once correctly, once as a website.Steps to test this PR
Autocomplete surface pixel fires when suggestions are shown
m_product_telemetry_surface_usage_autocomplete(and..._dailyonce per day) fires as soon as the list appears, without dismissing itData clearing surface pixel fires for every clearing action
m_product_telemetry_surface_usage_data_clearingfires (as before)..._data_clearingfires each time and..._data_clearing_dailyonly onceDuck.ai loads no longer counted as website surface usage
UI changes
Note
Low Risk
Telemetry-only changes to pixel timing and coverage; no auth, data handling, or user-facing behavior changes beyond analytics accuracy.
Overview
Fixes under-reporting and double-counting in product surface usage telemetry by changing when pixels fire and which navigation paths count.
Autocomplete —
m_product_telemetry_surface_usage_autocompleteno longer fires on dismissal (autoCompleteSuggestionsGone). It fires when suggestions first appear inonAutoCompleteResultReceived, using a transition check so repeated updates while the list stays visible do not add extra impressions.Data clearing —
m_product_telemetry_surface_usage_data_clearingis emitted from a sharedfireDataClearingSurfacePixels()for every confirmed Fire Dialog action: clear all (regular and Fire mode), clear this tab, and delete Duck.ai chats. The daily pixel uses the standardDaily()pixel type instead of custom date/store logic (DateProvider/fireButtonStoreremoved from this path).Website vs SERP vs Duck.ai —
UriLoadedManagersplits URI-loaded pixels from surface SERP/website pixels (sendUriLoadedPixels()vssendSurfaceUsagePixels(isDuckDuckGoUrl)). On page finish, Duck.ai URLs skip website/SERP surface pixels because Duck.ai has its own surface pixel.Pixel definition text in
mobile_surfaces_telemetry.json5is updated to match these semantics.Reviewed by Cursor Bugbot for commit e77a342. Bugbot is set up for automated code reviews on this repo. Configure here.