usage-stats-cli

0.1.1 • Public • Published

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:

usage-stats

  A minimal, offline-friendly Google Analytics Measurement Protocol client for
  tracking usage statistics in shell and javascript applications.

Synopsis

  $ usage-stats <command> <command-options>
  $ usage-stats <command> --help

Commands

  screenview   Track a screenview
  event        Track an event
  exception    Track an exception

© 2016-17 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.

Readme

Keywords

none

Package Sidebar

Install

npm i usage-stats-cli

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • 75lb