New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.4 googleapis #84

Closed
GoogleCodeExporter opened this Issue May 28, 2015 · 29 comments

Comments

Projects
None yet
2 participants
@GoogleCodeExporter
Copy link

GoogleCodeExporter commented May 28, 2015

Do you update your api for v2.4 changes? because now your api is not work .. i 
used gapi in a lot of my project ..

Original issue reported on code.google.com by luky...@gmail.com on 24 Aug 2012 at 12:09

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

¬¬
All my project stop of running, because I use gapi in every module that I have.
Update?

Original comment by marcelo2...@gmail.com on 26 Aug 2012 at 6:39

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

I have sucess on change this info in class:
  const account_data_url = 'https://www.googleapis.com/analytics/v2.4/management/accounts/~all/webproperties/~all/profiles'; //https://www.google.com/analytics/feeds/accounts/default
  const report_data_url = 'https://www.googleapis.com/analytics/v2.4/data'; //https://www.googleapis.com/analytics/v2.4/data

Original comment by vitor...@gmail.com on 27 Aug 2012 at 3:29

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

Yes Victor, it works perfectly, thanks a lot

Original comment by ad...@telaspatch.com on 28 Aug 2012 at 6:52

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

See more info in 
https://developers.google.com/analytics/devguides/config/mgmt/v2/mgmtFeedReferen
ce

Original comment by vitor...@gmail.com on 30 Aug 2012 at 11:13

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

[deleted comment]
2 similar comments
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

[deleted comment]
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

[deleted comment]
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

All recommendations made ​​by Victor, but getting all the same error:
Fatal error: Uncaught exception 'Exception' with message 'GAPI: Failed to 
request report data. Error: "GDatainsufficientPermissionsUser does not have 
permission to perform this operation"'
Maybe there are some nuances?

Original comment by serg.shi...@gmail.com on 4 Sep 2012 at 7:43

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

Perfect Victor!! This work perfectly. It was already getting worried about this 
bullshit! Fortunately I found the solution here.
Thanks a lot.

Original comment by davsamp...@gmail.com on 4 Sep 2012 at 12:29

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

You mentioned the fix, but I don't know what they means or how to "change" it. 
I find no code like that in my entire wordpress site.

Please explain your fix, so less-than-techies can understand.

thank you very much.

Original comment by theplrst...@gmail.com on 6 Sep 2012 at 10:18

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

All recommendations made ​​by Victor, but getting all the same error:
Fatal error: Uncaught exception 'Exception' with message 'GAPI: Failed to 
request report data. Error: "GDatainsufficientPermissionsUser does not have 
permission to perform this operation"'
Maybe there are some nuances?

Original comment by serg.shi...@gmail.com on 11 Sep 2012 at 9:09

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

Hey Vitor

I tried making the changes you suggest directly to gapi.class.php 

  const account_data_url = 'https://www.googleapis.com/analytics/v2.4/management/accounts/~all/webproperties/~all/profiles'; //https://www.google.com/analytics/feeds/accounts/default

  const report_data_url = 'https://www.googleapis.com/analytics/v2.4/data'; //https://www.googleapis.com/analytics/v2.4/data

I still see the same error however when PHP is parsed on server: 


PHP Fatal error:  Uncaught exception 'Exception' with message 'GAPI: Failed to 
request report data. Error: "GData
insufficientPermissionsUser does not have permission to perform operation for 
this profile."' in /var/www/gapi.class.php:218\nStack trace:\n#0 
/var/www/google.php(56):
gapi->requestReportData('3975771', Array, Array, 'date')\n#1 {main}\n  thrown 
in /var/www/gapi.class.php on line 218

Any ideas what might be wrong still or where to look?

thx
-colin

Original comment by colin.ca...@smartbox.com on 15 Sep 2012 at 10:16

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

HI guys, the links victor posted are gone... anyone know how to fix this error?
<?php

require 'gapi.class.php';

/* Set your Google Analytics credentials */
define('ga_account'     ,'myusername');
define('ga_password'    ,'mypassword');

$ga = new gapi(ga_account,ga_password);

$gaResult = $ga->requestAccountData();

foreach($gaResult as $result)
{
  printf("%-30s %15d\n", $result, $result->getProfileId());
}


This is my simple script i would just like to get some account data like the 
profile ID's ut i cant get past this problem. Please can someone help me I 
would be forever greatful

www.promatix.co.za

Original comment by icephixi...@gmail.com on 16 Sep 2012 at 9:35

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

This is the error I get:


