From db173d7edf685df67b782d81d1bacb84b8debf9a Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Thu, 30 Mar 2023 09:28:37 +0000 Subject: [PATCH] fix(@angular/cli): collect tech information Currently tech information such as OS and OS version was not being collected property due to missing required fields. (cherry picked from commit fb19f5f3d3ebcf1efe94114c6702bb91341288d0) --- .../angular/cli/src/analytics/analytics-collector.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/angular/cli/src/analytics/analytics-collector.ts b/packages/angular/cli/src/analytics/analytics-collector.ts index 5d3746899d38..39848e222faf 100644 --- a/packages/angular/cli/src/analytics/analytics-collector.ts +++ b/packages/angular/cli/src/analytics/analytics-collector.ts @@ -46,7 +46,11 @@ export class AnalyticsCollector { [RequestParameter.UserAgentArchitecture]: os.arch(), [RequestParameter.UserAgentPlatform]: os.platform(), [RequestParameter.UserAgentPlatformVersion]: os.release(), + [RequestParameter.UserAgentMobile]: 0, [RequestParameter.SessionEngaged]: 1, + // The below is needed for tech details to be collected. + [RequestParameter.UserAgentFullVersionList]: + 'Google%20Chrome;111.0.5563.64|Not(A%3ABrand;8.0.0.0|Chromium;111.0.5563.64', }; if (ngDebug) { @@ -171,6 +175,11 @@ export class AnalyticsCollector { host: 'www.google-analytics.com', method: 'POST', path: '/g/collect?' + this.requestParameterStringified, + headers: { + // The below is needed for tech details to be collected even though we provide our own information from the OS Node.js module + 'user-agent': + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36', + }, }, (response) => { if (response.statusCode !== 200 && response.statusCode !== 204) {