Skip to content

Commit f29a0bf

Browse files
committed
[analytics][xs]: differentiate no arguments vs help command when tracking with GA - fixes #331
1 parent 948fab9 commit f29a0bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/data.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ if (process.env.datahub !== 'dev') {
116116
// Track which version is run and on which OS:
117117
visitor.event('cli-usage-by-os-and-version', process.platform, version).send()
118118
// Event category is 'cli', action is the command and label is all arguments:
119-
visitor.event('cli', cmd, process.argv.slice(3, process.argv.length).toString()).send()
119+
const commandToTrack = args.length === 0 ? 'noArgs' : cmd
120+
visitor.event('cli', commandToTrack, process.argv.slice(3, process.argv.length).toString()).send()
120121
}
121122

122123
// Prepare process.argv for subcommand

0 commit comments

Comments
 (0)