Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jedi4ever/gars

Google Analytics Realtime Scraper (using CasperJs)
https://github.com/jedi4ever/gars

Last synced: about 2 months ago
JSON representation

Google Analytics Realtime Scraper (using CasperJs)

Awesome Lists containing this project

README

        

Google Analytics Real Time Scraping
==============================================
Currently logs in to Google Analytics and scrapes the realtime page for the active visitors number from the overview screen.

Notes:
- Inspired by:
-
-
- Currently only support datadog as a backend, more to come soon
- This project uses casperjs to scrape the metrics

# Installation

## Using the official npm
`$ npm install -g gars`

## From this repo
```
$ git clone http://github.com/jedi4ever/gars.git
$ npm install
```

# Configuration
```
{
"google": {
"email": "",
"password": "",
"analytics": {
"home_id": "",
"report_id": ""
}
},
"casperjs": {
"verbose": true,
"logLevel": "info"
},
"metric": {
"name": "google.analytics.visitors",
"tags": [ "tag1", "tag2" ],
"hostname": ""
},
"backend": {
"datadog": {
"api_key": "`

## From npm (global)
`$ gars `

## From npm local
`$ ./node_modules/gars/bin/gars `

# Finding the ids
Once logged into the analytics. Note the following ids:

- `google.analytics.home_id` : `https://www.google.com/analytics/web/?hl=en#home//`
- `google.analytics.report_id` : `https://www.google.com/analytics/web/?hl=en#report/visitors-overview//`

# Notes
- http://stackoverflow.com/questions/19617113/hide-the-footprint-of-casperjs-with-google-analytics