0

Simple question:

I was using Google Analytics v2.3 under .NET -- until August 23rd, 2012.

I've downloaded the Google Data API msi version 2.1.0.0.

I've gotten the source code from Subversion.

Which sample (if any) shows how to implement the new version 3.0 account retrieval and API method invocations?

This was my old code.

    public Dictionary<string, string> GetAccounts_old(string username, string password, string myservice)
    {

        AccountQuery feedQuery = new AccountQuery();
        AnalyticsService service = new AnalyticsService(myservice);
        Dictionary<string, string> accounts = new Dictionary<string, string>();

        try
        {
            if (!string.IsNullOrEmpty(username))
            {
                service.setUserCredentials(username, password);
            }
            foreach (AccountEntry entry in service.Query(feedQuery).Entries)
            {
                accounts.Add(entry.ProfileId.Value, entry.Title.Text);
            }
        }
        catch (Exception ex)
        {
            throw new Exception("There was a problem: " + ex.Message);
        }
        return accounts;
    }
Kiquenet
  • 14,494
  • 35
  • 148
  • 243

2 Answers2

1

The Google Analytics API v3 is not GData-based and is supported by a different library: http://code.google.com/p/google-api-dotnet-client/

A sample will be added to http://code.google.com/p/google-api-dotnet-client/wiki/APIs#Google_Analytics_API

Claudio Cherubino
  • 14,896
  • 1
  • 35
  • 42
0

Here is the link to my c# api v3 code it is part of the answer section [Automated use of google-api-dotnet-client with OAuth 2.0][1] [1]: Automated use of google-api-dotnet-client with OAuth 2.0 I have not tried to pull account information please post any code changes you make.

Community
  • 1
  • 1