1
0
Fork 0

For #4658: Add private browsing mode shortcut telemetry

master
Yeon Taek Jeong 2019-09-10 09:42:46 -07:00 committed by Jeff Boek
parent 418b1ba890
commit ddc1b2e648
7 changed files with 157 additions and 1 deletions

View File

@ -1243,6 +1243,74 @@ private_browsing_mode:
- fenix-core@mozilla.com
expires: "2020-03-01"
private_browsing_shortcut:
create_shortcut:
type: event
description: >
A user pressed the "Add private browsing shortcut" button in settings.
bugs:
- 4658
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/5194
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
cfr_add_shortcut:
type: event
description: >
A user pressed the "Add shortcut" button when the contextual feature recommender appeared.
bugs:
- 4658
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/5194
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
cfr_cancel:
type: event
description: >
A user pressed the "No thanks" button when the contextual feature recommender appeared.
bugs:
- 4658
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/5194
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
pinned_shortcut_priv:
type: event
description: >
A user pressed the pinned private shortcut in Android home screen, opening up a new private search.
bugs:
- 4658
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/5194
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
static_shortcut_tab:
type: event
description: >
A user pressed the long-press shortcut "Open new tab", opening up a new search.
bugs:
- 4658
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/5194
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
static_shortcut_priv:
type: event
description: >
A user pressed the long-press shortcut "Open new private tab", opening up a new private search.
bugs:
- 4658
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/5194
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
experiments.metrics:
active_experiment:
type: string

View File

