node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org »

ga-server

Google Analytics API

NPM version

Google Analytics API for Node.js.

Installation

$ npm install ga-server

Usage

Create a new instance.

var GoogleAnalytics = require('ga-server');
 
var ga = new GoogleAnalytics({
  id: '',
  clientEmail: '',
  privateKey: ''
});

API

See here for more info.

startDate(date)

Alias: start

endDate(date)

Alias: end

metrics(metrics)

dimensions(dimensions)

sort(sort)

filter(filters)

segment(segment)

samplingLevel(level)

startIndex(index)

skip(index)

This is an alias for startIndex(i + 1).

maxResults(max)

Alias: limit

output(output)

fields(fields)

prettyPrint(prettyPrint)

userIp(ip)

Alias: ip

quotaUser(quotaUser)

exec(callback)

License

MIT