Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample for how to use Google.Apis.Analytics.v3.dll #213

Closed
GoogleCodeExporter opened this issue Apr 14, 2015 · 27 comments
Closed

Sample for how to use Google.Apis.Analytics.v3.dll #213

GoogleCodeExporter opened this issue Apr 14, 2015 · 27 comments
Assignees

Comments

@GoogleCodeExporter
Copy link

Which Google API and version (e.g. Google Tasks API version 1)?
Google Analytics V3

What should the sample demonstrate (e.g. using OAuth2, using a specific
feature of that API)?
Using OAuth2 to log in and how to query analytics data


Platform (e.g. Windows, Mono, Silverlight, WP7)?
Windows, .net 4, C#, server application - unattended

External references, such as API reference guide?


Please provide any additional information below.
We're trying to migrate to the new version of the API but cannot find any .net 
samples to actually use the api dlls for .net


Original issue reported on code.google.com by st...@encorewebworks.com on 29 May 2012 at 2:52

@GoogleCodeExporter
Copy link
Author

Sorry this is currently a low priority for our team.  You can find 
documentation for the Analytics Api at 
https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtAccountGuid
e and there are alot of samples for the .net client. combining the two you 
should be able to work out what is needed.

Sorry we could not be more help.

Original comment by davidwat...@google.com on 28 Jul 2012 at 5:00

  • Added labels: Component-Samples, Priority-Low, Type-Enhancement

@GoogleCodeExporter
Copy link
Author

As long as it's low priority for your team, using the v3 API will be low 
priority for developers. We will keep using the older APIs, for now.
Accessing reporting data, from an unattended process, should be a simple and 
straightforward task. It seems like you guys at Google managed to make it a 
complex and nearly impossible task (mostly due to complex OAuth requirements). 
To prove me wrong, please provide a FULL working code example for developers.

Original comment by agento...@gmail.com on 27 Sep 2012 at 9:12

@GoogleCodeExporter
Copy link
Author

We are interested as well. Mostly Silverlight Examples.

Original comment by paulo.aa...@gmail.com on 1 Oct 2012 at 3:30

@GoogleCodeExporter
Copy link
Author

We are interested too, in ASP.net/C# examples.

Original comment by titusrev...@gmail.com on 16 Oct 2012 at 10:43

@GoogleCodeExporter
Copy link
Author

[deleted comment]

1 similar comment
@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

I completly agree with comment#2 above. You should provide sample code for 
every new API version you launch, for every langauge that is supported. Please 
provide FULL working .NET code example for developers.

Original comment by kbon...@gmail.com on 31 Oct 2012 at 9:32

@GoogleCodeExporter
Copy link
Author

Start to work on ASP.NET MVC sample for the analytics API

Original comment by pele...@google.com on 18 Dec 2012 at 10:43

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Put me on the list as needing a sample for server authentication when pulling 
analytics data.

Original comment by l...@amone.com on 15 Jan 2013 at 6:46

@GoogleCodeExporter
Copy link
Author

me 2!

Original comment by aliva...@gmail.com on 19 Feb 2013 at 12:18

@GoogleCodeExporter
Copy link
Author

me 2

Original comment by hers...@gmail.com on 28 Mar 2013 at 11:26

@GoogleCodeExporter
Copy link
Author

Here's an example in C#:

http://stackoverflow.com/a/13013265/371228

And one in VB.NET:

http://stackoverflow.com/a/15414830/371228

Original comment by bdes...@gmail.com on 28 Mar 2013 at 1:06

@GoogleCodeExporter
Copy link
Author

analytic example with latest library is very very requested all over the web

Original comment by realizza...@gmail.com on 21 Nov 2013 at 12:07

@GoogleCodeExporter
Copy link
Author

BE aware that it's an open source project.
You can start a sample on your own, and I'll review it, with that will be able 
to publish a new sample together. You will have my support on that one :)

Original comment by pele...@google.com on 22 Nov 2013 at 2:42

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Respectfully, status as an open source project has nothing to do with support. 
Saying it does is tantamount to saying "try to build, post your work, and we'll 
give hints if you're wrong" ...

I have found v3 APIs to be poorly documented and fragmented. Examples are best 
viewed in java because this is Google's choice. 

One wonders if the best route to go would not simply be the REST API, but I 
have to say that auth-related stuff complicates ... my neophyte status 
notwithstanding ... 

Original comment by tom.win...@pressman.co on 26 Nov 2013 at 5:19

@GoogleCodeExporter
Copy link
Author

