Using Google Analytics with R

Some code to read in data from Google Analytics data. Some modifications include adding the SSL authentication code and modifying (in bold) the table.id parameter to choose correct website from a GA profile with many websites

It provides access to Google Analytics data natively from the R Statistical Computing programming language. You can use this library to retrieve an R data.frame with Google Analytics data. Then perform advanced statistical analysis, like time series analysis and regressions.

Hi! I’m using your post here as a reference to access my Google Analytics data natively from R. However, I receive an error message “Error in GetDataFeed(query.builder$to.uri()) : 401 Unauthorized” and the script stops running. I’m wondering if the script you published above still works, as I believe this issue is tied to the deprecation of the v2 of the Google Analytics Data Export API Data Feed and the Oauth 2 requirement. Do you know of a workaround? Thanks. (https://groups.google.com/d/topic/google-analytics-data-export-api/ACj9Nlg_E20/discussion)