1
0
mirror of https://github.com/angular/angular-cli.git synced 2025-05-18 20:02:40 +08:00

fix(@angular/cli): add unique user id as user parameter in GA

While, GA collects the user id, this cannot be used for reporting and filtering purpose. This can be
This commit is contained in:
Alan Agius 2022-10-13 12:59:01 +00:00 committed by Alan Agius
parent c59c1e7e6d
commit f41d609ae8
3 changed files with 4 additions and 0 deletions
docs/design
packages/angular/cli/src/analytics

@ -38,6 +38,7 @@ PROJECT NAME TO BUILD OR A MODULE NAME.**
<!--USER_DIMENSIONS_TABLE_BEGIN-->
| Name | Parameter | Type |
|:---:|:---|:---|
| UserId | `up.ng_user_id` | `string` |
| OsArchitecture | `up.ng_os_architecture` | `string` |
| NodeVersion | `up.ng_node_version` | `string` |
| NodeMajorVersion | `upn.ng_node_major_version` | `number` |

@ -60,6 +60,8 @@ export class AnalyticsCollector {
// While architecture is being collect by GA as UserAgentArchitecture.
// It doesn't look like there is a way to query this. Therefore we collect this as a custom user dimension too.
[UserCustomDimension.OsArchitecture]: os.arch(),
// While User ID is being collected by GA, this is not visible in reports/for filtering.
[UserCustomDimension.UserId]: userId,
[UserCustomDimension.NodeVersion]: nodeVersion,
[UserCustomDimension.NodeMajorVersion]: +nodeVersion.split('.', 1)[0],
[UserCustomDimension.PackageManager]: context.packageManager.name,

@ -48,6 +48,7 @@ export enum RequestParameter {
* @see https://support.google.com/analytics/answer/10075209?hl=en
*/
export enum UserCustomDimension {
UserId = 'up.ng_user_id',
OsArchitecture = 'up.ng_os_architecture',
NodeVersion = 'up.ng_node_version',
NodeMajorVersion = 'upn.ng_node_major_version',