If I may point the Google API folks to this page ... feedback, albeit dated 
from 2012 and 2011, is very revealing. It seems you folks are not listening to 
any feedback, nor are you redressing any deficiencies. 

"Hi, I know it’s a while since this article was written but I really want to 
say how much I appreciated finding it the other day. Although what I am doing 
with the google API is slightly different (domain admin stuff rather than 
analytics), this article helped me get my head round the basics and get to a 
position where I could use the API at all rather than just feeling defeated. 
That google documentation, wow, it was like going round and around in a subway 
system where all the signs are in ancient Ugaritic and every station looks 
similar but not quire the same and you can never be sure if you’re back where 
you started. Saved me, dude."

When curl proves to be the technology to which users retreat just because 
wading through the morass of useless and incomplete documentation becomes such 
a waste of time, then architects and developers of the analytics platform 
really should pay attention ... 

Check out http://www.visualab.org/index.php/using-google-rest-api-for-analytics

Original comment by tom.win...@pressman.co on 26 Nov 2013 at 6:05

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Finally ... as I find the quote from #16 to be valid even today ... does Google 
expect folks to use the GA API v3 just because it comes from Google?

Done for now, but I'm sure to rant out of a growing frustration with what I see 
re GA API v3 ...

Original comment by tom.win...@pressman.co on 26 Nov 2013 at 6:24

@GoogleCodeExporter
Copy link
Author

A working .net sample is definitely required. Please keep me posted. 

Original comment by atul.gha...@gmail.com on 20 Dec 2013 at 8:26

@GoogleCodeExporter
Copy link
Author

Hi, Im looking to work out using the Google API v3 if the data returned is 
"Sampled" data or not.  What property shows if the data returned is "Sampled".

Thanks!!

Original comment by robert.m...@gmail.com on 29 Jan 2014 at 8:16

@GoogleCodeExporter
Copy link
Author

Hey Folks,

I was checking out the analytics API yesterday and noticed how undocumented it 
is and no samples etc. 

Any ways, I have created a library that you could use to access analytics 
easily with couple of lines and make direct databinding to DataTables for data 
returned it's open source on the github so feel free to contribute :)

https://github.com/rmostafa/DotNetAnalyticsAPI


For the 
#14 pele...@google.com

I think this is a good start to refer your users too since 

Sample of usage 

Analytics.AnalyticsManager manager = new 
Analytics.AnalyticsManager(Server.MapPath("~/bin/privatekey.p12"), 
"YOUR_EMAIL");
            manager.LoadAnalyticsProfiles();


 List<Analytics.Data.DataItem> metrics = new List<Analytics.Data.DataItem>();
            metrics.Add(Analytics.Data.Visitor.Metrics.visitors);
            metrics.Add(Analytics.Data.Session.Metrics.visits);
            List<Analytics.Data.DataItem> dimensions = new List<Analytics.Data.DataItem>();
            dimensions.Add(Analytics.Data.GeoNetwork.Dimensions.country);
            dimensions.Add(Analytics.Data.GeoNetwork.Dimensions.city);


              System.Data.DataTable table = manager.GetGaDataTable(DateTime.Today.AddDays(-3), DateTime.Today, metrics, dimensions, null, metrics);

There is direct code mapping for All Google API Reporting commands categorized 
same way like the API so you could it even without reading the API 
Documentation at all since all features there are documented in the attributes, 
I have wrote code that parsed the complete api documentation and resourced the 
Metrics, Dimensions, Calculated Features in an XML that i generated from 
physical classes that you could use directly like the example above it's fun to 
play with :) enjoy


https://github.com/rmostafa/DotNetAnalyticsAPI

Original comment by ramy.mos...@gmail.com on 30 Jan 2014 at 12:12

@GoogleCodeExporter
Copy link
Author

Yes, a good working .NET sample is really required, especially for the latest 
GA Analytics libraries (there are already for Java, PHP and Python), including 
Real Time Reporting!

Original comment by i...@webtech24.com on 16 Feb 2014 at 1:54

@LindaLawton
Copy link
Collaborator

console sample project here Google Analytics C# sample

@fandrei
Copy link

fandrei commented Jul 14, 2016

@LindaLawton, this sample fails to build.

@LindaLawton
Copy link
Collaborator

@fandrei I need to upgrade all my sample projects to .net 4.5 I will see if i can do it while i am on vacation. My bet is that is the problem you are having.

@fandrei
Copy link

fandrei commented Jul 14, 2016

@LindaLawton, thanks.
Particularly, Daimto.GoogleSample.Analytics fails. Looks like some problems with package refs.

@netdroidvamshi
Copy link

still it`s fail to build..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants