Need help with RGoogleAnalytics?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

209 Stars 143 Forks 108 Commits 25 Opened issues


R Library to easily extract data from the Google Analytics API into R

Services available


Need anything else?

Contributors list

This repo is the new home for the RGoogleAnalytics library migrated from Google Code SVN

What is it

RGoogleAnalytics is a R Wrapper around the Google Analytics API. It allows fast and easy data extraction in R so that further statistical analysis can be run on the data

Key Features

  • Provides Access to v3 of the Google Analytics Core Reporting API

  • Ability to pull more than 10,000 rows of data in batches via pagination of queries

  • Ability to mitigate the effect of Query Sampling by splitting the date-range of queries and hence extract (nearly) unsampled data

  • Ability to cache data fetched from Google

  • Supports authorization via OAuth 2.0

  • In cases where queries are sampled, the output also returns the percentage of sessions that were used for the query


To get the current development version from github:

# require(devtools)


  • httr handles the underlying OAuth2.0 Authorization flow and the API requests

  • lubridate handles the date manipulation logic underlying Query Partitioning


Work on RGoogleAnalytics was started by Michael Pearmain at Google. He was supported by Nick Mihailowski (Google) and Vignesh Prajapati (Tatvic).

Tutorials and Use-cases

  • Basic tutorial to get started linking Google Analytics to an API pull
  • Under development

Important Links

  • List of Valid Dimension/Metric Combinations from the Google Analytics API Reference Guide

  • Query Feed Explorer allows you to test your queries for syntatical correctness. Once verified, the query parameters can then be copied to your R Script

  • Demo link on how to use this package to extract data from Google Analytics.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.