Permalink
Browse files

Added a basic usage example and ignore files.

Pretty basic working example for the module. This will go to the
profileID and pull page views for the paths returned.

Also, I wanted to ignore some files.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
  • Loading branch information...
1 parent 5d27df4 commit 4401c52fd362f9eaed4edd8af955052736922f2b @ncb000gt committed Aug 10, 2012
Showing with 25 additions and 2 deletions.
  1. +2 −2 .gitignore
  2. +23 −0 examples/basic.js
View
@@ -1,2 +1,2 @@
-test.js
-*.swp
+*.sw[a-z]
+node_modules
View
@@ -0,0 +1,23 @@
+var ga = require('../lib/ga');
+
+var profile='';
+var username='';
+var password='';
+
+var GA = new ga.GA({
+ user: username,
+ password: password
+});
+GA.login(function(err, token) {
+ var options = {
+ 'ids': 'ga:'+profile,
+ 'start-date': '2012-07-01',
+ 'end-date': '2012-08-10',
+ 'dimensions': 'ga:pagePath',
+ 'metrics': 'ga:pageviews',
+ 'sort': '-ga:pagePath'
+ };
+ GA.get(options, function(err, entries) {
+ console.log(entries);
+ });
+});

0 comments on commit 4401c52

Please sign in to comment.