usage-stats-cli
v0.1.1
Published
A minimal, offline-friendly Google Analytics Measurement Protocol client for tracking usage statistics in shell and javascript applications
Downloads
3
Readme
usage-stats-cli
A minimal, offline-friendly Google Analytics Measurement Protocol client for tracking usage statistics in shell and javascript applications.
This is a low-level API client, it doesn't hold any opinion of how usage tracking should be done. If you're looking for a convention which leverages the power and flexibility of Custom Metrics and Dimensions, take a look at app-usage-stats.
Synopsis
Tracking statistics in shell scripts:
# Track an event: category 'Backup', action 'start'
usage-stats event --tid UA-98765432-1 --ec Backup --ea start
# Perform the backup
cp files/** backup/
# Track an event: category 'Backup', action 'complete'
usage-stats event --tid UA-98765432-1 --ec Backup --ea complete
Protocol Parameters
See here for the full list of Google Analytics Measurement Protocol parameters.
Sent by default
All parameters are send on demand, beside this list.
- Operating System version (sent in the UserAgent)
- Client ID (a random UUID, generated once per OS user and stored)
- Language (
process.env.LANG
, if set) - Screen resolution (terminal rows by columns, by default)
CLI Reference
To install the command line client:
$ npm install -g usage-stats-cli
Running the tool with no arguments will print the usage guide:
© 2016-17 Lloyd Brookes <[email protected]>. Documented by jsdoc-to-markdown.