Fatal error: Uncaught exception 'Exception' with message 'GAPI: Failed to 
request account data. Error: " Error 404 (Not Found)!!1 
*{margin:0;padding:0}html,code{font:15px/22px 
arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% 
auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > 
body{background:url(//www.google.com/images/errors/robot.png) 100% 5px 
no-repeat;padding-right:205px}p{margin:11px 0 
22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media 
screen and 
(max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right
:0}} 404. That’s an error. The requested URL 
/analytics/feeds/accounts/default?start-index=1&max-results=100 was not found 
on this server. That’s all we know. "' in 
/home/cbsclien/public_html/gapi/gapi.class.php:92 Stack trace: #0 
/home/cbsclien/public_html/gapi/example.account.php(9): 
gapi->requestAccountData(1, 100) #1 {main} thrown in 
/home/cbsclien/public_html/gapi/gapi.class.php on line 92

Original comment by icephixi...@gmail.com on 16 Sep 2012 at 10:40

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

everything work in terms of report data

requestReportData works BUT!!

requestAccountData doesnt work because google modified someting on their 
side... how can I modify the GAPI classs to be able to use requestAccountData

Original comment by icephixi...@gmail.com on 16 Sep 2012 at 10:42

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

thanks victor, finally got it working after i understood your changes.. if 
anyone wants the gapi class that works email me

Original comment by icephixi...@gmail.com on 17 Sep 2012 at 12:05

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

[deleted comment]
1 similar comment
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

[deleted comment]
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

Hey,

i want the gapi class that works, but you emailadress isn't complete.
Can you post it?

Original comment by suedhe...@mediaeller.de on 17 Sep 2012 at 12:58

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

It works here too on CodeIgniter. But for how long? any ideia?

Original comment by Alface...@gmail.com on 23 Sep 2012 at 7:06

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

hello
I had the same error,  the problem was that I used a wrong profile ID (I used 
the google analytic ID account ).
The correct profile ID is the one you can find in the query explorer after you 
authorized it.

http://ga-dev-tools.appspot.com/explorer/

Original comment by cortese....@gmail.com on 30 Sep 2012 at 4:37

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

const client_login_url = 'https://www.google.com/accounts/ClientLogin';
const account_data_url = 
'https://www.googleapis.com/analytics/v2.4/management/accounts/~all/webpropertie
s/~all/profiles'; //https://www.google.com/analytics/feeds/accounts/default
const report_data_url = 'https://www.googleapis.com/analytics/v2.4/data';

For those who use Wordpress I can not explain, why not use Wordpress. Look for 
codes of GAPI.
For my use, where do all manual queries have achieved successes.
If anyone knows the upgrade project at Google please do it, even if it is all 
correct.

-- Original: BR

Pra quem usa Wordpress eu não sei explicar, porque não uso Wordpress. Procure 
os códigos do gapi.
Para meu uso, onde faço todas consultas manuais tenho obtido sucessos.
Se alguém souber atualizar o projeto no Google faça-o por favor, se estiver 
mesmo tudo correto.

Original comment by vitor...@gmail.com on 5 Oct 2012 at 3:00

Attachments:

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

Vitor, I downloaded your class_gapi.php but still have the error:

'GAPI: Failed to request report data. Error: "GDatainsufficientPermissionsUser 
does not have sufficient permissions for this profile."'

Very frustrating .. hoping you can shed some light.

Original comment by ars...@webmechanix.com on 1 Nov 2012 at 3:10

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

[deleted comment]
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

Hey guys I do not know if anyone still have this 
"GDatainsufficientPermissionsUser .." problem, but the thing is: The 'id' you 
need to insert to fetch data is NOT the profile id you find ind Google 
Analytics dashboard (UI-xxxx-x), but the ID you can get by defining your 
ga_email and ga_password and doing the following:

$ga = new gapi(ga_email,ga_password);
foreach($ga->getResults() as $result) {
     echo $result . '  Profile ID: ' . $result->getProfileId() . "<br />";
    } 

-- pt_BR

Fala galera,

Eu não sei se alguém ainda está com o problema do 
"GDatainsufficientPermissionsUser ..", mas a questão é que o número (id) 
necessário para pegar os dados não é o UI-xxxx-x, encontrado no perfil da 
conta no painel do Google Analytics, mas sim o id que você pode obter com 
apenas o 'ga_email' e 'ga_password' corretos.

A partir de então, use estas linhas de código para obter seu 'profile_id' 
correto: 

$ga = new gapi(ga_email,ga_password);
foreach($ga->getResults() as $result) {
     echo $result . '  Profile ID: ' . $result->getProfileId() . "<br />";
    } 

Espero ter ajudado.

Abs,

Original comment by borisvam...@gmail.com on 21 Dec 2012 at 6:11

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

$ga = new gapi('email@stuff.com','..');
$ga->requestReportData(YOUR_ANALYTICS_PROFILE_ID,  
     array('browser','browserVersion'),array('pageviews','visits'));

YOUR ID: open analytics of some page and THIS IS YOUR ID:
    XXXXXX after "p":
    https://www.google.com/analytics/web/#home/a11345062w43527078pXXXXXXXX/

Original comment by id.psy...@gmail.com on 22 Jan 2013 at 12:27

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

Note: The Core Reporting API does not provide access to account and profile 
information. Use the Management API to access Google Analytics configuration 
data.

https://developers.google.com/analytics/devguides/reporting/core/v3/

Original comment by swirlana...@gmail.com on 6 Feb 2013 at 2:32

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

Simple solution!!
I had the same error,  the problem was that I used a wrong profile ID (I used 
the google analytic ID account ).
The correct profile ID is the one you can find in the query explorer after you 
authorized it.

http://ga-dev-tools.appspot.com/explorer/

Original comment by jeane...@gmail.com on 21 Oct 2013 at 5:48

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented May 28, 2015

hello can i fetch google analytics data using peoperty id , profile id and 
account id and this all items of other gmail account and i login using other 
account pls tell me about this

Original comment by seo.anal...@gmail.com on 8 Mar 2014 at 5:46

@erebusnz erebusnz closed this May 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment