Feature Proposal: Add Target Package & Version Parameters to Event.dartCliCommandExecuted
Problem
Currently, when a developer runs standalone CLI distribution commands such as dart install <package> or dart run <package>@<version>, package:unified_analytics records name: 'install' or name: 'run', but does not capture which specific package or version was resolved.
Tracking which public packages are installed and run dynamically is critical for understanding Dart CLI tool ecosystem adoption, identifying high-traffic tools migrating away from legacy pub global activate, and monitoring compiler/runtime compatibility.
Proposal
Add optional scalar parameters to Event.dartCliCommandExecuted:
Event.dartCliCommandExecuted({
required String name,
required String enabledExperiments,
int? exitCode,
bool? pubspecHasFlutterSdk,
Set<String>? pubspecDependencies,
String? pubspecEnvironmentSdk,
// New fields for standalone tool installation and execution:
String? targetPackage, // e.g. "dhttpd"
String? targetPackageVersion, // e.g. "4.1.0" (resolved version from lockfile)
String? targetPackageConstraint, // e.g. "^4.0.0" (SemVer constraint from @ or null)
})
Parameter Budget & GA4 Limits
- GA4 enforces a maximum of 25 custom parameters per event.
- In standard project commands (
dart build, dart test), targetPackage* fields are null and omitted from the payload, preserving all slots for pubspec_dep_0..19.
- In
dart install and dart run <pkg>@, pubspecDependencies is null, and targetPackage* adds 3 parameters. Total payload size remains $\le 8$ parameters (well under 25).
Privacy Data Directive (PDD) Compliance
- Callers (e.g.
pkg/dartdev) MUST only populate these fields after successful resolution (exitCode == 0) from a public hosted registry (source == 'hosted' and host is https://pub.dev).
- Private packages, git repositories, path dependencies, and failed resolutions (e.g. 404s) must strictly omit these fields.
Feature Proposal: Add Target Package & Version Parameters to
Event.dartCliCommandExecutedProblem
Currently, when a developer runs standalone CLI distribution commands such as
dart install <package>ordart run <package>@<version>,package:unified_analyticsrecordsname: 'install'orname: 'run', but does not capture which specific package or version was resolved.Tracking which public packages are installed and run dynamically is critical for understanding Dart CLI tool ecosystem adoption, identifying high-traffic tools migrating away from legacy
pub global activate, and monitoring compiler/runtime compatibility.Proposal
Add optional scalar parameters to
Event.dartCliCommandExecuted:Parameter Budget & GA4 Limits
dart build,dart test),targetPackage*fields arenulland omitted from the payload, preserving all slots forpubspec_dep_0..19.dart installanddart run <pkg>@,pubspecDependenciesisnull, andtargetPackage*adds 3 parameters. Total payload size remainsPrivacy Data Directive (PDD) Compliance
pkg/dartdev) MUST only populate these fields after successful resolution (exitCode == 0) from a public hosted registry (source == 'hosted'and host ishttps://pub.dev).