Quite honestly, I don't remember brew asking me this on any of my 3 macOS machines, I'm not saying it didn't, but the fact that I'm a 'techie' person and didn't notice or forgot about it worries me greatly.
It probably didn't. I run brew regularly on my machine, and I did not get any prompt asking me to enable analytics. From reading other comments, I see lots of users are in the same position, and homebrew sneaked this in with just a two line notice buried in the verbose output. This worries me deeply, to the point where I'm considering removing this software from my machine.
While I obviously feel the same way, I'd take a step back and see what Brew's response is to this thread / the backlash of what people want / don't want, because it has, overall been a good thing of macOS.