Dear all
i was using
Google.GData.An alytics
and
Google.GData.Cl ient
to retrieve some google analytics report in my web application and the code was as follows
This code was working perfectly fine util 5 days back and i have been using this code for the last 7 or 8 months, but now suddenly i am facing the error "Execution of authentication request returned unexpected result: 404".
When i searched google.
I have searched alot but could not find any solution.
Any help or guidance will be greatly appreciated.
Regards:
Mudassir
i was using
Google.GData.An alytics
and
Google.GData.Cl ient
to retrieve some google analytics report in my web application and the code was as follows
Code:
string username = "abc@gmail.com"; string password = "myPasswordHere"; string profileId = "ga:88376970"; string _from = Convert.ToDateTime(dtpFrom.SelectedDate.Value.ToString()).ToString("yyyy-MM-dd"); string _to = Convert.ToDateTime(dtpTo.SelectedDate.Value.ToString()).ToString("yyyy-MM-dd"); AccountQuery AccountsQuery = new AccountQuery(); service = new AnalyticsService("DoogalAnalytics"); service.setUserCredentials(username, password); try { DataFeedUrl = "https://www.google.com/analytics/feeds/data"; DataQuery PageViewQuery = new DataQuery(DataFeedUrl) { Ids = profileId , Metrics = "ga:pageviews", Dimensions = "ga:date", Sort = "ga:date", GAStartDate = _from, GAEndDate = _to }; StringBuilder strData = new StringBuilder(); int maxValue = 0; int today = 0; List<int> gList = new List<int>(); foreach (DataEntry entry in service.Query(PageViewQuery).Entries) { var value = entry.Metrics.First().IntegerValue; gList.Add(value); maxValue = value > maxValue ? value : maxValue; today = entry.Metrics.Last().IntegerValue; strData.AppendFormat("{0},", value); } } catch (Exception ex) { Response.Write(ex.Message.ToString()); }
When i searched google.
I have searched alot but could not find any solution.
Any help or guidance will be greatly appreciated.
Regards:
Mudassir