Why would anybody opt-in to analytics of a website they are visiting - even if it's strictly first-party, not sharing it with advertizers or Google, just for improving the site? You are gonna click "no".
Same with application analytics - if you know as a developer which functions people use how frequently, and where the app crashes, everyone benefits. The potential dangers are theoretical at best, and you can always opt out. But if it is opt-in, you get completely skewed results.
Controversial opinion, but I think opt-out should be the default in 90% of the cases, and to prevent the undesired outcome (e.g. people making ad profiles) you should not require out-in, but just ban the undesired outcome.