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

For #21732 - Adds inactive tabs survey on disable #21862

Merged

Conversation

codrut-topliceanu
Copy link
Contributor

For #21732

Pull Request checklist

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

@codrut-topliceanu codrut-topliceanu requested review from a team as code owners October 12, 2021 10:51
@codrut-topliceanu
Copy link
Contributor Author

codrut-topliceanu commented Oct 12, 2021

Request for data collection review

  1. What questions will you answer with this data?
  • Why users turn of inactive tabs.
  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?

  • This data will help understand the usefulness of the feature.
  1. What alternative methods did you consider to answer these questions? Why were they not sufficient?

  • N/A
  1. Can current instrumentation answer these questions?

  • No
  1. List all proposed measurements and indicate the category of data collection for each measurement, using the Firefox data collection categories found on the Mozilla wiki.
Measurement Description Data Collection Category Tracking Bug #
Event: User selected a feedback option Category 2 “Interaction data” ?
  1. Please provide a link to the documentation for this data collection which describes the ultimate data set in a public, complete, and accurate way.
  1. How long will this data be collected? Choose one of the following:

  • For now the probes are set to expire in 2022-02-01
  1. What populations will you measure?

  • All users on all release channels
  1. If this data collection is default on, what is the opt-out mechanism for users?

  • Default Glean SDK opt-out mechanism.
  1. Please provide a general description of how you will analyze this data.

  • Redash / GLAM
  1. Where do you intend to share the results of your analysis?

  • Internal with mobile team(s)
  1. Is there a third-party tool (i.e. not Telemetry) that you are proposing to use for this data collection?
  • No

@codrut-topliceanu codrut-topliceanu added needs:data-review PR is awaiting a data review needs:review PRs that need to be reviewed labels Oct 12, 2021

