-
Notifications
You must be signed in to change notification settings - Fork 31
Replace m.mac.daily.active.user.d
's default_browser
and dock
parameters with individual pixels
#2216
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
Splits the former parameterized daily active user pixel into discrete pixels to enable leveraging long‑term aggregate stats and removes parameters from the original pixel.
- Removes parameters (default_browser, dock) from m_mac_daily_active_user.
- Introduces four new boolean-suffixed pixels (default browser status, dock status) but currently implemented as two dynamic-name variants without the documented _d suffix.
- Updates AppDelegate to fire the base daily active user pixel plus the new status pixels.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
macOS/DuckDuckGo/Statistics/GeneralPixel.swift | Replaced associated-value case with separate cases and added dynamic pixel name generation, removed old parameter map. |
macOS/DuckDuckGo/Application/AppDelegate.swift | Renamed firing method and now fires multiple pixels instead of one with parameters. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
return "m_mac_is_default_browser_\(isDefault ? "true" : "false")" | ||
|
||
case .dailyIsAddedToDock(isAddedToDock: let isAddedToDock): | ||
return "m_mac_is_added_to_dock_\(isAddedToDock ? "true" : "false")" |
Copilot
AI
Oct 15, 2025
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 generated pixel names omit the documented trailing _d suffix (spec lists m_mac_is_default_browser_true_d / false_d and m_mac_is_added_to_dock_true_d / false_d). Without the suffix, downstream dashboards expecting the specified names will not receive data. Update the returned strings to append _d.
return "m_mac_is_default_browser_\(isDefault ? "true" : "false")" | |
case .dailyIsAddedToDock(isAddedToDock: let isAddedToDock): | |
return "m_mac_is_added_to_dock_\(isAddedToDock ? "true" : "false")" | |
return "m_mac_is_default_browser_\(isDefault ? "true" : "false")_d" | |
case .dailyIsAddedToDock(isAddedToDock: let isAddedToDock): | |
return "m_mac_is_added_to_dock_\(isAddedToDock ? "true" : "false")_d" |
Copilot uses AI. Check for mistakes.
#if SPARKLE | ||
PixelKit.fire(NonStandardEvent(GeneralPixel.dailyActiveUser(isDefault: DefaultBrowserPreferences().isDefault, isAddedToDock: DockCustomizer().isAddedToDock)), frequency: .legacyDaily) | ||
PixelKit.fire(NonStandardEvent(GeneralPixel.dailyActiveUser), frequency: .legacyDaily) | ||
PixelKit.fire(NonStandardEvent(GeneralPixel.dailyIsDefaultBrowser(isDefault: DefaultBrowserPreferences().isDefault)), frequency: .legacyDaily) | ||
PixelKit.fire(NonStandardEvent(GeneralPixel.dailyIsAddedToDock(isAddedToDock: DockCustomizer().isAddedToDock)), frequency: .legacyDaily) | ||
#else | ||
PixelKit.fire(NonStandardEvent(GeneralPixel.dailyActiveUser(isDefault: DefaultBrowserPreferences().isDefault, isAddedToDock: nil)), frequency: .legacyDaily) | ||
PixelKit.fire(NonStandardEvent(GeneralPixel.dailyActiveUser), frequency: .legacyDaily) | ||
PixelKit.fire(NonStandardEvent(GeneralPixel.dailyIsDefaultBrowser(isDefault: DefaultBrowserPreferences().isDefault)), frequency: .legacyDaily) |
Copilot
AI
Oct 15, 2025
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.
DefaultBrowserPreferences() is instantiated twice (lines 1104 and 1108) and DockCustomizer() once; extracting these to local lets avoids redundant construction and improves readability. Example: let isDefault = DefaultBrowserPreferences().isDefault; reuse across branches (guard with #if if needed).
Copilot uses AI. Check for mistakes.
return "m_mac_\(isDefault ? "default" : "non-default")-browser" | ||
|
||
case .dailyAddedToDock(isAddedToDock: let isAddedToDock): | ||
return "m_mac_\(isAddedToDock ? "added" : "not-added")-to-dock" |
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.
Bug: Pixel Naming Mismatch Causes Analytics Issues
The pixel names for daily default browser and added-to-dock events don't align with the PR specification. The code generates names like m_mac_default-browser
and m_mac_added-to-dock
, but the spec expects m_mac_is_default_browser_true_d
and m_mac_is_added_to_dock_true_d
(and their false
counterparts). This mismatch could affect downstream analytics.
Task/Issue URL: https://app.asana.com/1/137249556945/project/1201048563534612/task/1210965446467206?focus=true
Tech Design URL:
CC:
Description
To use long term stats from the aggregate table we need to move from using pixel with parameters to individual pixels.
Scope of changes:
m.mac.daily.active.user.d
pixelTesting Steps
Impact and Risks
None: Internal tooling, documentation
What could go wrong?
Broken dashboards, misreported pixels.
Internal references:
Definition of Done | Engineering Expectations | Tech Design Template
Note
Replaces parameterized
dailyActiveUser
pixel with standalone pixels for default browser and dock status, updating firing logic and pixel names.GeneralPixel.dailyActiveUser(isDefault:isAddedToDock:)
with:GeneralPixel.dailyActiveUser
(no params)GeneralPixel.dailyDefaultBrowser(isDefault:)
GeneralPixel.dailyAddedToDock(isAddedToDock:)
m_mac_default-browser
/m_mac_non-default-browser
m_mac_added-to-dock
/m_mac_not-added-to-dock
default_browser
anddock
parameters fromdailyActiveUser
.fireDailyActiveUserPixel()
withfireDailyActiveUserPixels()
.dailyActiveUser
(legacyDaily).dailyDefaultBrowser(isDefault:)
(daily).dailyAddedToDock(isAddedToDock:)
(daily).Written by Cursor Bugbot for commit a947963. This will update automatically on new commits. Configure here.