Skip to content

Commit

Permalink
new pixels for source of tab manager open and renaming for transparency
Browse files Browse the repository at this point in the history
  • Loading branch information
brindy committed Dec 11, 2024
1 parent f5c17a6 commit 7b7a682
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
16 changes: 12 additions & 4 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ extension Pixel {
case tabSwitcherClickCloseTab
case tabSwitcherSwipeCloseTab
case tabSwitchLongPressNewTab
case tabSwitcherOpenDaily
case tabSwitcherOpenedDaily

case tabSwitcherOpenedFromSerp
case tabSwitcherOpenedFromWebsite
case tabSwitcherOpenedFromNewTabPage

case settingsDoNotSellShown
case settingsDoNotSellOn
Expand Down Expand Up @@ -118,7 +122,7 @@ extension Pixel {
case tabBarForwardPressed
case bookmarksButtonPressed
case tabBarBookmarksLongPressed
case tabBarTabSwitcherPressed
case tabBarTabSwitcherOpened

case homeScreenShown
case homeScreenEditFavorite
Expand Down Expand Up @@ -969,7 +973,11 @@ extension Pixel.Event {
case .tabSwitcherClickCloseTab: return "m_tab_manager_close_tab_click"
case .tabSwitcherSwipeCloseTab: return "m_tab_manager_close_tab_swipe"
case .tabSwitchLongPressNewTab: return "m_tab_manager_long_press_new_tab"
case .tabSwitcherOpenDaily: return "m_tab_manager_clicked_daily"
case .tabSwitcherOpenedDaily: return "m_tab_manager_opened_daily"

case .tabSwitcherOpenedFromSerp: return "m_tab_manager_open_from_serp"
case .tabSwitcherOpenedFromWebsite: return "m_tab_manager_open_from_website"
case .tabSwitcherOpenedFromNewTabPage: return "m_tab_manager_open_from_newtabpage"

case .settingsDoNotSellShown: return "ms_dns"
case .settingsDoNotSellOn: return "ms_dns_on"
Expand Down Expand Up @@ -1049,7 +1057,7 @@ extension Pixel.Event {
case .tabBarForwardPressed: return "mt_fw"
case .bookmarksButtonPressed: return "mt_bm"
case .tabBarBookmarksLongPressed: return "mt_bl"
case .tabBarTabSwitcherPressed: return "mt_tb"
case .tabBarTabSwitcherOpened: return "m_tab_manager_opened"

case .bookmarkLaunchList: return "m_bookmark_launch_list"
case .bookmarkLaunchScored: return "m_bookmark_launch_scored"
Expand Down
11 changes: 9 additions & 2 deletions DuckDuckGo/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2574,8 +2574,15 @@ extension MainViewController: TabSwitcherButtonDelegate {
}

func showTabSwitcher(_ button: TabSwitcherButton) {
Pixel.fire(pixel: .tabBarTabSwitcherPressed)
DailyPixel.fireDaily(.tabSwitcherOpenDaily, withAdditionalParameters: TabSwitcherOpenDailyPixel().parameters(with: tabManager.model.tabs))
Pixel.fire(pixel: .tabBarTabSwitcherOpened)
DailyPixel.fireDaily(.tabSwitcherOpenedDaily, withAdditionalParameters: TabSwitcherOpenDailyPixel().parameters(with: tabManager.model.tabs))
if currentTab?.url?.isDuckDuckGoSearch == true {
Pixel.fire(pixel: .tabSwitcherOpenedFromSerp)
} else if currentTab?.url != nil {
Pixel.fire(pixel: .tabSwitcherOpenedFromWebsite)
} else {
Pixel.fire(pixel: .tabSwitcherOpenedFromNewTabPage)
}

performCancel()
showTabSwitcher()
Expand Down

0 comments on commit 7b7a682

Please sign in to comment.