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

For #10261: PWA Telemetry #11859

Merged

Conversation

eliserichards
Copy link

@eliserichards eliserichards commented Jun 23, 2020

For #10261
Depends on mozilla-mobile/android-components#7493 and mozilla-mobile/android-components#7805

Events in Fenix:

  • Event.ProgressiveWebAppOpenFromHomescreenTap -> map to HOMESCREEN_ICON_TAP
  • Event.ProgressiveWebAppForeground -> map to ENTER_FOREGROUND
  • Event.ProgressiveWebAppBackground -> map to ENTER_BACKGROUND
  • Event.ProgressiveWebAppInstallAsShortcut: An event ping when tapping the ‘Install’ menu. -> map to `ProgressiveWebAppFacts.Items.INSTALL_SHORTCUT
  • Distinguish between ‘Install’ PWA vs ‘Add to homescreen’ shortcut. There is no differentiation here ATM. In AC, we treat both as creating a shortcut and then map that to either the PWA or "bookmark" when it's opened. This install ping is added in AC instead of fenix (see below)

Events needing AC Facts:

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

After merge

  • Milestone: Make sure issues finished by this pull request are added to the milestone of the version currently in development.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

@eliserichards eliserichards changed the title Add PWA events to metrics. [WIP] 10261: PWA Telemetry Jun 23, 2020
@codecov-commenter
Copy link

codecov-commenter commented Jun 23, 2020

Codecov Report

Merging #11859 into master will decrease coverage by 0.08%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #11859      +/-   ##
============================================
- Coverage     28.43%   28.35%   -0.09%     
  Complexity     1033     1033              
============================================
  Files           418      418              
  Lines         16761    16826      +65     
  Branches       2180     2190      +10     
============================================
+ Hits           4766     4771       +5     
- Misses        11650    11710      +60     
  Partials        345      345              
Impacted Files Coverage Δ Complexity Δ
...a/org/mozilla/fenix/browser/BaseBrowserFragment.kt 0.00% <ø> (ø) 0.00 <0.00> (ø)
...java/org/mozilla/fenix/components/metrics/Event.kt 29.25% <0.00%> (-0.61%) 0.00 <0.00> (ø)
...la/fenix/components/metrics/GleanMetricsService.kt 12.02% <0.00%> (-0.24%) 4.00 <0.00> (ø)
...zilla/fenix/components/metrics/MetricController.kt 35.57% <0.00%> (-1.43%) 0.00 <0.00> (ø)
...lla/fenix/customtabs/ExternalAppBrowserFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...illa/fenix/shortcut/PwaOnboardingDialogFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...a/org/mozilla/gecko/search/SearchWidgetProvider.kt 24.00% <0.00%> (-9.34%) 1.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f5f8cc...566ef33. Read the comment docs.

app/metrics.yaml Outdated Show resolved Hide resolved
@eliserichards
Copy link
Author

Waiting on mozilla-mobile/android-components#7493 to be merged

@eliserichards eliserichards added the 🙅 waiting Issues that are blocked or has dependencies that are not ready label Jul 7, 2020
@liuche liuche removed the 🙅 waiting Issues that are blocked or has dependencies that are not ready label Jul 10, 2020
@eliserichards eliserichards changed the title [WIP] 10261: PWA Telemetry For #10261: PWA Telemetry Jul 20, 2020
@eliserichards eliserichards marked this pull request as ready for review July 20, 2020 22:07
@eliserichards eliserichards requested a review from NotWoods July 20, 2020 22:07
@eliserichards
Copy link
Author

Request for data collection review form

All questions are mandatory. You must receive review from a data steward peer on your responses to these questions before shipping new data collection.

  1. What questions will you answer with this data?
  • Do we make PWA sites easily discoverable?
  • How often users install a PWA on their phone’s homescreen?
  • How often do users run a PWA site in Fenix?
  1. Why does Mozilla need to answer these questions? Are there benefits for users? Do we need this information to address product or business requirements?
  • We would like to better understand the use of Progressive Web Apps to streamline the experience for users, and to ensure that the initial interaction with the app is useful and doesn't drive people away.
  1. What alternative methods did you consider to answer these questions? Why were they not sufficient?
  • There is not currently an alternative to measure this.
  1. Can current instrumentation answer these questions?
  • No, there are no currently metrics around web apps.
  1. List all proposed measurements and indicate the category of data collection for each measurement, using the Firefox data collection categories on the found on the Mozilla wiki.
  • All data is Category 2.
  1. How long will this data be collected?
  • Until 10/01/2020
  1. What populations will you measure?
  • All release, beta, and nightly users with telemetry enabled.
  1. Please provide a general description of how you will analyze this data.
  • Glean / Amplitude
  1. Where do you intend to share the results of your analysis?
  • Only on Glean, Amplitude and with mobile teams.

Copy link
Contributor

@NotWoods NotWoods left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should events also be added for when the actual PWA is in foreground?

app/metrics.yaml Show resolved Hide resolved
app/metrics.yaml Show resolved Hide resolved
Copy link
Contributor

@liuche liuche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data-review+ only, pending questions about the time ms collected - is that useful to DS?

Data Review Form (to be filled by Data Stewards)

  1. Is there or will there be documentation that describes the schema for the ultimate data set in a public, complete, and accurate way?

Yes, these probes are documented in metrics.md

  1. Is there a control mechanism that allows the user to turn the data collection on and off?

Yes, this telemetry is controlled by Fenix data settings

  1. If the request is for permanent data collection, is there someone who will monitor the data over time?
    Has expiry

  2. Using the category system of data types on the Mozilla wiki, what collection type of data do the requested measurements fall under?

Type 2, interaction with PWA

  1. Is the data collection request for default-on or default-off?

Default on

  1. Does the instrumentation include the addition of any new identifiers (whether anonymous or otherwise; e.g., username, random IDs, etc. See the appendix for more details)?

No

  1. Is the data collection covered by the existing Firefox privacy notice?

yes

  1. Does there need to be a check-in in the future to determine whether to renew the data? (Yes/No) (If yes, set a todo reminder or file a bug if appropriate)**

No, has expiry

  1. Does the data collection use a third-party collection tool? If yes, escalate to legal.

No

app/metrics.yaml Outdated Show resolved Hide resolved
app/metrics.yaml Outdated
extra_keys:
duration:
description: |
The current time in ms when the intent was foregrounded.
Copy link
Contributor

@liuche liuche Jul 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the idea that DS will do this calculation themselves? Can you verify with Marissa that that is the case, or if the client should calculate that duration between foreground/background when backgrounding the activity? Personally I'd prefer for the client to do this duration calculation and send that number, rather than sending 2 timestamps.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all done in AC and they don't want calculations like this to happen 😢

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we haven't defined what time we want between foreground/bg, so Marissa can change it as needed without needing a code fix

@eliserichards eliserichards dismissed NotWoods’s stale review July 28, 2020 16:20

Changes changes changes! Let's move everything to AC :j

@eliserichards eliserichards added the 🙅 waiting Issues that are blocked or has dependencies that are not ready label Jul 29, 2020
@eliserichards
Copy link
Author

AC changes didn't make it into 52.0.0, so this needs to wait to merge so it doesn't break when we cut for beta tonight

@boek boek removed the 🙅 waiting Issues that are blocked or has dependencies that are not ready label Jul 30, 2020
@ekager ekager added the pr:needs-landing PRs that are ready to land [Will be merged by Mergify] label Aug 2, 2020
Elise Richards added 4 commits August 3, 2020 11:06
Track events for add to homescreen and install.

Map PWA facts to events
Add events pings to fragments

Supress long method for events

Move install event to AC and collect facts

Retrieve fg and bg events from Facts. Do not track intent fg/bg events, only views
…nal app fragment. Track foreground and bg locally in fenix, and route install and home screen taps from AC facts
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr:needs-landing PRs that are ready to land [Will be merged by Mergify]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants