CLI Analytics
CLI Analytics
is intended to allow quick integration from the cli into analytic interfaces. Starting with version 0.0.1, CLI Analytics interfaces with Google Analytics.
Google Analytics Setup
- CLI Analytics uses Universal Analytics as its interface to interact with the Measurement Protocol of Google Analytics.
When CLI Analytics is instantiated, it maps the Universal Analytics object to the track object with options sent in through the constructor. Below is an example of how to utilize Universal Analytics.
const analytics= tracking_id options;analyticstrackevent...analyticstrackanalyticstrack
Getting Started
Quick Start
Universal Analytics Default Implementation:
const analytics = tracking_id options;analyticstrackevent'Category' 'Action' 'Label' 'Value';
CLI Analytics Specific Methods
-
startTimer(name)
- Instantiates a timer -
getTimeDiff(name)
- Returns the elapsed time of a specific timer in milliseconds.
Examples
Timeout Example, Display elapsed time after waiting 1 second
analytics;;
Normal Use Case Example, Get the time difference for the user selection.
analytics;// ... User Selects Options ...const timing = analytics;analyticstrack