Skip to content

sirshurf/gars-zombie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Analytics Real Time Scraping (using ZombieJs)

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

Notes:

Installation

Using the official npm

$ npm install -g gars-zombie

From this repo

$ git clone https://github.com/sirshurf/gars-zombie.git
$ cd gars-zombie
$ npm install

Configuration

{
	"scraper":   [{
			"google": {
				"email": "<your email>",
				"password": "<your password>"
			},
			"report": [{
				"analytics": {
					"home_id": "<your google analytics home id>",
					"report_id": "<your google analytics project id>"
				},
				"metric": {
					"backend":"datadog",
					"name": "google.analytics.visitors",
					"tags": [ "tag1", "tag2" ],
					"hostname": "<your hostname>"
				}

			}]
	}],

	"backend": {
		"datadog": {
			"type": "datadog",
			"api_key": "<your datadog api key",
			"url": "https://app.datadoghq.com/api/v1/series"
		}
	}

}

Running it

From this repo

$ ./bin/gars-zombie -c <config file>

From npm (global)

$ gars-zombie -c <config file>

From npm local

$ ./node_modules/gars-zombie/bin/gars-zombie -c <config file>

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/<home_id>/
  • google.analytics.report_id : https://www.google.com/analytics/web/?hl=en#report/visitors-overview/<report_id>/

About

Node Google Analytics Realtime Scraper (using ZombieJs)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published