Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #3174: Adds telemetry for bookmarks (#3724)
Browse files Browse the repository at this point in the history
  • Loading branch information
sblatz authored Jul 2, 2019
1 parent ece0e30 commit dbe29eb
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
11 changes: 11 additions & 0 deletions app/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,17 @@ bookmarks_management:
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
folder_remove:
type: event
description: >
A user removed a bookmark folder.
bugs:
- 3174
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/3724
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"

custom_tab:
closed:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ private val Event.wrapper
is Event.AddBookmarkFolder -> EventWrapper<NoExtraKeys>(
{ BookmarksManagement.folderAdd.record(it) }
)
is Event.RemoveBookmarkFolder -> EventWrapper<NoExtraKeys>(
{ BookmarksManagement.folderRemove.record(it) }
)
is Event.CustomTabsMenuOpened -> EventWrapper<NoExtraKeys>(
{ CustomTab.menu.record(it) }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ sealed class Event {
object ShareBookmark : Event()
object CopyBookmark : Event()
object AddBookmarkFolder : Event()
object RemoveBookmarkFolder : Event()
object RemoveBookmarks : Event()
object QuickActionSheetOpened : Event()
object QuickActionSheetClosed : Event()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,11 @@ class BookmarkFragment : Fragment(), BackHandler, AccountObserver {

val deleteOperation: (suspend () -> Unit) = {
bookmarkStorage?.deleteNode(bookmarkNode.guid)
metrics()?.track(Event.RemoveBookmark)
when (bookmarkNode.type) {
BookmarkNodeType.FOLDER -> metrics()?.track(Event.RemoveBookmarkFolder)
BookmarkNodeType.ITEM -> metrics()?.track(Event.RemoveBookmark)
else -> { }
}
pendingBookmarkDeletionJob = null
refreshBookmarks()
}
Expand Down
11 changes: 10 additions & 1 deletion docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,15 @@ tracking_protection</td>
<td></td>
<td>2020-03-01</td>
</tr>

<tr>
<td>folder_remove</td>
<td>event</td>
<td>A user removed a bookmark folder.</td>
<td> <a href="https://github.com/mozilla-mobile/fenix/pull/3724">link</a></td>
<td></td>
<td>2020-03-01</td>
</tr>
</table>
</pre>

Expand Down Expand Up @@ -821,4 +830,4 @@ Data that is sent in the activation ping
<td>2019-10-01</td>
</tr>
</table>
</pre>
</pre>

0 comments on commit dbe29eb

Please sign in to comment.