Skip to content

Commit 44a3450

Browse files
committed
[v0.8.8][xs]: tracking first runs of the app - refs #322
1 parent 94cd423 commit 44a3450

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

bin/data.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const {resolve} = require('path')
55
// Packages
66
const ua = require('universal-analytics')
77
const {config} = require('datahub-client')
8+
const firstRun = require('first-run')
89

910
const {version} = require('../package.json')
1011

@@ -106,6 +107,10 @@ if (process.env.datahub !== 'dev') {
106107
if (userid) {
107108
visitor.set('uid', userid)
108109
}
110+
// If this is the first run of the app, then track it in GA:
111+
if (firstRun()) {
112+
visitor.event('cli', 'first-run').send()
113+
}
109114
// Event category is 'cli', action is the command and label is all arguments:
110115
visitor.event('cli', cmd, process.argv.slice(3, process.argv.length).toString()).send()
111116
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "data-cli",
3-
"version": "0.8.7",
3+
"version": "0.8.8",
44
"description": "CLI for working with data packages",
55
"main": "./lib/index.js",
66
"bin": {
@@ -74,6 +74,7 @@
7474
"clipboardy": "^1.1.4",
7575
"data.js": "^0.11.1",
7676
"datahub-client": "^0.4.3",
77+
"first-run": "^1.2.0",
7778
"global-packages": "^1.0.2",
7879
"human-readable-ids": "^1.0.3",
7980
"inquirer": "^5.1.0",

0 commit comments

Comments
 (0)