Skip to content
This repository has been archived by the owner on Apr 4, 2018. It is now read-only.

Collects visits data for different time intervals from google analytics

Notifications You must be signed in to change notification settings

alphagov/datainsight-ga-collector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

datainsight-ga-collector

Collect the statics specified by the configuration from google analytics

Setup

The first thing that must be done when using this collector is to authorise the application with google. First you will need to generate an authorisation code. This code then needs to be passed to the collector command line script using --authorisation_code=CODE

Message Format

{
  "envelope":{
    "collected_at":"2012-08-13T18:09:20+01:00",
    "collector":"Google Analytics"
  },
  "payload":{
    "start_at":"2012-07-29T00:00:00+00:00",
    "end_at":"2012-08-05T00:00:00+00:00",
    "value":32199,
    "site":"govuk"
  }
}

Usage

This collector is run from the command line with the collector script. This command requires an action which can be either help, print or broadcast. It also requires a --config option which defines which configuration class is used. For example the following command will print messages to the terminal using the WeeklyUniqueVisitors configuration.

$ bundle exec collector --config=WeeklyUniqueVisitors print

Other Options

--days_ago: This option allows you to collect all data since a given time ago. The frequency will depend on the configuration you use.

--authorisation_code: Pass in the code to authorise this project with Google.

About

Collects visits data for different time intervals from google analytics

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published