docs/design/analytics.md
This document list exactly what is gathered and how.
Any change to analytics should most probably include a change to this document.
Google Analytics Custom Dimensions are used to track system values and flag values. These dimensions are aggregated automatically on the backend.
One dimension per flag, and although technically there can be an overlap between 2 commands, for
simplicity it should remain unique across all CLI commands. The dimension is the value of the
x-user-analytics field in the schema.json files.
x-user-analytics value in the schema.json file.DO NOT ADD x-user-analytics FOR VALUES THAT ARE USER IDENTIFIABLE (PII), FOR EXAMPLE A
PROJECT NAME TO BUILD OR A MODULE NAME.
| Item | Standard property limits |
|---|---|
| Event-scoped custom dimensions | 50 |
| User-scoped custom dimensions | 25 |
| All custom metrics | 50 |
| 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 |
| AngularCLIVersion | up.ng_cli_version | string |
| AngularCLIMajorVersion | upn.ng_cli_major_version | number |
| PackageManager | up.ng_package_manager | string |
| PackageManagerVersion | up.ng_pkg_manager_version | string |
| PackageManagerMajorVersion | upn.ng_pkg_manager_major_v | number |
| Name | Parameter | Type |
|---|---|---|
| Command | ep.ng_command | string |
| SchematicCollectionName | ep.ng_schematic_collection_name | string |
| SchematicName | ep.ng_schematic_name | string |
| Standalone | ep.ng_standalone | string |
| SSR | ep.ng_ssr | string |
| Style | ep.ng_style | string |
| Routing | ep.ng_routing | string |
| InlineTemplate | ep.ng_inline_template | string |
| InlineStyle | ep.ng_inline_style | string |
| BuilderTarget | ep.ng_builder_target | string |
| Aot | ep.ng_aot | string |
| Optimization | ep.ng_optimization | string |
| Name | Parameter | Type |
|---|---|---|
| AllChunksCount | epn.ng_all_chunks_count | number |
| LazyChunksCount | epn.ng_lazy_chunks_count | number |
| InitialChunksCount | epn.ng_initial_chunks_count | number |
| ChangedChunksCount | epn.ng_changed_chunks_count | number |
| DurationInMs | epn.ng_duration_ms | number |
| CssSizeInBytes | epn.ng_css_size_bytes | number |
| JsSizeInBytes | epn.ng_js_size_bytes | number |
| NgComponentCount | epn.ng_component_count | number |
| AllProjectsCount | epn.all_projects_count | number |
| LibraryProjectsCount | epn.libs_projects_count | number |
| ApplicationProjectsCount | epn.apps_projects_count | number |
Using NG_DEBUG=1 will enable Google Analytics debug mode, To view the debug events, in Google Analytics go to Configure > DebugView.
There are 2 ways of disabling usage analytics:
ng analytics disable --global (or changing the global configuration file yourself). This is the same
as answering "No" to the prompt.NG_CLI_ANALYTICS environment variable that overrides the global configuration.
That flag is a string that represents the User ID. If the string "false" is used it will
disable analytics for this run.