Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The API https://www.google.com/analytics/feeds/data is not working

The API which we are using to fetch top performing URLs is not working now.

Details below:

https://www.google.com/analytics/feeds/data 
?start-date=2015-05-26 
&end-date=2015-05-27 
&dimensions=ga:pageTitle,ga:pagePath &metrics=ga:pageviews,ga:visitBounceRate,ga:avgTimeOnSite,ga:uniquePageviews\ 
&sort=-ga:pageviews\ 
&filters=ga:pagePath=@-news- 
&max-results=10 
&ids=ga:5180657 
&prettyprint=true 

Authorisation using CURL:

https://www.google.com/accounts/ClientLogin -s -d 
[email protected] -d Passwd=****** -d accountType=GOOGLE -d 
source=curl-accountFeed-v1 -d service=analytics 

Response from Google:

<?xml version="1.0" encoding="UTF-8"?> 
<errors xmlns="http://schemas.google.com/g/2005"> 
<error> 
<domain>GData</domain> 
<code>authError</code> 
<location type="header">Authorization</location> 
<internalReason>Invalid Credentials</internalReason> 
</error> 
</errors> 

Requesting your assistance.

Regards, -Amalan.

like image 346
Amalan Gunasekaran Avatar asked Dec 21 '25 08:12

Amalan Gunasekaran


1 Answers

Client Login has been deprecated. You should migrate your code to use one of the OAuth 2.0 Scenarios.

The Hello Analytics APIs quickstart guides have been updated recently. You should see if you can get them working.

like image 145
Matt Avatar answered Dec 23 '25 22:12

Matt