@ -28,6 +28,7 @@ import org.mozilla.fenix.GleanMetrics.Library
import org.mozilla.fenix.GleanMetrics.Metrics
import org.mozilla.fenix.GleanMetrics.Pings
import org.mozilla.fenix.GleanMetrics.PrivateBrowsingMode
import org.mozilla.fenix.GleanMetrics.PrivateBrowsingShortcut
import org.mozilla.fenix.GleanMetrics.QrScanner
import org.mozilla.fenix.GleanMetrics.QuickActionSheet
import org.mozilla.fenix.GleanMetrics.ReaderMode
@ -336,6 +337,24 @@ private val Event.wrapper: EventWrapper<*>?
is Event.PrivateBrowsingNotificationDeleteAndOpenTapped -> EventWrapper<NoExtraKeys>(
{ PrivateBrowsingMode.notificationDelete.record(it) }
)
is Event.PrivateBrowsingCreateShortcut -> EventWrapper<NoExtraKeys>(
{ PrivateBrowsingShortcut.createShortcut.record(it) }
)
is Event.PrivateBrowsingAddShortcutCFR -> EventWrapper<NoExtraKeys>(
{ PrivateBrowsingShortcut.cfrAddShortcut.record(it) }
)
is Event.PrivateBrowsingCancelCFR -> EventWrapper<NoExtraKeys>(
{ PrivateBrowsingShortcut.cfrCancel.record(it) }
)
is Event.PrivateBrowsingPinnedShortcutPrivateTab -> EventWrapper<NoExtraKeys>(
{ PrivateBrowsingShortcut.pinnedShortcutPriv.record(it) }
)
is Event.PrivateBrowsingStaticShortcutTab -> EventWrapper<NoExtraKeys>(
{ PrivateBrowsingShortcut.staticShortcutTab.record(it) }
)
is Event.PrivateBrowsingStaticShortcutPrivateTab -> EventWrapper<NoExtraKeys>(
{ PrivateBrowsingShortcut.staticShortcutPriv.record(it) }
)
is Event.WhatsNewTapped -> EventWrapper(
{ Events.whatsNewTapped.record(it) },
{ Events.whatsNewTappedKeys.valueOf(it) }

View File

@ -103,6 +103,12 @@ sealed class Event {
object PrivateBrowsingNotificationTapped : Event()
object PrivateBrowsingNotificationOpenTapped : Event()
object PrivateBrowsingNotificationDeleteAndOpenTapped : Event()
object PrivateBrowsingCreateShortcut : Event()
object PrivateBrowsingAddShortcutCFR : Event()
object PrivateBrowsingCancelCFR : Event()
object PrivateBrowsingPinnedShortcutPrivateTab : Event()
object PrivateBrowsingStaticShortcutTab : Event()
object PrivateBrowsingStaticShortcutPrivateTab : Event()
// Interaction events with extras

View File

@ -583,12 +583,16 @@ class HomeFragment : Fragment(), AccountObserver {
)
layout.findViewById<Button>(R.id.cfr_pos_button).apply {
setOnClickListener {
context.metrics.track(Event.PrivateBrowsingAddShortcutCFR)
PrivateShortcutCreateManager.createPrivateShortcut(context)
trackingOnboarding.dismiss()
}
}
layout.findViewById<Button>(R.id.cfr_neg_button).apply {
setOnClickListener { trackingOnboarding.dismiss() }
setOnClickListener {
context.metrics.track(Event.PrivateBrowsingCancelCFR)
trackingOnboarding.dismiss()
}
}
// We want to show the popup only after privateBrowsingButton is available.
// Otherwise, we will encounter an activity token error.

View File

@ -25,6 +25,9 @@ class StartSearchIntentProcessor(
return if (event != null) {
when (event) {
SEARCH_WIDGET -> metrics.track(Event.SearchWidgetNewTabPressed)
STATIC_SHORTCUT_NEW_TAB -> metrics.track(Event.PrivateBrowsingStaticShortcutTab)
STATIC_SHORTCUT_NEW_PRIVATE_TAB -> metrics.track(Event.PrivateBrowsingStaticShortcutPrivateTab)
PRIVATE_BROWSING_PINNED_SHORTCUT -> metrics.track(Event.PrivateBrowsingPinnedShortcutPrivateTab)
}
out.removeExtra(HomeActivity.OPEN_TO_SEARCH)

View File

@ -57,6 +57,7 @@ import org.mozilla.fenix.components.PrivateShortcutCreateManager
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.getPreferenceKey
import org.mozilla.fenix.ext.metrics
import org.mozilla.fenix.ext.requireComponents
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.utils.ItsNotBrokenSnack
@ -157,6 +158,7 @@ class SettingsFragment : PreferenceFragmentCompat(), AccountObserver {
navigateToSitePermissions()
}
resources.getString(pref_key_add_private_browsing_shortcut) -> {
requireContext().metrics.track(Event.PrivateBrowsingCreateShortcut)
PrivateShortcutCreateManager.createPrivateShortcut(requireContext())
}
resources.getString(pref_key_accessibility) -> {

View File

@ -1174,3 +1174,57 @@ Data that is sent in the activation ping
</table>
</pre>
## private_browsing_shortcut
<pre>
<table style="width: 100%">
<tr>
<td>create_shortcut</td>
<td>event</td>
<td>A user pressed the "Add private browsing shortcut" button in settings.</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/5194">link</a></td>
<td></td>
<td>2020-03-01</td>
</tr>
<tr>
<td>cfr_add_shortcut</td>
<td>event</td>
<td>A user pressed the "Add shortcut" button when the contextual feature recommender appeared.</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/5194">link</a></td>
<td></td>
<td>2020-03-01</td>
</tr>
<tr>
<td>cfr_cancel</td>
<td>event</td>
<td>A user pressed the "No thanks" button when the contextual feature recommender appeared.</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/5194">link</a></td>
<td></td>
<td>2020-03-01</td>
</tr>
<tr>
<td>pinned_shortcut_priv</td>
<td>event</td>
<td>A user pressed the pinned private shortcut in Android home screen, opening up a new private search.</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/5194">link</a></td>
<td></td>
<td>2020-03-01</td>
</tr>
<tr>
<td>static_shortcut_tab</td>
<td>event</td>
<td>A user pressed the long-press shortcut "Open new tab", opening up a new search.</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/5194">link</a></td>
<td></td>
<td>2020-03-01</td>
</tr>
<tr>
<td>static_shortcut_priv</td>
<td>event</td>
<td>A user pressed the long-press shortcut "Open new private tab", opening up a new private search.</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/5194">link</a></td>
<td></td>
<td>2020-03-01</td>
</tr>
</table>
</pre>