gaer
A CLI for Google Analytics Event Tracking Report
Last updated 5 years ago by t32k .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gaer 
SYNC missed versions from official npm registry.

A CLI for Google Analytics Event Tracking Report.

Build Status

Did you know Google Analytics has a report feature developers can use freely? It's a Event Tracking Report. GAER allows you to store your data object and monitor the data history using Measurement Protocol. In other words, you can send your data to Google Analytics server from CLI tool.

$ gaer -t UA-xxxxx-xx -r reportName path/to/data.json
  Sending [||||||||||||||||||||||||] 100%
  Success: The data is sent to UA-xxxxx-xx

Getting Started

If you don't have Google Analytics account, please create new account. And then, please create new property for using GAER Report in advance.

The JSON data you want to store must be simple object and all value must be numeric, because GARE use key of the object as Event Label and value of the object as Event Value.

// Good :)
{ "foo": 3, "bar": 9, "baz": 3.14 }

// Bad :(
{ "foo": "aaa", "bar": 1, "baz": "bbb" }

// Bad :(
{ "foo": 3, "bar": { "qux": 1 }, "baz": 3.14 }

// Bad :(
{ "foo": 3, "bar": 9, "baz": [0,1,3] }

Event Tracking Parameter

Please see the details below.

Event Type in GARE
Category String GAER (Fixed)
Action String --report value
Label String object.key
Value Number object.value

Reports on Google Analytics

You can see the data report you sent from CLI on Behavior > Events menu.

As shown below, you can also use the Custom Report for GARE.

Install

With npm do:

npm install -g gaer

Usage

  Usage: gaer [options] <JSON>

  Options:

    -h, --help           output usage information
    -V, --version        output the version number
    -t, --tid <ID>       set your Google Analytics Tracking ID
    -r, --report <Name>  set your GA Action report name

CLI Example

Standard way:

gaer --tid UA-xxxxxxx-x --report ReportName path/to/json/file.json

Shortcut way:

gaer -t UA-xxxxxxx-x -r ReportName path/to/json/file.json

Debug mode:

DEBUG=1 gaer -t UA-xxxxxxx-x -r ReportName path/to/json/file.json

Using environment variables:

GA_TID=UA-xxxxxxx-x GA_REPORT=ReportName gaer path/to/json/file.json

Using pipe:

stylestats -f json -n path/to/css/file.css | gaer -t UA-xxxxxxx-x -r ReportName

See also: t32k/stylestats

API Example

You can use the API directly too:

var Gaer = require('gaer');
var gaer = new Gaer('UA-xxxxx-x');
gaer.record('Report Name', 'path/to/data.json');

Limits and Quotas

Please refer to as follows:

Current Tags

  • 0.11.0                                ...           latest (5 years ago)

13 Versions

  • 0.11.0                                ...           5 years ago
  • 0.10.2                                ...           5 years ago
  • 0.10.1                                ...           5 years ago
  • 0.10.0                                ...           5 years ago
  • 0.9.3                                ...           5 years ago
  • 0.9.2                                ...           5 years ago
  • 0.9.0                                ...           5 years ago
  • 0.7.0                                ...           5 years ago
  • 0.6.0                                ...           5 years ago
  • 0.5.0                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (2)
Dependents (3)

Copyright 2014 - 2016 © taobao.org |