How do I know if brew analytics is on or off?

By | September 26, 2022

Just type:

brew analytics
Analytics are enabled.

and if brew analytics is enabled, it will say so.

To turn it off, type:

brew analytics off (this will prevent analytics from ever being sent)

The other option is to set an environment variable:

export HOMEBREW_NO_ANALYTICS=1

If you are interested to see what info is being sent, you can read this, or set this environment variable:

export HOMEBREW_ANALYTICS_DEBUG=1

What this does is displays the data being sent to Google when you install your next application. eg:

/usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --max-time 3 --user-agent Homebrew/3.6.2 (Macintosh; Intel Mac OS X 10.15.7) curl/7.64.1 --data v=1 --data aip=1 --data t=event --data tid=UA-76629469-1 --data cid=A0125AE7-5913-4F81-B7K0-6BE16DDEDDA5 --data an=Homebrew --data av=3.6.2 --data ec=install --data ea=gnupg --data el=macOS%2010.15.7 https://www.google-analytics.com/debug/collect
{
  "hitParsingResult": [ {
    "valid": true,
    "parserMessage": [ {
      "messageType": "INFO",
      "description": "IP Address from this hit was anonymized to 149.183.54.23.",
      "messageCode": "VALUE_MODIFIED"
    } ],
    "hit": "/debug/collect?v=1\u0026aip=1\u0026t=event\u0026tid=UA-76629469-1\u0026cid=A0125AE7-5913-4F81-B7K0-6BE16DDEDDA5\u0026an=Homebrew\u0026av=3.6.2\u0026ec=install\u0026ea=gnupg\u0026el=macOS 10.15.7"
  } ],
  "parserMessage": [ {
    "messageType": "INFO",
    "description": "Found 1 hit in the request."
  } ]
}
/usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --max-time 3 --user-agent Homebrew/3.6.2 (Macintosh; Intel Mac OS X 10.15.7) curl/7.64.1 --data v=1 --data aip=1 --data t=event --data tid=UA-76629469-1 --data cid=A0125AE7-5913-4F81-B7K0-6BE16DDEDDA5 --data an=Homebrew --data av=3.6.2 --data ec=install_on_request --data ea=gnupg --data el=macOS%2010.15.7 https://www.google-analytics.com/debug/collect
{
  "hitParsingResult": [ {
    "valid": true,
    "parserMessage": [ {
      "messageType": "INFO",
      "description": "IP Address from this hit was anonymized to 129.18.1.231.",
      "messageCode": "VALUE_MODIFIED"
    } ],
    "hit": "/debug/collect?v=1\u0026aip=1\u0026t=event\u0026tid=UA-76679489-1\u0026cid=A0127AE7-5223-4F81-B7E0-6BE18DDEDDA5\u0026an=Homebrew\u0026av=3.6.2\u0026ec=install_on_request\u0026ea=gnupg\u0026el=macOS 10.15.7"
  } ],
  "parserMessage": [ {
    "messageType": "INFO",
    "description": "Found 1 hit in the request."
  } ]
}
Category: OSX

Leave a Reply

Your email address will not be published. Required fields are marked *