title: Google Analytics API in C# -Execution of request failed: https://www.google.com/analytics/feeds/accounts/default
body: <p>i want to access Google analytic data and i got samples from Google data API SDK. but these coding does not working and throws exception </p>
  
  <blockquote>
    <p>Execution of request failed: <a href="https://www.google.com/analytics/feeds/accounts/default" rel="nofollow noreferrer">https://www.google.com/analytics/feeds/accounts/default</a></p>
  </blockquote>
  
  <p>so i found the reason for this is Google updated it's to v3.0. i searched updated coding for the C#, but i couldn't find solution for this.  </p>
  
  <p>i have same problem as this, but with C#. 
  <a href="https://stackoverflow.com/questions/12113204/exception-thrown-when-using-gdata-net-analytics-api">Exception thrown when using GData .NET Analytics API</a></p>
  
  <p>i tried coding with doing changes as follows as it says in Google developer - <a href="https://developers.google.com/analytics/resources/articles/gdata-migration-guide#appendix_a" rel="nofollow noreferrer">https://developers.google.com/analytics/resources/articles/gdata-migration-guide#appendix_a</a></p>
  
  <pre><code>string userName = this.Username.Text;
  string passWord = this.Password.Text;
  
  AnalyticsService service = new AnalyticsService("AnalyticsSampleApp");
  service.setUserCredentials(userName, passWord);
  string googleAccountWebId = "AIXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  string profileFeedUrl = "https://www.googleapis.com/analytics/v2.4/data?key=" + googleAccountWebId;
  
  DataQuery query2 = new DataQuery(profileFeedUrl);
  query2.Ids = "12345678";
  query2.Metrics = "ga:visits";
  query2.Sort = "ga:visits";
  query2.GAStartDate = DateTime.Now.AddMonths(-1).AddDays(-2).ToString("2011-08-01");
  query2.GAEndDate = DateTime.Now.ToString("2013-09-01");
  query2.StartIndex = 1;
  
  
  DataFeed data = service.Query(query2);
  
  
  foreach (DataEntry entry in data.Entries)
  {
      string st=entry.Metrics[0].Value;       
  }
  </code></pre>
  
  <p>but even i change this it throws exception in  </p>
  
  <blockquote>
    <p>DataFeed data = service.Query(query2);</p>
  </blockquote>
  
  <p>this line. exception is as follows:</p>
  
  <blockquote>
    <p>Execution of request failed: <a href="https://www.googleapis.com/analytics/v2.4/data?key=AIXXXXXXXXXXXXXXXXXXXXXX-8&amp;start-index=1&amp;end-date=2013-09-01&amp;ids=12345678&amp;metrics=ga:visits&amp;sort=ga:visits&amp;start-date=2011-08-01" rel="nofollow noreferrer">https://www.googleapis.com/analytics/v2.4/data?key=AIXXXXXXXXXXXXXXXXXXXXXX-8&amp;start-index=1&amp;end-date=2013-09-01&amp;ids=12345678&amp;metrics=ga:visits&amp;sort=ga:visits&amp;start-date=2011-08-01</a></p>
  </blockquote>
  
  <p>i'm using following DLL</p>
  
  <pre><code>Google.GData.Analytics.dll
  Google.GData.Client.dll
  Google.GData.Extensions.dll
  </code></pre>
  
  <p><strong>My Questions :</strong></p>
  
  <ol>
  <li><p>how can i correct this error?</p></li>
  <li><p>how can i access Google analytic data? is this correct? or else what is the way to doing it?? 
  for a example i want to get available ProfileId and their values. (Title and Page views)</p></li>
  </ol>