Skip to content

Commit

Permalink
Add pixel when the error page is shown (#3487)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1176956903599313/1208602127384124/f

**Description**:
Fire a pixel when we show the error page in the WebView.
  • Loading branch information
alessandroboron authored Oct 25, 2024
1 parent 0fbd933 commit 2d09cb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,9 @@ extension Pixel {
case duckplayerExperimentDailySearch
case duckplayerExperimentWeeklySearch
case duckplayerExperimentYoutubePageView

// MARK: WebView Error Page Shown
case webViewErrorPageShown
}

}
Expand Down Expand Up @@ -1649,6 +1652,8 @@ extension Pixel.Event {
case .duckplayerExperimentWeeklySearch: return "duckplayer_experiment_weekly_search_v2"
case .duckplayerExperimentYoutubePageView: return "duckplayer_experiment_youtube_page_view_v2"

// MARK: - WebView Error Page shown
case .webViewErrorPageShown: return "m_errorpageshown"
}
}
}
Expand Down
1 change: 1 addition & 0 deletions DuckDuckGo/TabViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2063,6 +2063,7 @@ extension TabViewController: WKNavigationDelegate {
if !(error.failedUrl?.isCustomURLScheme() ?? false) {
url = error.failedUrl
showError(message: error.localizedDescription)
Pixel.fire(pixel: .webViewErrorPageShown)
}

webpageDidFailToLoad()
Expand Down

0 comments on commit 2d09cb7

Please sign in to comment.