Reputation: 19
I want to use Google.Apis.AnalyticsReporting.v4 to ETL the google analytics data to our data warehouse. It is worthy to mention that I use SSIS (Microsoft Integration Service) and use Script Component (C#) as task to ETL aforementioned data.
I found this task very hard and find these references,
Use Google Analytics API to show information in C#
It used Google.Apis.Analytics.v3 for doing this and it is not V4. First of all, I create service account,
and save service account email and .p12 key, after that I use this method,
Analytics Reporting v4 with API key
that use Google.Apis.AnalyticsReporting.v4 but many references have errored and they are old, such using Google.Apis.Services;
I confused and want to know the code for ETL the GA data by C#. Appreciate to help me on this issue. I want to ETL metrics like "session" and dimension like "campaign"
Upvotes: 2
Views: 1621
Reputation: 116986
I was never able to get it to work using a scripting component because of the .net version of the dlls. The library dlls are around .net 4.5 and as far as far as i could see most versions of MS Sql server dont support higher then .net 4.0. You also have to figure out where the dlls need to be in order for ssis to find them. If your going to get it to work your going to need all the dlls from the library as you cant use nuget install. i would start with the basic tutorial get that working as a console application then copy it over to SSIS and put that into your scripting component you need all the using and their corresponding dlls there is a lot of them.
Google apis.services isnt old its the auth part of the library it just hasnt needed to be changed.
What I have done was create a custom component to connect to Google analytics. The main issue I had was the dlls and the .net framework. I was never able to use the Google .net client library. I was only able to get this working by manually creating my own Google analytics library targeting .net 3.5 and using Oauth2 rather than service account.
Coding my own service account authentication code has so far escaped me. I beleave i have a very old open question here on stack asking how to get it to work.
Upvotes: 1