opts_chunk$set(fig.width=6, fig.height=5, fig.pos="h")
Gaug.es is a paid service for website analytics. It doesn't do as much as Google Analytics, but its super simple and clean, and has a great iPhone app, and an Android app. Each website you want to track is tracked under its own gauge.
Most functions have the same format in which you pass in the id for a gauge (i.e, a website you are tracking), and your API key (see authentication below). Some functions give back data on your site overall and in that case you don't pass in a date, but others can be quieried per date or a range of dates, in which case you can pass in dates. There is one plotting function (vis_gauge
) that gives a nice default plot. But of course you can easily make your own plots.
See the Gaug.es API documentation here http://get.gaug.es/documentation/
rgauges
is listed as one of the Gaug.es API libraries here, along with libraries for Ruby and Node.js
Get your own API key in your Gaug.es 'My Account' page and put in your .Rprofile file under the name 'GaugesKey' or some other name (you can specify keyname
in function calls - but if you put in as 'GaugesKey' you're all set and don't need to bother with the keyname
parameter).
You can alternatively pass in your key using the key
parameter in each function.
Note that in the below examples I'm using my key from my .Rprofile file, so you don't see it being passed in the function call.
More stable version from CRAN
install.packages("rgauges")
Development version from Github
install.packages("devtools") library(devtools) install_github("rgauges", "ropensci")
library(rgauges)
Information on yourself.
gs_me()
Traffic on a gauges ID
gs_traffic(id='4efd83a6f5a1f5158a000004')
Information on screen/browser resolutions
gs_reso(id='4efd83a6f5a1f5158a000004')
You'll need to load ggplot2
library(ggplot2) out <- gs_gauge_detail(id='4efd83a6f5a1f5158a000004') vis_gauge(out)
Lists the people that have access to a Gauge.
gs_shares(id='4efd83a6f5a1f5158a000004')
Gets referrers for a gauge, paginated.
gs_ref(id='4efd83a6f5a1f5158a000004', date = '2014-03-10')$data
Gets browsers and platforms for a gauge.
gs_tech(id='4efd83a6f5a1f5158a000004')
head( gs_pageviews(id='4efd83a6f5a1f5158a000004', fromdate="2013-11-01", todate="2013-11-06") )
Gets top content for a gauge, paginated.
head( gs_content(id='4efd83a6f5a1f5158a000004', date="2013-11-01")$data )
Gets search terms for a gauge, paginated.
gs_terms(id='4efd83a6f5a1f5158a000004', date = '2014-02-05')$data
Information on locations
head( gs_locations(id='4efd83a6f5a1f5158a000004')$data )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.