Homebrew’s Anonymous Aggregate User Behaviour Analytics
Homebrew has begun gathering anonymous aggregate user behaviour analytics and reporting these to Google Analytics.
Homebrew is provided free of charge and run entirely by volunteers in their spare time. As a result, we do not have the resources to do detailed user studies of Homebrew users to decide on how best to design future features and prioritise current work. Anonymous aggregate user analytics allow us to prioritise fixes and features based on how, where and when people use Homebrew. For example:
- if a formulae is widely used and is failing often it will enable us to prioritise fixing that formula over others.
- collecting the OS version allows us to decide what versions of OS X to prioritise and support and identify build failures that occur only on single versions.
Homebrew’s analytics record some shared information for every event:
- The Homebrew user agent e.g.
Homebrew/0.9.9 (Macintosh; Intel Mac OS X 10.11.4) curl/7.43.0
- The Google Analytics version i.e.
1( https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#v )
- The Homebrew analytics tracking ID e.g.
UA-75654628-1( https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#tid )
- A Homebrew analytics user ID e.g.
1BAB65CC-FE7F-4D8C-AB45-B7DB5A6BA9CB. This is generated by
uuidgenand stored in
~/.homebrew_analytics_user_uuid. This does not allow us to track individual users but does enable us to accurately measure user counts vs. event counts ( https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cid )
- The Google Analytics anonymous IP setting is enabled i.e.
1( https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#aip )
- The Homebrew application name e.g.
Homebrew( https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#an )
- The Homebrew application version e.g.
0.9.9( https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#av )
- The Homebrew analytics hit type e.g.
screenview( https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#t )
Homebrew’s analytics records the following different events:
screenviewhit type with the official Homebrew command you have run (with arguments stripped) e.g.
brew list fooor any external commands except
eventhit type with the
installevent category, the Homebrew formula from a non-private GitHub tap you have requested to install and any used options e.g.
wget --with-pcreas the action and an event label e.g.
Mac OS X 10.11, non-/usr/local, CIto indicate the OS version, non-standard installation location and invocation as part of CI. This allows us to identify formulae that need fixed and where more easily.
eventhit type with the
BuildErrorevent category, the Homebrew formula that failed to install e.g.
wgetas the action and an event label e.g.
Mac OS X 10.11
exceptionhit type with the
exceptionevent category, exception description of the exception name e.g.
FormulaUnavailableErrorand whether the exception was fatal e.g.
You can also view all the information that is sent by Homebrew’s analytics by setting
HOMEBREW_ANALYTICS_DEBUG=1 in your environment. Please note this will also stop any analytics being sent.
It is impossible for the Homebrew developers to match any particular event to any particular user, even if we had access to the Homebrew analytics user ID (which we do not). An example of the most user-specific information we can see from Google Analytics:
As far as we can tell it would be impossible Google to match the randomly generated Homebrew-only analytics user ID to any other Google Analytics user ID. If Google turned evil the only thing they could do would be to lie about anonymising IP addresses and attempt to match users based on IP addresses.
Homebrew’s analytics are sent throughout Homebrew’s execution to Google Analytics over HTTPS.
Homebrew’s analytics are accessible to Homebrew’s current maintainers. Contact @mikemcquaid if you are a maintainer and need access.
The code is viewable in https://github.com/Homebrew/brew/blob/master/Library/Homebrew/utils/analytics.rb and https://github.com/Homebrew/brew/blob/master/Library/Homebrew/utils/analytics.sh . They are done in a separate background process and fail fast to avoid delaying any execution. They will fail immediately and silently if you have no network connection.
If after everything you’ve read you still wish to opt-out of Homebrew’s analytics you may set
HOMEBREW_NO_ANALYTICS=1 in your environment which will prevent analytics from ever being sent when it is set.