diff --git a/Core/PixelEvent.swift b/Core/PixelEvent.swift index 486a9dde71..31259e85d8 100644 --- a/Core/PixelEvent.swift +++ b/Core/PixelEvent.swift @@ -37,10 +37,10 @@ extension Pixel { case forgetAllDataCleared case privacyDashboardOpened - case privacyDashboardProtectionDisabled - case privacyDashboardProtectionEnabled - case reportBrokenSiteProtectionDisabled - case reportBrokenSiteProtectionEnabled + + case dashboardProtectionAllowlistAdd + case dashboardProtectionAllowlistRemove + case privacyDashboardReportBrokenSite case privacyDashboardPixelFromJS(rawPixel: String) @@ -531,11 +531,10 @@ extension Pixel.Event { case .forgetAllDataCleared: return "mf_dc" case .privacyDashboardOpened: return "mp" - - case .privacyDashboardProtectionDisabled: return "mp_wla" - case .privacyDashboardProtectionEnabled: return "mp_wlr" - case .reportBrokenSiteProtectionDisabled: return "m_broken_site_allowlist_add" - case .reportBrokenSiteProtectionEnabled: return "m_broken_site_allowlist_remove" + + case .dashboardProtectionAllowlistAdd: return "mp_wla" + case .dashboardProtectionAllowlistRemove: return "mp_wlr" + case .privacyDashboardReportBrokenSite: return "mp_rb" case .privacyDashboardPixelFromJS(let rawPixel): return rawPixel diff --git a/DuckDuckGo/PrivacyDashboard/PrivacyDashboardViewController.swift b/DuckDuckGo/PrivacyDashboard/PrivacyDashboardViewController.swift index a922499dc6..3da10206b3 100644 --- a/DuckDuckGo/PrivacyDashboard/PrivacyDashboardViewController.swift +++ b/DuckDuckGo/PrivacyDashboard/PrivacyDashboardViewController.swift @@ -82,29 +82,23 @@ class PrivacyDashboardViewController: UIViewController { privacyDashboardController.didFinishRulesCompilation() privacyDashboardController.updatePrivacyInfo(privacyInfo) } - + private func privacyDashboardProtectionSwitchChangeHandler(state: ProtectionState) { guard let domain = privacyDashboardController.privacyInfo?.url.host else { return } let privacyConfiguration = privacyConfigurationManager.privacyConfig - + let pixelParam = ["trigger_origin": state.eventOrigin.screen.rawValue] if state.isProtected { privacyConfiguration.userEnabledProtection(forDomain: domain) ActionMessageView.present(message: UserText.messageProtectionEnabled.format(arguments: domain)) + Pixel.fire(pixel: .dashboardProtectionAllowlistRemove, withAdditionalParameters: pixelParam) } else { privacyConfiguration.userDisabledProtection(forDomain: domain) ActionMessageView.present(message: UserText.messageProtectionDisabled.format(arguments: domain)) + Pixel.fire(pixel: .dashboardProtectionAllowlistAdd, withAdditionalParameters: pixelParam) } contentBlockingManager.scheduleCompilation() - - privacyDashboardController.didStartRulesCompilation() - switch source { - case .menu: - Pixel.fire(pixel: state.isProtected ? .reportBrokenSiteProtectionEnabled : .reportBrokenSiteProtectionDisabled) - case .dashboard: - Pixel.fire(pixel: state.isProtected ? .privacyDashboardProtectionEnabled : .privacyDashboardProtectionDisabled) - } } private func privacyDashboardCloseHandler() {