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

For #17418 - Added telemetry for Google Default Top Site #17637

Conversation

codrut-topliceanu
Copy link
Contributor

Pull Request checklist

  • Tests: This PR doesn't include any tests as it is only a minor change
  • Screenshots: The code in this PR does not include any user facing features.
  • Accessibility: The code in this PR does not include any user facing features.

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
Copy link
Contributor Author

@lwa-moz I'm not entirely sure what to write in the data review form.

@lwa-moz
Copy link

lwa-moz commented Jan 26, 2021

@codrut-topliceanu this PR has a good example of a completed data collection review forms. I believe the form inputs in this case are almost identical to those listed in the linked PR.

@codecov-io
Copy link

codecov-io commented Jan 27, 2021

Codecov Report

Merging #17637 (bbe9251) into master (ffc89c5) will decrease coverage by 0.78%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #17637      +/-   ##
============================================
- Coverage     33.34%   32.56%   -0.79%     
+ Complexity     1345     1314      -31     
============================================
  Files           458      455       -3     
  Lines         19200    19091     -109     
  Branches       2685     2670      -15     
============================================
- Hits           6403     6217     -186     
- Misses        12265    12383     +118     
+ Partials        532      491      -41     
Impacted Files Coverage Δ Complexity Δ
...java/org/mozilla/fenix/components/metrics/Event.kt 33.85% <0.00%> (-1.12%) 0.00 <0.00> (ø)
...la/fenix/components/metrics/GleanMetricsService.kt 12.20% <0.00%> (+0.29%) 5.00 <0.00> (ø)
...ix/home/sessioncontrol/SessionControlController.kt 73.86% <0.00%> (-1.57%) 0.00 <0.00> (ø)
...la/fenix/customtabs/CustomTabToolbarIntegration.kt 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (-1.00%)
...lla/fenix/components/toolbar/BrowserToolbarView.kt 0.00% <0.00%> (-50.84%) 0.00% <0.00%> (-15.00%)
...g/mozilla/fenix/customtabs/CustomTabToolbarMenu.kt 32.32% <0.00%> (-44.45%) 3.00% <0.00%> (ø%)
...zilla/fenix/settings/sitepermissions/Extensions.kt 0.00% <0.00%> (-29.42%) 0.00% <0.00%> (ø%)
...enix/home/intent/OpenSpecificTabIntentProcessor.kt 56.25% <0.00%> (-18.75%) 3.00% <0.00%> (ø%)
...lla/fenix/components/toolbar/ToolbarIntegration.kt 0.00% <0.00%> (-15.56%) 0.00% <0.00%> (-1.00%)
...ava/org/mozilla/fenix/tabtray/TabTrayViewHolder.kt 46.07% <0.00%> (-12.68%) 13.00% <0.00%> (ø%)
... and 44 more

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 ffc89c5...9ba6ece. Read the comment docs.

if (url == SupportUtils.GOOGLE_XX_URL) {
metrics.track(Event.TopSiteOpenGoogleSearchAttribution)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there tests for the DefaultSessionControlController that we can add for this?

Copy link
Member

Choose a reason for hiding this comment

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

There should be

@eliserichards
Copy link
Contributor

eliserichards commented Jan 27, 2021

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?
  • This probe will be used to better model how the Top Sites location contributes to high-level trends in search. This will help us understand the revenue impact of our Top Sites with regards to Search.
  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 helps us understand our users' needs and the impact it has on our Search revenue and trends.

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

  • No current alternative methods.
  1. Can current instrumentation answer these questions?
  • Currently there are no events to track specifics for the Google top site.
  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.
  • All data is Category 2
  1. How long will this data be collected?
  • Until 2020-08-01 with the option to renew at that point.
  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.

app/metrics.yaml Outdated Show resolved Hide resolved
if (url == SupportUtils.GOOGLE_XX_URL) {
metrics.track(Event.TopSiteOpenGoogleSearchAttribution)
}
Copy link
Member

Choose a reason for hiding this comment

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

There should be

@gabrielluong
Copy link
Member

I have asked megan from DS to take a look in case we are missing anything that is needed for the search telemetries.

@st3fan
Copy link
Contributor

st3fan commented Jan 27, 2021

I added the pr:do-not-land label because I think this is not the correct telemetry to have. I think what we need instead is this one:

https://github.com/mozilla-mobile/fenix/blob/master/app/metrics.yaml#L903-L931

That metric will collect counts for engines and the source to identify how the search was initiated. We probbaly need to introduce a topsites source for this.

@gabrielluong gabrielluong self-assigned this Jan 28, 2021
Copy link
Contributor

@boek boek 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 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, metrics.yaml and metrics.md

  2. Is there a control mechanism that allows the user to turn the data collection on and off?
    Yes, data collection settings

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

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

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

  6. 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

  7. Is the data collection covered by the existing Firefox privacy notice? If unsure: escalate to legal if:
    Yes

  8. Does there need to be a check-in in the future to determine whether to renew the data?
    Fenix team will check-in at expiry

  9. Does the data collection use a third-party collection tool?
    No

@codrut-topliceanu
Copy link
Contributor Author

Thanks everyone for helping me with this patch. I really appreciate it. ❤️

@st3fan I have refactored my patch to use the search_count metric as requested. Please let me know if any other changes are needed.

@eliserichards eliserichards dismissed their stale review February 2, 2021 17:38

Addressed comments :)

