ga-report

1.0.0 • Public • Published

Google Analtyics Reporting Build Status

NodeJS wrapper for Google Analytics Core Reporting API

API

Instanciate

Report = require('ga-report');
 
var report = new Report('user@gmail.com', 'mypassword');
var report.once('ready', function() {
  // ready to report
});

Get Accounts

report.getAccounts(function(err, accounts) {
  console.error(err);
  for (var i = 0; i < accounts.length; i++) {
    console.log(accounts[i]);
  }
});

Get Webproperties

report.getWebproperties(accountId, function(err, webproperties) {
  console.error(err);
  for (var i = 0; i < webproperties.length; i++) {
    console.oog(webproperties[i]);
  }
});

Get Webproperties

report.getWebproperties(accountId, webpropertyId, function(err, profile) {
  console.error(err);
  for (var i = 0; i < profiles.length; i++) {
    console.oog(profiles[i]);
  }
});

Get Report

var options = {
  'ids': 'ga:123456-UA',
  'start-date': '2013-10-01',
  'end-date': '2013-10-31',
  'metrics': 'ga:visits,ga:bounces'
};
report.get(options, functon(err, data) {
  if (err) console.error(err);
  console.dir(data);
)};

Readme

Keywords

none

Package Sidebar

Install

npm i ga-report

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • turistforeningen