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

For #2267: Adds telemetry for reader mode #3941

Merged
merged 1 commit into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions app/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -900,4 +900,38 @@ history:
- https://github.com/mozilla-mobile/fenix/pull/3940
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
reader_mode:
available:
type: event
description: >
Reader mode is available for the current page
bugs:
- 2267
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/3941
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
opened:
type: event
description: >
A user opened reader mode
bugs:
- 2267
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/3941
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
appearance:
type: event
description: >
A user tapped the appearance button
bugs:
- 2267
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/3941
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ class BrowserFragment : Fragment(), BackHandler {
view.readerViewControlsBar
) {
getManagedEmitter<QuickActionChange>().apply {
if (it) {
requireComponents.analytics.metrics.track(Event.ReaderModeAvailable)
}

onNext(QuickActionChange.ReadableStateChange(it))
onNext(
QuickActionChange.ReaderActiveStateChange(
Expand Down Expand Up @@ -527,11 +531,12 @@ class BrowserFragment : Fragment(), BackHandler {
} else {
feature.showReaderView()
actionEmitter.onNext(QuickActionChange.ReaderActiveStateChange(true))
requireComponents.analytics.metrics.track(Event.ReaderModeOpened)
}
}
}
is QuickActionAction.ReadAppearancePressed -> {
// TODO telemetry: https://github.com/mozilla-mobile/fenix/issues/2267
requireComponents.analytics.metrics.track(Event.ReaderModeAppearanceOpened)
readerViewFeature.withFeature { feature ->
feature.showControls()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ sealed class Event {
object HistoryItemOpened : Event()
object HistoryItemRemoved : Event()
object HistoryAllItemsRemoved : Event()
object ReaderModeAvailable : Event()
object ReaderModeOpened : Event()
object ReaderModeAppearanceOpened : Event()

data class PreferenceToggled(val preferenceKey: String, val enabled: Boolean, val context: Context) : Event() {
private val switchPreferenceTelemetryAllowList = listOf(
Expand Down
40 changes: 39 additions & 1 deletion docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,6 @@ tracking_protection</td>
</table>
</pre>


## history

<pre>
Expand Down Expand Up @@ -762,6 +761,45 @@ tracking_protection</td>
</pre>


## reader_mode

<pre>
<table style="width: 100%">
<tr>
<th>key</th>
<th>type</th>
<th>description</th>
<th>data deview</th>
<th>extras</th>
<th>expires</th>
</tr>
<tr>
<td>available</td>
<td>event</td>
<td>Reader mode is available for the current page</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/3941">link</a></td>
<td></td>
<td>2020-03-01</td>
</tr>
<tr>
<td>opened</td>
<td>event</td>
<td>A user opened reader mode</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/3941">link</a></td>
<td></td>
<td>2020-03-01</td>
</tr>
<tr>
<td>appearance</td>
<td>event</td>
<td>A user tapped the appearance button</td>
<td><a href="https://github.com/mozilla-mobile/fenix/pull/3941">link</a></td>
<td></td>
<td>2020-03-01</td>
</tr>
</table>
</pre>

## Metrics

Items that are added to the metrics ping
Expand Down