Skip to content

Latest commit

 

History

History
101 lines (80 loc) · 4.26 KB

analytics.md

File metadata and controls

101 lines (80 loc) · 4.26 KB

Usage Metrics Gathering

This document list exactly what is gathered and how.

Any change to analytics should most probably include a change to this document.

Dimensions and Metrics

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.

Adding dimension or metic.

  1. Create the dimension or metric in Google Analytics first. These are not tracked if they aren't defined in Google Analytics.
  2. Use the ID of the dimension as the x-user-analytics value in the schema.json file.
  3. New dimension and metrics PRs need to be approved by the tooling lead and require a new Launch.

Deleting a dimension or metic.

  1. Archive the dimension and metric in Google Analytics.

DO NOT ADD x-user-analytics FOR VALUES THAT ARE USER IDENTIFIABLE (PII), FOR EXAMPLE A PROJECT NAME TO BUILD OR A MODULE NAME.

Limits

ItemStandard property limits
Event-scoped custom dimensions50
User-scoped custom dimensions25
All custom metrics50

List of User Custom Dimensions

NameParameterType
UserIdup.ng_user_idstring
OsArchitectureup.ng_os_architecturestring
NodeVersionup.ng_node_versionstring
NodeMajorVersionupn.ng_node_major_versionnumber
AngularCLIVersionup.ng_cli_versionstring
AngularCLIMajorVersionupn.ng_cli_major_versionnumber
PackageManagerup.ng_package_managerstring
PackageManagerVersionup.ng_pkg_manager_versionstring
PackageManagerMajorVersionupn.ng_pkg_manager_major_vnumber

List of Event Custom Dimensions

NameParameterType
Commandep.ng_commandstring
SchematicCollectionNameep.ng_schematic_collection_namestring
SchematicNameep.ng_schematic_namestring
Standaloneep.ng_standalonestring
SSRep.ng_ssrstring
Styleep.ng_stylestring
Routingep.ng_routingstring
InlineTemplateep.ng_inline_templatestring
InlineStyleep.ng_inline_stylestring
BuilderTargetep.ng_builder_targetstring
Aotep.ng_aotstring
Optimizationep.ng_optimizationstring

List of Event Custom Metrics

NameParameterType
AllChunksCountepn.ng_all_chunks_countnumber
LazyChunksCountepn.ng_lazy_chunks_countnumber
InitialChunksCountepn.ng_initial_chunks_countnumber
ChangedChunksCountepn.ng_changed_chunks_countnumber
DurationInMsepn.ng_duration_msnumber
CssSizeInBytesepn.ng_css_size_bytesnumber
JsSizeInBytesepn.ng_js_size_bytesnumber
NgComponentCountepn.ng_component_countnumber
AllProjectsCountepn.all_projects_countnumber
LibraryProjectsCountepn.libs_projects_countnumber
ApplicationProjectsCountepn.apps_projects_countnumber

Debugging

Using NG_DEBUG=1 will enable Google Analytics debug mode, To view the debug events, in Google Analytics go to Configure > DebugView.

Disabling Usage Analytics

There are 2 ways of disabling usage analytics:

  1. using ng analytics disable --global (or changing the global configuration file yourself). This is the same as answering "No" to the prompt.
  2. There is an 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.
close