@eliserichards eliserichards added needs:review PRs that need to be reviewed and removed needs:data-review PR is awaiting a data review labels Feb 2, 2021
Copy link
Member

@gabrielluong gabrielluong left a comment

Choose a reason for hiding this comment

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

Can we also add a test for this?

This is used to track if the `InContentTelemetry` is a result of the user using the Google Top Site. It looks for `&channel=ts` within the uri.
@st3fan st3fan requested a review from pocmo February 10, 2021 16:29
searchAccessPoint.let { sap ->
MetricsUtils.createSearchEvent(searchEngine, store, sap)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

At the end of the day this code searches the Google SearchEngine instance only, with the check above. Should we simplify this?

If we want to keep it generic for supporting more search engines in the future then:

  • Should we check resultUrls instead of suggestUrl since the latter one is the URL we query search suggestions from and doesn't have to be related to the search engine URL. The result URLs may be closer.
  • Should we also search in *.state.search.availableEngines? Otherwise you will not find a search engine if the user decided to hide it.
  • In appendSearchAttributionToUrlIfNeeded() we already change the URL to the one with the search attribution, so we already know the context, it seems complicated to then check this here again. 🤔 This would also allow us to directly lookup the search engine (e.g. Google) and not have to search for it here, I assume?

Copy link
Contributor

@st3fan st3fan Feb 10, 2021

Choose a reason for hiding this comment

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

Very much agreed on this. I filed #17956 for this work so that we can move this patch into production sooner without another round of changes. I sent out an email to explain my thoughts behind that.

Copy link
Contributor

@st3fan st3fan left a comment

Choose a reason for hiding this comment

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

Wonderful work - let's get it on Nightly 🤩

@gabrielluong gabrielluong merged commit d56b4a2 into mozilla-mobile:master Feb 11, 2021
@codrut-topliceanu
Copy link
Contributor Author

Thank you everyone who helped with this!! 🤗 You're all awesome!

st3fan pushed a commit that referenced this pull request Feb 16, 2021
* For #17418 - Adds channel "ts" to TrackKey

This is used to track if the `InContentTelemetry` is a result of the user using the Google Top Site. It looks for `&channel=ts` within the uri.

* For #17418 - Adds TopSite PerformedSearch back in

* For #17418 - Check now looks for equality with GOOGLE_URL

* For #17418 - Adds test for topSite changes
pkirakosyan pushed a commit to gexsi/user-agent-android that referenced this pull request Aug 4, 2021
mozilla-mobile#17637)

* For mozilla-mobile#17418 - Adds channel "ts" to TrackKey

This is used to track if the `InContentTelemetry` is a result of the user using the Google Top Site. It looks for `&channel=ts` within the uri.

* For mozilla-mobile#17418 - Adds TopSite PerformedSearch back in

* For mozilla-mobile#17418 - Check now looks for equality with GOOGLE_URL

* For mozilla-mobile#17418 - Adds test for topSite changes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature:Telemetry needs:review PRs that need to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants