Giter Site home page Giter Site logo

go-ga's Introduction

Telegraf plugin: GoogleAnalytics

Plugin arguments:

Configuration:
# Read metrics about google_analytics usage
[[inputs.google_analytics]]
  ## path to keyfile.
  key_file = "./plugins/inputs/google_analytics/clrty-secret.json"
  ## viewid
  view_id = "ga:155849743"

Result for above configuration.

{
	"gatype":"INTEGER", 
	"is_golden":false, 
	"max_val":"118", 
	"min_val":"1", 
	"row_count":20, 
	"totals":"239", 
	"row_metrics":{
		"1", "4", "7", "1", "62", "16", "1", "1", "1", "1", "3", "118", "1", "2", "2", "2", "2", "1", "10", "3"
	}, 
	"name":"ga:sessions"
} 

Description

The GoogleAnalytics input plugin collects data from google analytics api and convert to store on influxDB.

Testing Package

  1. copy this plugin to
    ~/go/src/github.com/influxdata/telegraf/plugins/inputs/google_analytics.
  2. add _ "github.com/influxdata/telegraf/plugins/inputs/google_analytics" at the end of ~/go/src/github.com/influxdata/telegraf/plugins/inputs/all/all.go
  3. cd ~/go/src/github.com/influxdata/telegraf
  4. make
  5. copy clrty-secret.json to ~/go/src/github.com/influxdata/telegraf/plugins/inputs/google_analytics folder.
  6. run below command.
    ./telegraf --config telegraf.conf --test
  7. check all goes well. :) In my case, I got below result.
    gatype,gatype=INTEGER,host=Luks-iMac.local gatype="INTEGER",is_golden=false,max_val="121",min_val="1",name="ga:sessions",row_count=20i,totals="244" 1534186610000000000

go-ga's People

Contributors

icafa avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.