Learn R Programming

RGA

This package is designed to work with the API Google Analytics in R.

Key features:

  • OAuth 2.0 authorization;
  • Auto refresh an expired OAuth access token;
  • Access to all the accounts which the user has access to;
  • API responses is converted directly into R objects;
  • Access to the following Google Analytics APIs:
  • Auto-pagination to return more than 10,000 rows of the results by combining multiple data requests;
  • Split the query by date ranges to avoid a sampling data;
  • Shiny app to explore all the dimensions and metrics available through the Core Reporting API.

Installation

To install the latest release version from CRAN with:

install.packages("RGA")

To install the development version the install_github() function from devtools package can be used:

devtools::install_github("artemklevtsov/RGA")

Another method to install the package RGA (using the command line):

git clone https://github.com/artemklevtsov/RGA.git
R CMD build RGA
R CMD INSTALL RGA_*.tar.gz

Usage

Once you have the package loaded, there are 3 steps you need to use to get data from Google Analytics:

  1. Authorize this package to access your Google Analytics data with the authorize() function;
  2. Determine the profile ID which you want to get access to with the list_profiles() function;
  3. Get the anaytics data from the API with one of these functions:
    • get_ga() for the Core Reporting API
    • get_mcf() for the Multi-Channel Funnels Reporting API
    • get_realtime() for the Real Time Reporting API

For details about this steps please type into R:

library(help = "RGA")
browseVignettes(package = "RGA")

Bug reports

First check the changes in the latest version of the package. Type type into R:

news(package = "RGA", Version == packageVersion("RGA"))

Try reproduce a bug with the latest development version from Git.

Before posting a bug please try execute your code with the httr::with_verbose() wrapper. It will be useful if you attach verbose output to the bug report.

httr::with_verbose(list_profiles())
httr::with_verbose(get_ga("XXXXXXXX"))

Post the traceback() and sessionInfo() output also may be helpful.

To report a bug please type into R:

utils::bug.report(package = "RGA")

Copy Link

Version

Install

install.packages('RGA')

Monthly Downloads

228

Version

0.4.2

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

April 8th, 2016

Functions in RGA (0.4.2)

ga

Lists all columns for a Google Analytics core report type
get_custom_dimension

Custom Dimensions
get_goal

Goals
get_custom_metric

Custom Metrics
authorize

Authorize the RGA package to the user's Google Analytics account using OAuth2.0
get_experiment

Experiments
get_mcf

Multi-Channel Funnels Reporting API
get_filter

Filters
get_ga

Core Reporting API
firstdate

First Date
get_realtime

Real Time Reporting API
list_accounts

Accounts
list_custom_metrics

Custom Metrics
list_custom_dimensions

Custom Dimensions
list_custom_data_sources

Custom Data Sources
get_webproperty

Web Properties
get_unsampled_report

Unsampled Reports
list_dimsmets

Lists all the dimensions and metrics for a particular report type
get_upload

Uploads
get_profile

Views (Profiles)
list_uploads

Uploads
RGA-package

A Google Analytics API client for R
list_filters

Filters
list_profiles

Views (Profiles)
list_segments

Segments
list_experiments

Experiments
list_unsampled_reports

Unsampled Reports
list_goals

Goals
shiny_dimsmets

The Shiny Dimensions & Metrics Explorer
list_webproperties

Web Properties