Add page_type and source to prompt submission pixels - #9568
Add page_type and source to prompt submission pixels#9568YoussefKeyrouz wants to merge 2 commits into
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Privacy Review task: https://app.asana.com/0/69071770703008/1217702990722268 |
8ac9c33 to
09522f8
Compare
09522f8 to
6abc506
Compare
20a76d0 to
b94db4e
Compare
malmstein
left a comment
There was a problem hiding this comment.
two things before merge: page_type is resolved inside the launch, so it races the url write that the submission itself triggers, and the pending entry point has no expiry. also missing a test on the duck.ai carry-forward path, which is what this PR is for. no apk build on this head, so static only.
6abc506 to
a6a3dc9
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ 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 a6a3dc9. Configure here.


Task/Issue URL: https://app.asana.com/1/137249556945/project/72649045549333/task/1217295011063285?focus=true
Tech Design URL (if applicable): https://app.asana.com/1/137249556945/project/481882893211075/task/1217382844057496?focus=true
API Proposals URL(s) (if applicable): https://app.asana.com/1/137249556945/project/1212810093780571/task/1217702991642481?focus=true
Description
Adds
page_typeandsourceto the three prompt-submitted pixels that exist:m_aichat_unified_input_prompt_submittedm_aichat_contextual_prompt_submitted_with_context_nativem_aichat_contextual_prompt_submitted_without_context_native.page_type(ntp,serp,website,duck_ai,contextual,unknown) is resolved live from the current tab.sourcereuses them_aichat_entry_pointenum and is omitted when the entry point isn't known.How
sourceis resolved depends on whether the user is already inside Duck.ai:DUCK_AIsurface, an existing chat, possibly a follow-up prompt, possibly froman earlier app session):
sourceis whatever entry point was recorded when that chat was entered. It’s read from a database entity that stores it on entry.ADDRESS_BARsurface, the prompt is what's opening Duck.ai right now):sourceis that action itself, taken directly
CONTEXTUAL_CHATsurface):sourceis always the constantcontextual_chatSteps to test this PR
Install the internal build and filter Logcat on
Pixel sent:plus the pixel names this PR touches:page_typesourcem_aichat_unified_input_prompt_submitted_count/_dailyntpaddress_bar_prompthttps://example.com/), Duck.ai side, type and submitm_aichat_unified_input_prompt_submitted_count/_dailywebsiteaddress_bar_prompthttps://duckduckgo.com/?q=test), Duck.ai side, type and submitm_aichat_unified_input_prompt_submitted_count/_dailyserpaddress_bar_promptm_aichat_unified_input_prompt_submitted_count/_dailyvoicem_aichat_unified_input_prompt_submitted_count/_dailyduck_aiaddress_bar_prompt,voice,browsing_menu_ntp, etc.), carried forward from the databasebrowsing_menu_ntp/browsing_menu_webpage), then submit a prompt in the resulting tabm_aichat_unified_input_prompt_submitted_count/_dailyduck_aibrowsing_menu_ntporbrowsing_menu_webpagem_aichat_contextual_prompt_submitted_with_context_native_count/_dailycontextualcontextual_chatm_aichat_contextual_prompt_submitted_without_context_native_count/_dailycontextualcontextual_chatm_aichat_unified_input_prompt_submitted_count/_dailyduck_aiUI changes
No UI changes
Note
Medium Risk
Adds a Room migration and tab-lifecycle attribution that can mis-tag analytics if claim/race logic is wrong, but it does not change product behavior or handle sensitive user data.
Overview
Prompt-submitted Duck.ai pixels now include
page_type(ntp / serp / website / duck_ai / contextual) andsource(the same entry-point enum asm_aichat_entry_point, omitted when unknown).sourceis attributed per tab. Opening Duck.ai records a pending entry point; the next tab that actually lands on a Duck.ai URL claims it into a new Room table (duck_ai_tab_session, schema 63, cascade-deleted with the tab). Follow-up prompts in that chat reuse the stored source, including after process death. Address-bar submissions use the live action (e.g. voice vs prompt); the contextual sheet always reportscontextual/contextual_chat.Shared param dictionary entries
duckAiPromptPageTypeandduckAiEntrySourcereplace the inlinesourceenum on the entry-point pixel. Native input now tracks the current tab URL sopage_typecan be resolved without racing navigation.Reviewed by Cursor Bugbot for commit 088f3dc. Bugbot is set up for automated code reviews on this repo. Configure here.