This is hugely important. Any analytics had better be opt-in from a very visible and honest request dialog. Otherwise, quite frankly, it's unethical.
My feeling is that anything personal including user content and searches should be opt-in but opt out is ok for monitoring feature usage that can't be linked to an individual. Obviously online/web apps reveal at least this anyway. Does context web/mobile app/PC app make a difference?