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

MR2 telemetry: homescreen views #22146

Closed
7 tasks
eliserichards opened this issue Oct 25, 2021 · 3 comments
Closed
7 tasks

MR2 telemetry: homescreen views #22146

eliserichards opened this issue Oct 25, 2021 · 3 comments

Comments

@eliserichards
Copy link
Contributor

eliserichards commented Oct 25, 2021

Description & Product Manager / Data Scientist User Story

What questions will you answer with this data?

Implement a counter Metric that tells us the total number of times a user has seen the homescreen.

A user sees the homescreen when:

  • A user pressed the home button
  • A user is on a tab and clicks on the URL (home is inflated behind the search dialog)
  • A user has their settings selected to start on home (or start on home after four hours) and they open the app
  • ... (any more?)

Acceptance Criteria

  • ENG files a DS JIRA request outlining their methodology.
  • DS sign off on instrumentation methodology addressing product questions.
  • Event pings can be queried via re:dash
  • Event pings can be queried via amplitude
  • We are sending telemetry events for the actions listed in the requirements
  • We have documented the telemetry
  • We have asked a data steward to review the telemetry

┆Issue is synchronized with this Jira Task

@github-actions github-actions bot added the needs:triage Issue needs triage label Oct 25, 2021
@eliserichards eliserichards removed the needs:triage Issue needs triage label Oct 25, 2021
@MozillaNoah MozillaNoah self-assigned this Nov 5, 2021
@MozillaNoah MozillaNoah added this to the 96 milestone Nov 5, 2021
mergify bot added a commit that referenced this issue Nov 16, 2021
* For #22146 - Added counter for home screen views

* For #22146 - Added PR number to metrics

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
@MozillaNoah MozillaNoah added the eng:qa:needed QA Needed label Nov 16, 2021
@AndiAJ
Copy link
Collaborator

AndiAJ commented Nov 19, 2021

Hi @MozillaNoah I've just checked this matter on Nightly build 96.0a1 from 11/19 using a Google Pixel 3a (Android 11)

Should the home_screen_view_count counter go hand in hand with "name": "home_screen_displayed" generated in the event type pings ?

In my run the home screen was displayed 3x (can check the logcat for the entire run)
On the other hand, the counter from the metrics ping counted 4

Logcat
Glean dashboard

Please review and share your thoughts
I'll remove the qa needed label until further notice

@AndiAJ AndiAJ removed the eng:qa:needed QA Needed label Nov 19, 2021
@MozillaNoah
Copy link
Contributor

MozillaNoah commented Nov 19, 2021

Hi @AndiAJ, home_screen_view_count should go hand-in-hand with "name": "home_screen_displayed" as they're reported in the code at the same time. It'd be really strange if they were out of sync.

Edit: I've spent a little more time trying to reproduce this, but from a code and code logging perspective, this is working correctly (one view count increment for every "home_screen_displayed" event). I'm currently unsure how to get the Glean event JSON to show in logcat to be able to double-check from that angle.

@AndiAJ
Copy link
Collaborator

AndiAJ commented Nov 29, 2021

Hi @MozillaNoah , verified as fixed on the latest Nightly 96.0a1 from 11/29 using a Google Pixel3 a (Android 11)
I overlooked something the first time I've checked this matter, sorry if any inconvenience created ☺️

✅ The home screen was displayed 2x (dropdown)

Event type ping - 0e5c1290-8a61-4440-abf2-f65e5b4c29a3

      "events": [
        {
          "timestamp": 0,
          "category": "home_screen",
          "name": "home_screen_displayed"
        },

Event type ping - 3e379b56-1391-47c9-beb4-960b43e84b56

  "events": [
        {
          "timestamp": 0,
          "category": "home_screen",
          "name": "home_screen_displayed"
        },

Metrics ping - aacda436-b36c-47ac-b6b6-79e12c203546
"home_screen.home_screen_view_count": 2,

✅ The home screen was displayed 6x (dropdown)

Event type ping - 3551ecb8-2bde-47b1-a0b7-14ad0fc7354f

        {
          "timestamp": 57870,
          "category": "home_screen",
          "name": "home_screen_displayed"
        },

Event type ping - 86696f4e-d7dd-446c-ae66-37e01adad7b3

        {
          "timestamp": 1284,
          "category": "home_screen",
          "name": "home_screen_displayed"
        },

Event type ping - a5f115df-6384-43a5-a49a-308e7914995c

        {
          "timestamp": 1518,
          "category": "home_screen",
          "name": "home_screen_displayed"
        },

Event type ping - 0bac0741-c44c-4d2e-b129-ba400f739400

        {
          "timestamp": 1459,
          "category": "home_screen",
          "name": "home_screen_displayed"
        },

Event type ping - 5c45c7ac-9f42-465b-a773-0ed5c49f9f95

        {
          "timestamp": 1346,
          "category": "home_screen",
          "name": "home_screen_displayed"
        },

Event type ping - 11a0db9f-09fc-4dad-b25c-526842e70347

      "events": [
        {
          "timestamp": 0,
          "category": "home_screen",
          "name": "home_screen_displayed"
        },

Metrics ping - b2e216cd-eb4e-403b-88d6-065e8f0a618e

        "counter": {
          "home_screen.home_screen_view_count": 6,

Logcat
Glean dashboard

You can use this cmd adb shell am start -n org.mozilla.fenix/mozilla.telemetry.glean.debug.GleanDebugActivity --ez logPings true --es debugViewTag AndiAJ (change to whatever you want the debugViewTag) to seen the pings get generated in both Android Studio's Logcat and on the Glean dashboard

The debugViewTag you'll use will help identify your run on the Glean dashboard.

To generate the event type pings:

  1. Perform the desired action
  2. Put Fenix in background

Each time you'll put Fenix in background the event type pings along with the baseline pings will be generated

The metrics ping is generated only once in 24h at 04:00AM local time
To generate the metrics pings:

  1. Force stop Fenix
  2. Set the date to D+1 (tomorrow)
  3. Set the time to 03:59 AM
  4. Launch Fenix using the cmd
  5. Wait and at 04:00 AM the metrics ping will be generated (You'll be able to see the metrics ping only if Fenix is in foreground)

If you want to see the pings get generate right away I would suggest checking the logcat (there's a slight delay on the Glean dashboard)

@AndiAJ AndiAJ closed this as completed Nov 29, 2021
@AndiAJ AndiAJ added the eng:qa:verified QA Verified label Nov 29, 2021
pkirakosyan pushed a commit to gexsi/user-agent-android that referenced this issue Mar 7, 2022
* For mozilla-mobile#22146 - Added counter for home screen views

* For mozilla-mobile#22146 - Added PR number to metrics

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants