Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Feature/parsed data empty rows #24

Merged
merged 3 commits into from

2 participants

@patnolanireland

Hi, I've observed and fixed an edge case whereby the JSON data parsed from from the Google API request may not have a rows field. This has happened in production where a client has a master Google Analytics account for various companies but not yet setup the Web Site for the company thus meaning that there is not yet any data.

It would be great if you could integrate this into your library and update the npm package.

Cheers

Pat

@ncb000gt ncb000gt merged commit c0184a3 into ncb000gt:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 10, 2013
  1. Updated the contributors

    nolanp authored
  2. Updated the contributors

    nolanp authored
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 1 deletion.
  1. +2 −0  README.md
  2. +4 −0 lib/ga.js
  3. +2 −1  package.json
View
2  README.md
@@ -95,6 +95,7 @@ Contributors
* [Brian Zeligson][beezee] - Updates for a more recent version of node. Also makes use of better selectors.
* [Mike Schierberl][mschierberl]
* [Gal Ben-Haim][bsphere] - Bug fixes for access token flow.
+* [Patrick Nolan][patnolan] - Bug fixes for parsed_data not containing a rows field.
License
============
@@ -105,5 +106,6 @@ see license file
[beezee]:https://github.com/beezee
[mschierberl]:https://github.com/mschierberl
[bsphere]:https://github.com/bsphere
+[patnolan]:https://github.com/patnolanireland
[gapi]:https://github.com/bsphere/node-gapitoken
View
4 lib/ga.js
@@ -139,6 +139,10 @@ GA.prototype.get = function(options, cb) {
}
}
+ if (!parsed_data.rows) {
+ parsed_data.rows = [];
+ }
+
for (var col=0; col<parsed_data.columnHeaders.length; col++){
if(parsed_data.columnHeaders[col]['columnType'] === "METRIC"){
metric_indexes.push(col);
View
3  package.json
@@ -7,7 +7,8 @@
"contributors": [
{ "name": "Brian Zeligson (http://github.com/beezee)", "email": "brian.zeligson@gmail.com" },
{ "name": "Mike Schierberl (http://github.com/mschierberl)", "email": "mike@schierberl.com" },
- { "name": "Gal Ben-Haim (http://github.com/bsphere", "email": "gbenhaim@gmail.com"}
+ { "name": "Gal Ben-Haim (http://github.com/bsphere", "email": "gbenhaim@gmail.com"},
+ { "name": "Patrick Nolan (http://github.com/patnolanireland", "email": "patnolanireland@gmail.com"}
],
"engines": { "node": ">= 0.4.0" },
"repository": {
Something went wrong with that request. Please try again.