Before Google Analytic Update there api  this code works. 
  

        string userName = GAEmailAddress.ToString();//Its From Database
        string passWord = GAPassword.ToString();//Its From Database
       
        const string dataFeedUrl = 
"https://www.google.com/analytics/feeds/data";;
       
    
        AccountQuery query = new AccountQuery();
        AnalyticsService service = new AnalyticsService("AnalyticsApp");
        if (!string.IsNullOrEmpty(userName))
        {
            service.setUserCredentials(userName, passWord);
        }
        string str = "";
        try
        {
            AccountFeed accountFeed = service.Query(query);
            foreach (AccountEntry entry in accountFeed.Entries)
            {
                str = entry.ProfileId.Value;
            }
    
            DataQuery query1 = new DataQuery(dataFeedUrl);
            // Bounce Rate Calculations
            query1.Ids = str;
            query1.Metrics = "ga:visits,ga:bounces";//visitors
            query1.Sort = "ga:visits";
            query1.GAStartDate = 
DateTime.Now.AddMonths(-1).AddDays(-2).ToString("yyyy-MM-dd");
            query1.GAEndDate = 
DateTime.Now.AddDays(-3).ToString("yyyy-MM-dd");
            query1.StartIndex = 1;
    
      //Others code and other data for bound

I search  Find this link.

http://stackoverflow.com/questions/12104801/gapi-account-data-url-goes-to-404

I replace this link :

const string dataFeedUrl = "https://www.google.com/analytics/feeds/data";;

with:
 

    
https://www.googleapis.com/analytics/v2.4/management/accounts?start-index=1&max-results=100&key=API_KEY

But I still I gett error:

    Execution of request failed: 
https://www.google.com/analytics/feeds/accounts/default



    


I still search and find this link:

https://developers.google.com/analytics/devguides/reporting/core/v2/#register

As link says I replace :  

    https://www.googleapis.com/analytics/v2.4/data

But still I got error ? What I am missing here? Thanks.




-- 
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
To view this message on the web, visit
https://groups.google.com/d/msg/google-ajax-search-api/-/ARBkSmi1nvUJ
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en

Reply via email to