Skip to content
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

fire tab switcher / manager sources pixel #3722

Merged
merged 8 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -983,7 +987,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 @@ -1063,7 +1071,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 @@ -2608,8 +2608,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
Loading