// Sets the Radio buttons' text
radioButtonsMap.forEach {
inactiveTabsSurveyBinding.surveyGroup.findViewById<RadioButton>(it.key)?.text =
Copy link
Contributor

Choose a reason for hiding this comment

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

why set the text here instead of in the XML?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I needed to send the user's selected feedback back through Glean.

  • I couldn't use the actual text on screen as that is dependent on the user's language setting. So no radioButton.text can be used to get the selected feedback.
  • I don't know how to get the StringID from a view.
  • So I decided to use a map of the StringIDs so that onSEND I can easily get the English text to add to the Glean event.
  • But how do I know which StringID correlates to which Radio button? Yeah I know their order and @ids but that's a rename/refactor away from being broken.
  • So I wanted a tighter coupling between ViewIDs and StringIDs and went with the mapOf<ViewID, StringID>.
  • Now if someone wants to change the string resource of one of the RadioButtons they won't just change in the XML and forget about the .kt file, they will be forced to changed in the .kt file. 😅

Not sure if it's the best solution but 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

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

So I wanted a tighter coupling between ViewIDs and StringIDs and went with the mapOf<ViewID, StringID>.

One thing about this approach is if we change the string, the data in the telemetry will show a divergence of options.

Example: The string "I don't understand how it works" changes to "I don't know it works" will mean we start to get two results from the one option.

We could map the options to an internal value that we submit to telemetry (which defeats the problem you were trying to solve). 😕

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suppose that if we ever want to change the strings we should change the Event as well.
Otherwise it will be like running a survey on the street and halfway through you change the answer choices.

Copy link
Contributor

Choose a reason for hiding this comment

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

@MozillaNoah @jonalmeida I plan to finish this after Codrut left so I'm just wondering if I should keep the currently proposed implementation (which I also favor, kinda like having it all in one place, easier to follow) or should I add the string values in xml and then read the text of the selected radio button - infer this in place, don't use the map.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have strong feelings for either solution. 🙂

@travis79
Copy link
Member

Request for data collection review

1. What questions will you answer with this data?


* Why users turn of inactive tabs.


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?


* This data will help understand the usefulness of the feature.


1. What alternative methods did you consider to answer these questions? Why were they not sufficient?


* N/A


1. Can current instrumentation answer these questions?


* No


1. List all proposed measurements and indicate the category of data collection for each measurement, using the Firefox data collection categories found on the Mozilla wiki.

Measurement Description Data Collection Category Tracking Bug #
Event: User selected a feedback option Category 2 “Interaction data” ?

1. Please provide a link to the documentation for this data collection which describes the ultimate data set in a public, complete, and accurate way.


* [dictionary.telemetry.mozilla.org/apps/fenix](https://dictionary.telemetry.mozilla.org/apps/fenix)


1. How long will this data be collected? Choose one of the following:


* For now the probes are set to expire in 2022-02-01


1. What populations will you measure?


* All users on all release channels


1. If this data collection is default on, what is the opt-out mechanism for users?


* Default Glean SDK opt-out mechanism.


1. Please provide a general description of how you will analyze this data.


* Redash / GLAM


1. Where do you intend to share the results of your analysis?


* Internal with mobile team(s)


1. Is there a third-party tool (i.e. not Telemetry) that you are proposing to use for this data collection?


* No

Data Review

  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, through the metrics.yaml and the Glean Dictionary

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

Yes, through the "Send Usage Data" preference in the application settings

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

N/A, collection set to end or be renewed by 2022-02-01

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

Category 2, Interaction data

  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 the data collection use a third-party collection tool?

No

Result

data-review+

Copy link
Member

@travis79 travis79 left a comment

Choose a reason for hiding this comment

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

Please be sure and update the data_sensitivity in the metrics.yaml, as well as the bugs and data_reviews to point at this PR. Thanks!

data-review+

Comment on lines +1659 to +1692
extra_keys:
feedback:
description: |
The user's feedback regarding inactive tabs feature.
Copy link
Member

Choose a reason for hiding this comment

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

I recommend adding a type, following the example from the Glean docs here:
https://mozilla.github.io/glean/book/reference/metrics/event.html#extra_keys

I will also caution you that the limitation for this extra will truncate the value at 100 UTF8 characters.

Copy link
Contributor

Choose a reason for hiding this comment

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

Added type: string for the extra key.

Currently 100 characters is more than enough but I'll also leave a comment in code about this for the future, thank you!

Copy link
Contributor

Choose a reason for hiding this comment

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

About the type for the extra key:
Seems like with this change the generated code for the extra keys will have them as properties of a data class:

    data class TurnOffInactiveTabsSurveyExtra(
        val feedback: String? = null
    ) : EventExtras {
        override fun toFfiExtra(): Pair<IntArray, List<String>> {
            val keys = mutableListOf<Int>()
            val values = mutableListOf<String>()

            this.feedback?.let {
                keys.add(0)
                values.add(it.toString())
            }
            return Pair(IntArray(keys.size, { keys[it] }), values)
        }
    }

type which is incompatible with what our code expects when parsing the extras - a map.

So atm it would probably be easier to just go with the old way of setting extras - without a type.
Seems like migrating to use the new APIs is planned for #19967

@Mugurell Mugurell removed the needs:data-review PR is awaiting a data review label Oct 20, 2021
@mergify
Copy link
Contributor

mergify bot commented Oct 20, 2021

This pull request has conflicts when rebasing. Could you fix it @codrut-topliceanu? 🙏

@Mugurell Mugurell force-pushed the 21732_inactive_tabs_survey branch from 6b133da to acaa1a4 Compare October 21, 2021 16:48
@Mugurell
Copy link
Contributor

Talked with Kimmy about these changes since there wasn't a DO ticket filed.
She confirmed the telemetry looks good.

@Mugurell Mugurell force-pushed the 21732_inactive_tabs_survey branch from acaa1a4 to 22b8548 Compare October 21, 2021 16:50
@Mugurell
Copy link
Contributor

Mugurell commented Oct 21, 2021

Rebased and did some small updates to the original PR:

  • To ensure we have stable data regarding the number of finished surveys when the user clicks the close button we will be sending the value none as the survey chosen option.
  • To prevent user starting the survey then going back from the screen and having the feature disabled without completing the survey the feature will not be disabled automatically when the user taps the switch. Only when the user expressly dismisses the survey by pressing the close button or selects a survey option to send.
  • Previously the user could not select an option but press send in which case the survey will close just to reappear the next time the user enables and disabled the feature again. Now the user must select an option for the send button to close the survey.

@Mugurell
Copy link
Contributor

Sorry for asking for a re-review Travis. Not intended. I see the PR still has your approval.

@Mugurell Mugurell force-pushed the 21732_inactive_tabs_survey branch from 22b8548 to 7d99b6d Compare October 22, 2021 12:09
@Mugurell
Copy link
Contributor

Kimmy asked to add a new probe for when the survey shows up.

@Mugurell
Copy link
Contributor

Request for data collection review

  1. What questions will you answer with this data?
  • When the survey asking users why they intent to disable the inactive tabs feature shows up.
  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?

  • This data will help understand the usefulness of the feature.
  1. What alternative methods did you consider to answer these questions? Why were they not sufficient?

  • N/A
  1. Can current instrumentation answer these questions?

  • No
  1. List all proposed measurements and indicate the category of data collection for each measurement, using the Firefox data collection categories found on the Mozilla wiki.
Measurement Description Data Collection Category Tracking Bug #
Event: When the survey for why the inactive tabs feature is disabled shows up Category 2 - “Interaction data” #21732
  1. Please provide a link to the documentation for this data collection which describes the ultimate data set in a public, complete, and accurate way.
  1. How long will this data be collected? Choose one of the following:

  • For now the probes are set to expire in 2022-02-01
  1. What populations will you measure?

  • All users on all release channels
  1. If this data collection is default on, what is the opt-out mechanism for users?

  • Default Glean SDK opt-out mechanism.
  1. Please provide a general description of how you will analyze this data.

  • Redash / GLAM
  1. Where do you intend to share the results of your analysis?

  • Internal with mobile team(s)
  1. Is there a third-party tool (i.e. not Telemetry) that you are proposing to use for this data collection?
  • No

@Mugurell
Copy link
Contributor

@travis79 It seems like there really is need for data-review again.

@Mugurell Mugurell added the needs:data-review PR is awaiting a data review label Oct 22, 2021
@travis79
Copy link
Member

Request for data collection review

1. What questions will you answer with this data?


* When the survey asking users why they intent to disable the inactive tabs feature shows up.


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?


* This data will help understand the usefulness of the feature.


1. What alternative methods did you consider to answer these questions? Why were they not sufficient?


* N/A


1. Can current instrumentation answer these questions?


* No


1. List all proposed measurements and indicate the category of data collection for each measurement, using the Firefox data collection categories found on the Mozilla wiki.

Measurement Description Data Collection Category Tracking Bug #
Event: When the survey for why the inactive tabs feature is disabled shows up Category 2 - “Interaction data” #21732

1. Please provide a link to the documentation for this data collection which describes the ultimate data set in a public, complete, and accurate way.


* [dictionary.telemetry.mozilla.org/apps/fenix](https://dictionary.telemetry.mozilla.org/apps/fenix)


1. How long will this data be collected? Choose one of the following:


* For now the probes are set to expire in 2022-02-01


1. What populations will you measure?


* All users on all release channels


1. If this data collection is default on, what is the opt-out mechanism for users?


* Default Glean SDK opt-out mechanism.


1. Please provide a general description of how you will analyze this data.


* Redash / GLAM


1. Where do you intend to share the results of your analysis?


* Internal with mobile team(s)


1. Is there a third-party tool (i.e. not Telemetry) that you are proposing to use for this data collection?


* No

Data Review

  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, through the metrics.yaml and the Glean Dictionary

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

Yes, through the "Send Usage Data" preference in the application settings

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

N/A, collection set to end or be renewed by 2022-02-01

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

Category 2, Interaction data

  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 the data collection use a third-party collection tool?

No

Result

data-review+

Copy link
Member

@travis79 travis79 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+ for adding the event

@travis79 travis79 removed the needs:data-review PR is awaiting a data review label Oct 22, 2021
@Mugurell Mugurell force-pushed the 21732_inactive_tabs_survey branch from 7d99b6d to 86a508a Compare October 22, 2021 13:23
@jonalmeida jonalmeida removed the needs:review PRs that need to be reviewed label Oct 26, 2021
@jonalmeida jonalmeida added the pr:needs-landing PRs that are ready to land [Will be merged by Mergify] label Oct 26, 2021
@Mugurell
Copy link
Contributor

Seemingly unrelated ui test failures.
Restarting CI.

@Mugurell Mugurell closed this Oct 26, 2021
@Mugurell Mugurell reopened this Oct 26, 2021
@mergify mergify bot merged commit bba787e into mozilla-mobile:main Oct 26, 2021
@Mugurell
Copy link
Contributor

@Mergifyio backport releases_v94.0.0

@mergify
Copy link
Contributor

mergify bot commented Oct 26, 2021

backport releases_v94.0.0

✅ Backports have been created

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.

5 participants