ga

command
v0.0.0-...-c3216bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2018 License: MIT, MIT Imports: 17 Imported by: 0

README

ga

Google Analytics via the Command Line

THIS IS A WORK IN PROGRESS, CURRENTLY AUTH IS WORKING

API Keys

To apply for API access at the Google APIs Console:

  • Visit the Google APIs Console. Log in if prompted to do so.
  • Create a project for your application (if you have not already done so) by clicking Create project.
  • Select APIS & AUTH > APIs from the side menu. The list of accessible Google services appears.
  • Scroll through the list until you find Google Analytics, click the Status switch next to the service name (so that it switches from OFF to ON). NOTE: google autmoatically will have other services turned on you can switch those off as long as you keep Google Analytics on.
  • For some services, the Console will display a Terms of Service pane. To go ahead, check the I agree to these terms box, then click Accept.
  • Scroll back to the top of the page and APIS & AUTH > Credentials in the side menu.
  • The API Access pane appears.
  • Click Create an OAuth 2.0 Client ID.
  • The Create Client ID dialog appears.
  • Click the Installed Application radio button and Other. It should look like below: client_id
  • Click Create.
  • The credentials under Client ID for native application can be used when prompted by ga --configure

Installation

Via Go
$ go get github.com/jessfraz/ga
Binaries

Usage

Global Options

  • --disable-plot: Disable plotting
  • --clientid, -c: Google OAuth Client Id, overrides the .ga-cli files
  • --secret, -s: Google OAuth Client Secret, overrides the .ga-cli files
  • --debug, -d: Debug mode
  • --json: Print raw json
  • --raw: Don't colorize output
accounts

Get accounts

configure, config

Configure your Google API Credentials

now

Get Realtime Data, dimensions and data reference available at https://developers.google.com/analytics/devguides/reporting/realtime/dimsmets/

  • --profile, p: Profile id for which to get data
  • --metrics, -m: Real time metrics to get. default: 'rt:activeUsers'
  • --dimensions, --dim: Real time dimensions (comma-separated). ex: 'rt:pagePath,rt:pageTitle'
  • --sort: Sort to apply
profiles

Get profiles

  • --account: Account id for which to list profiles
properties

Get profiles

  • --account: Account id for which to list properties
help, h

Shows a list of commands or help for one command

Analytics

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL