nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

ns tries to connect to Google Analytics even when statistics collection permission is denied

Open unikitty37 opened this issue 2 years ago • 1 comments

Issue Description

When I say "no" to anonymous statistics collection on first run, ns still tries to make a connection to google-analytics.com.

I would not expect any connection to be made to an analytics company when I have denied permission for the program to do so.

(I also think the prompt should say who you are using for analytics — I would probably say "yes" to a self-hosted solution, but "no" to Google, as the data is almost certainly anonymous to you, but not to them. There is, after all, a reason they're letting you use Analytics for free — and the price is my data :)

Reproduction

  1. Install a connection monitoring program like Little Snitch, and configure it to ask permission for each connection.
  2. npm i -g nativescript
  3. ns
  4. Answer n to the anonymous statistics prompt.
  5. Little Snitch will prompt for permission to connect to various sites; one of these will be google-analytics.com.

Relevant log output (if applicable)

No response

Environment

OS: macOS 13.4.1
CPU: (10) arm64 Apple M1 Max
Shell: /bin/zsh
node: 20.3.1
npm: 9.6.7
nativescript: 8.5.3

# android
java: 19.0.2
ndk: Not Found
apis: Not Found
build_tools: Not Found
system_images: Not Found

# ios
xcode: 14.3.1/14E300c
cocoapods: Not Found
python: Not Found
python3: 3.11.3
ruby: 3.2.2
platforms: 
  - DriverKit 22.4
  - iOS 16.4
  - macOS 13.3
  - tvOS 16.4
  - watchOS 9.4

Dependencies

"dependencies": {},
"devDependencies": {}

Please accept these terms

unikitty37 avatar Jul 03 '23 08:07 unikitty37

I believe this is "working as intended" based on the code here: https://github.com/NativeScript/nativescript-cli/blob/eb918011d6f0be9a8ccb6b569628e3960fd4f8b9/lib/services/analytics/analytics-service.ts#L72-L81

However I do agree, if the answer is n/no then nothing should be tracked at all, so I'm marking it as a bug.

If I understand the code correctly, it only sends a single event with the no choice after which no further events are ever sent (hopefully).

rigor789 avatar Jul 06 '23 15:07 rigor789