- Notifications
You must be signed in to change notification settings - Fork 1.1k
Bookmark import flow observability #7007
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
Bookmark import flow observability #7007
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
53a9493 to 4b6121a Compare | return when (seconds) { | ||
| in 0..19 -> "20" | ||
| in 20..39 -> "40" | ||
| in 40..59 -> "60" | ||
| in 60..89 -> "90" | ||
| in 90..119 -> "120" | ||
| in 120..149 -> "150" | ||
| in 150..179 -> "180" | ||
| in 180..239 -> "240" | ||
| in 240..299 -> "300" | ||
| else -> "longer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the bucket values indicates the time it was completed within. e.g., 20 means it completed in less than 20s. 60 means it completed in less than 60s and so on.
| | ||
| val chromeHtmlFiles = mutableListOf<String>() | ||
| | ||
| // First pass: collect Chrome HTML files and look for Bookmarks.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update this so that it doesn't return early upon finding an exact match on the Takeout/Chrome/Bookmarks.html file since if there are more files in there, it is pixelled
...kduckgo/autofill/impl/importing/takeout/webflow/ImportGoogleBookmarksWebFlowViewModelTest.kt Show resolved Hide resolved
4b6121a to 214e816 Compare There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive pixel tracking for the Google bookmarks import flow to measure user engagement and diagnose issues. The implementation tracks the full import journey from dialog interactions through flow completion or errors.
- Adds pixel tracking for pre-import dialog events (shown, dismissed, user actions)
- Implements journey tracking with duration bucketing for flow performance metrics
- Adds pixel for detecting multiple Chrome export files in Google Takeout
- Refactors error handling to include step information for better debugging
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ImportFromGoogleBookmarksPreImportDialog.kt | Added pixel tracking for dialog shown/dismissed and user action events; removed onCreate lifecycle override |
| SavedSitesPixelName.kt | Added 4 new pixel names for pre-import dialog tracking and configured ATB parameter removal |
| AutofillPixelNames.kt | Added 5 new pixel names for flow journey tracking (started, success, error, cancelled, extra Chrome export) |
| ImportGoogleBookmarksJourney.kt | New file implementing journey tracking with duration measurement and pixel firing |
| ImportGoogleBookmarksDurationBucketing.kt | New file implementing time bucketing logic for duration metrics |
| TakeoutBookmarkExtractor.kt | Refactored extraction logic to detect multiple Chrome files and fire pixel; improved code structure |
| ImportGoogleBookmarksWebFlowActivity.kt | Changed launch parameter from data object to data class with launchSource; integrated journey tracking |
| ImportGoogleBookmarkResult.kt | Changed WebViewError from data object to data class to include step information |
| ImportGoogleBookmarksWebFlowViewModel.kt | Added onFatalWebViewError method to handle WebView errors with step tracking |
| ImportGoogleBookmarksWebFlowFragment.kt | Updated to use new ViewModel method for WebView errors; removed unused error mapping function |
| ImportFromGoogleImpl.kt | Added getLaunchSource method to provide source for journey tracking |
| RealImportGoogleBookmarksJourneyTest.kt | New comprehensive test file for journey tracking functionality |
| RealImportGoogleBookmarksDurationBucketingTest.kt | New test file for duration bucketing logic |
| ImportGoogleBookmarksWebFlowViewModelTest.kt | Added test for WebView error handling; reformatted existing tests |
| TakeoutZipBookmarkExtractorTest.kt | Added tests for multiple Chrome file detection and pixel firing |
| ImportFromGoogleImplTest.kt | Updated mock setup to match new data class parameter type |
...in/java/com/duckduckgo/savedsites/impl/importing/ImportFromGoogleBookmarksPreImportDialog.kt Show resolved Hide resolved
...m/duckduckgo/autofill/impl/importing/takeout/webflow/ImportGoogleBookmarksWebFlowActivity.kt Show resolved Hide resolved
...l/autofill-impl/src/main/java/com/duckduckgo/autofill/impl/importing/ImportFromGoogleImpl.kt Show resolved Hide resolved
...m/duckduckgo/autofill/impl/importing/takeout/webflow/ImportGoogleBookmarksWebFlowActivity.kt Show resolved Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good! Tested and works as described.
Merge activity
|

Task/Issue URL: https://app.asana.com/1/137249556945/project/488551667048375/task/1211724585727142?focus=true
Description
Adds observability around bookmark import flow and pre-import dialog.
Steps to test this PR
Logcat filter:
package:mine message~:"Bookmark-import: |Pixel sent: bookmark_import_from_google"Import flow (success)
Saved Site Dev SettingsLaunch Google Takeout import flowbookmark_import_from_google_flow_startedin the logs, params should match specbookmark_import_from_google_flow_success, params should match spec (e.g., correct duration buckets)Import flow (cancellation)
bookmark_import_from_google_flow_cancelledin the logs and it includes thestepReachedalongside durations.Import flow (simulate error)
bookmark_import_from_google_flow_erroranderrorReasonstarts withwebView-then has the step. (e.g.,webView-takeout-first)Pre-import dialogs
Import(from empty state or overflow; doesn't matter)bookmark_import_from_google_dialog_shownappearsbookmark_import_from_google_dialog_dismissedappearsSelect Bookmarks File; verifybookmark_import_from_google_dialog_fromfileappeasImport From Googlebutton and verifybookmark_import_from_google_dialog_startflowPatch to force a crash during import