diff --git a/Core/PixelEvent.swift b/Core/PixelEvent.swift index caf2b9f04e..8e6f1c3beb 100644 --- a/Core/PixelEvent.swift +++ b/Core/PixelEvent.swift @@ -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 @@ -118,7 +122,7 @@ extension Pixel { case tabBarForwardPressed case bookmarksButtonPressed case tabBarBookmarksLongPressed - case tabBarTabSwitcherPressed + case tabBarTabSwitcherOpened case homeScreenShown case homeScreenEditFavorite @@ -984,7 +988,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" @@ -1064,7 +1072,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" diff --git a/DuckDuckGo/MainViewController.swift b/DuckDuckGo/MainViewController.swift index c129c44057..42a9bc7ea8 100644 --- a/DuckDuckGo/MainViewController.swift +++ b/DuckDuckGo/MainViewController.swift @@ -2611,8 +2611,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()