add google analytics to flutter_tools#3523
Conversation
Do you mean "multi-arg commands" like Also, thanks!! This is great :) |
| printStatus( | ||
| 'The Flutter tool anonymously reports feature usage statistics and basic crash reports to improve\n' | ||
| 'the tool over time; use "flutter config" to control this behavior. See our privacy policy:\n' | ||
| 'https://www.google.com/intl/en/policies/privacy/.\n' |
There was a problem hiding this comment.
It's there to complete the sentence :)
|
I think it is critical that we add a test that verifies that if you turn off analytics, we don't send any analytics. |
| _ga.sendException(message); | ||
| } | ||
|
|
||
| Future<Null> waitForLastPing() { |
There was a problem hiding this comment.
this name is confusing. I know it's just the same as the underlying API's, but I think we should name it something clearer.
There was a problem hiding this comment.
ensureAnalyticsSent()?
|
LGTM if, and only if, we have a test that verifies that once you opt-out, we don't send analytics. Ideally this would test the following scenarios:
|
|
Also, please update our docs so that when they introduce the flutter tool, they mention how to opt-out. |
| // Check if this is the first run. If so, enable analytics. We show opt-out | ||
| // methods (flutter config) the first time the tool is run. | ||
| if (!_ga.hasSetOptIn) { | ||
| _isFirstRun = true; |
There was a problem hiding this comment.
can we avoid sending analytics on the run where we give the opt-out information?
There was a problem hiding this comment.
Yup; I'll update to not track the config command.
There was a problem hiding this comment.
I meant on the first run. The one where we say how to opt-out. But yeah, not tracking the config command seems like an excellent idea also!
No, I meant things like |
|
I'll add some tests and update the PR. We store the opt-out data in |
|
(I'm going to rev. the |
|
@Hixie, this PR has been updated quite a bit since the first review. It doesn't send any analytics at first; it doesn't send any analytics for the |
| printStatus( | ||
| 'The Flutter tool anonymously reports feature usage statistics and basic crash reports to Google to\n' | ||
| 'help Google contribute improvements to Flutter over time. Use "flutter config" to control this\n' | ||
| 'behavior. See Google\'s privacy policy: https://www.google.com/intl/en/policies/privacy/.\n' |
This adds support for sending anonymous usage data for flutter_tools to google analytics. It:
flutter configcommand, where analytics can be enabled and disabledWe'll want to iterate on it to properly track the host OS and command parameters.
fix #1065