0.1.1 • Published 7 years ago

usage-stats-cli v0.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

view on npm npm module downloads Build Status Coverage Status Dependency Status js-standard-style

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 \75pound@gmail.com\. Documented by jsdoc-to-markdown.