Anita Owens

View Original

How to connect Google Analytics to R using the googleAnalyticsR package

Sometimes, it's just easier to access your Google Analytics (GA) data through it's API especially if you want to do any statistical analysis. I find that sometimes the GA interface can be slow or unresponsive not to mention it takes time to access the report you want and then you need to export your data. Sometimes I dread having to go into GA.

However, using the API, can save a lot of time especially if you use R. The googleAnalyticsR package makes getting your GA data super easy! Here's how to go about accessing your data through R.

See this content in the original post

Now, if you have never used the API before, you may need to get an authorization token. Visit Google to find out more about authorization requests. You can also go here to find out how to create a client ID for R or R Studio.

See this content in the original post

In order to get the API names you will need you can use the Query Explorer which will allow you to practice your queries or the Dimensions & Metrics Explorer.
 

See this content in the original post
See this content in the original post
See this content in the original post
See this content in the original post
See this content in the original post
See this content in the original post
See this content in the original post
See this content in the original post

With the metrics and dimensions explorer, you now have the power to access your analytics data however you like. My data tells me I have a lot of work to do. Happy analyzing!