Google Analytics API with C#

Google-Analytics-iconHave you been trying to connect your website or application to Google Analytics? Would you like to be able to show your users Google Analytics data for your website?   If you are you trying to work with the Google Analytics API in C# .net I might be able to help.   In this tutorial series we will be looking into how to connect to Google Analytics API using OAuth2, as well as a service account. I will show you how to get a list of the users Accounts to display to them from the Google Analytics Management API. Using the Meta-data API you will be able to get a full up to date list of the current available metrics and dimensions to display to your users. Finally we will look at getting data back from Google Analytics by using either the Real-time API or the Core reporting API.

Google Analytics API – Introduction

The Google Analytics API has become very extensive over the last two years. The API is in fact more the one API and those APIs are split into sevral catagories.

Collection APIs & SDKs

The collection apis are used to gather data for Google Analytics, the JavaScript on your website is using the Collection API.

Configuration APIs

Google Analytics provides programmatic access and management to configuration data through the Management API and account creation capabilities through the Provisioning API. Some of these are still in beta and you will have to request access to use them first.

Reporting APIs

Google Analytics provides a simple and powerful APIs to retrieve report data from Google Analytics. This being the Reporting API , Real-time API and Meta-Data APIs.

Google Analytics API – Seven part Tutorial Series

  1. Google Analytics API Authentication with C# OAuth2 vs Service Account
  2. Google Analytics Management API with C#Accounts, Web Properties and views(Profiles)
  3. Google Analytics Management API with C# – Advanced
  4. Google Analytics Management API with C# – Upload
  5. Google Analytics Meta-Data API with C# – Showing current dimensions and metrics
  6. Google Analytics Real-Time API with C# – Whats happening now!
  7. Google Analytics Core Reporting API with C#  – Its all about the data baby!


You should now understand the different Google Analytics APIs, and know where you can find tutorials on how to use them.

The a sample project for working with Google Analytics API on GitHub