Skip to content

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
developfrom
fix/cradoiu/fix-missing-product-surface-pixels
Open

Fix missing product surface usage pixels for autocomplete and data clearing and update website loaded pixel usage#9348
catalinradoiu wants to merge 3 commits into
developfrom
fix/cradoiu/fix-missing-product-surface-pixels

Conversation

@catalinradoiu

@catalinradoiu catalinradoiu commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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 from BrowserTabViewModel.autoCompleteSuggestionsGone(), on dismissal. Tapping a suggestion never reaches that method. It now fires on the transition into "suggestions on screen", inside onAutoCompleteResultReceived.

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

  • Install and open the browser, focus the omnibar and type a query until suggestions appear
  • Verify m_product_telemetry_surface_usage_autocomplete (and ..._daily once per day) fires as soon as the list appears, without dismissing it
  • Keep typing to refine the query while the list stays up; verify no extra impressions are counted
  • Tap a suggestion to navigate; no new pixel should be sent for autocomplete
  • Clear the omnibar, type again so the list re-appears; verify a new impression is counted

Data clearing surface pixel fires for every clearing action

  • Fire button → Delete all tabs: verify m_product_telemetry_surface_usage_data_clearing fires (as before)
  • Fire button → Delete a single tab: verify it fires
  • In Fire mode, fire button → Delete all tabs/ single tab: verify it fires
  • Fire button inside a Duck.ai chat → delete the chat: verify it fires
  • Repeat any two actions on the same day: verify ..._data_clearing fires each time and ..._data_clearing_daily only once

Duck.ai loads no longer counted as website surface usage

  • Open a Duck.ai chat (omnibar Duck.ai mode, or navigate to duck.ai) and send a prompt
  • Verify m_product_telemetry_surface_usage_website / ..._website_daily do not fire for the chat load
  • Load a regular website; verify ..._website still fires as before
  • Run a search on DuckDuckGo; verify ..._serp still fires and ..._website does not

UI changes

Before After
No UI changes No 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.

Autocompletem_product_telemetry_surface_usage_autocomplete no longer fires on dismissal (autoCompleteSuggestionsGone). It fires when suggestions first appear in onAutoCompleteResultReceived, using a transition check so repeated updates while the list stays visible do not add extra impressions.

Data clearingm_product_telemetry_surface_usage_data_clearing is emitted from a shared fireDataClearingSurfacePixels() 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 standard Daily() pixel type instead of custom date/store logic (DateProvider / fireButtonStore removed from this path).

Website vs SERP vs Duck.aiUriLoadedManager splits URI-loaded pixels from surface SERP/website pixels (sendUriLoadedPixels() vs sendSurfaceUsagePixels(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.json5 is 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.

catalinradoiu and others added 2 commits July 30, 2026 18:08
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>

Copy link
Copy Markdown
Contributor Author

@catalinradoiu catalinradoiu changed the title Fire autocomplete surface usage pixel when suggestions are shown Fix missing product surface usage pixels for autocomplete and data clearing Jul 30, 2026
@catalinradoiu catalinradoiu changed the title Fix missing product surface usage pixels for autocomplete and data clearing [DRAFT] Fix missing product surface usage pixels for autocomplete and data clearing Jul 30, 2026
@catalinradoiu catalinradoiu changed the title [DRAFT] Fix missing product surface usage pixels for autocomplete and data clearing Fix missing product surface usage pixels for autocomplete and data clearing Jul 31, 2026
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>
@catalinradoiu catalinradoiu changed the title Fix missing product surface usage pixels for autocomplete and data clearing Fix missing product surface usage pixels for autocomplete and data clearing and update website loaded pixel usage Jul 31, 2026
@anikiki anikiki self-assigned this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants