I try to fetch data from google analytics using the google api class in php. I checked serval google groups and found out that the error comes most of the time when Curl is off and SSL is off too, but I checked in the phpinfo() and booth are running. Anyone an idea what it could be? On my local server it's running, but on the webserver it's not running.
<br />
<b>Fatal error</b>: Uncaught exception 'Exception' with message 'GAPI: Failed to authenticate user. Error: "Error=BadAuthentication
Url=https://www.google.com/accounts/ServiceLogin?service=analytics#Email=mail
Info=WebLoginRequired
"' in /home/express/public_html/loggedIn/gapi.class.php:418
Stack trace:
#0 /home/express/public_html/loggedIn/gapi.class.php(62): gapi->authenticateUser('mail', 'pw')
#1 /home/express/public_html/loggedIn/request.php(10): gapi->__construct('mail', 'pw')
#2 {main}
thrown in <b
>/home/express/public_html/loggedIn/gapi.class.php</b> on line <b>418</b><br />
Some Google APIs charge for usage, and you need to enable billing before you can start using these APIs. Enabling billing for the APIs that your projects use also has other advantages: Some APIs allow free usage up to a courtesy usage limit, and in some cases this free limit is increased when you enable billing.
So after browsing more groups, a friend found out that you need to approve your account before you start fetching data for the first time at this url
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With