Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation of P3A (Privacy-Preserving Product Analytics) #3242

Merged
merged 75 commits into from
Oct 2, 2019

Conversation

bsclifton
Copy link
Member

@bsclifton bsclifton commented Aug 22, 2019

Fixes brave/brave-browser#6285

More details on our blog here:
https://brave.com/privacy-preserving-product-analytics-p3a/

Detailed list of the questions here:
https://github.com/brave/brave-browser/wiki/P3A

Quick description

This pull request will implement checks for those answers and (if enabled) will send the answers anonymously (see blog post for more details).

The answers are always collected, whether the service is on or off. They are stored as a local_state variable (ex: not part of the profile, not synced, etc). However, the answers only leave the users machine if they have the preference enabled.

New user experience

  • Welcome screen is shown at first launch
  • Users are notified about P3A in the welcome experience
    image

Existing user experience

  • Existing users will be shown an info bar upon launch
  • It remains until acknowledged (even after relaunching)
  • Users can click Disable and it will immediately disable the service and close the infobar
  • Hitting Got it or clicking the X will acknowledge this and close the infobar
  • Clicking Learn more will go to the blog post

Screen Shot 2019-08-22 at 4 23 31 PM

Submitter Checklist:

Test Plan:

There is a bunch of command-line switches suitable to simplify the testing process (see https://github.com/brave/brave-core/blob/master/components/p3a/brave_p3a_switches.h), as well as detailed logs enabled as follows --vmodule=*/p3a/*=3 --enable-logging=stderr

The possible command-line for testing might look as follows:
brave --vmodule=*/p3a/*=3 --enable-logging=stderr --p3a-upload-interval-seconds=5 --p3a-rotation-interval-seconds=160 --p3a-upload-server-url="http://127.0.0.1/" --p3a-ignore-server-errors --p3a-do-not-randomize-upload-interval

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@bsclifton bsclifton added CI/skip Do not run CI builds (except noplatform) and removed CI/skip Do not run CI builds (except noplatform) labels Aug 29, 2019
jsecretan
jsecretan previously approved these changes Aug 29, 2019
@bradleyrichter
Copy link
Contributor

@bsclifton here is the final text in a screen shot

image

@bradleyrichter
Copy link
Contributor

text:

Brave Shields blocks the creepy stuff that tries to track you across the web — including most ads. Set Shields to “down” if a site doesn’t seem to be working. Brave uses completely private product analytics to estimate the overall usage of certain features. You can turn this off in Settings.

@bsclifton
Copy link
Member Author

Ready for re-review 😄

@bsclifton
Copy link
Member Author

bsclifton commented Oct 2, 2019

Reviewing the CI for the last run:

Going to restart it here...

@bsclifton bsclifton added CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS labels Oct 2, 2019
@bsclifton
Copy link
Member Author

I pulled down the code locally and was able to reproduce the unit tests failing ☹️

@iefremov can you check this out?

@bsclifton
Copy link
Member Author

UPDATE: Linux and macOS passed great 🎉 Seems CI on Windows isn't running?

@bsclifton bsclifton added CI/skip-linux CI/skip-macos-x64 Do not run CI builds for macOS x64 labels Oct 2, 2019
@bsclifton bsclifton added this to the 0.72.x - Nightly milestone Oct 2, 2019
@bsclifton bsclifton merged commit cbfc3c2 into master Oct 2, 2019
@bsclifton bsclifton deleted the p3a branch October 2, 2019 18:39
fmarier pushed a commit that referenced this pull request Oct 29, 2019
bsclifton added a commit that referenced this pull request Dec 9, 2019
… is in sync

For example, if you had two windows with brave://settings/privacy open

Fixes brave/brave-browser#7289

This is something I missed while implementing #3242
petemill pushed a commit that referenced this pull request Jul 27, 2020
petemill pushed a commit that referenced this pull request Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS CI/skip-macos-x64 Do not run CI builds for macOS x64
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Privacy Preserving Product Analytics (P3A)