Skip to content
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

call to getTotalResults results in an error #79

Closed
GoogleCodeExporter opened this issue May 28, 2015 · 21 comments
Closed

call to getTotalResults results in an error #79

GoogleCodeExporter opened this issue May 28, 2015 · 21 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Call $gapi->requestReportData(...); to retrieve data from GA
2. Call $gapi->getTotalResults(); to get the total results so that you know 
whether to call requestReportData again with a higher starting index.

What is the expected output? What do you see instead?
The expected output I would like to see is the total amount of results that GA 
has returned. Instead, I get the following error:
No valid root parameter or aggregate metric called "TotalResults"

What version of the product are you using? On what operating system?
I'm using GAPI version 1.3

Please provide any additional information below.
I searched through the actual results GAPI retrieves from GA and the total 
results were in the XML-results. So there was no problem there. However, I 
discovered that they are using a different OpenSearch namespace. Previously 
they were using "http://a9.com/-/spec/opensearchrss/1.0/", and they are now 
using "http://a9.com/-/spec/opensearch/1.1/". Replacing the old namespace 
definition with the new one solves the problem.

Original issue reported on code.google.com by blizz...@gmail.com on 9 Aug 2012 at 7:32

@GoogleCodeExporter
Copy link
Author

Hi,

I tried this modification in the gapi class and it fixes the issue for me:

http://wordpress.org/support/topic/plugin-google-analytics-visits-no-valid-root-
parameter-or-aggregate-metric-called-totalresults

So the only thing you have to do in the gapi.class.php file is update this line 
twice to the correct namespace:


//$open_search_results = 
$xml->children('http://a9.com/-/spec/opensearchrss/1.0/');
$open_search_results = $xml->children('http://a9.com/-/spec/opensearch/1.1/');

Good luck!

Chris

Original comment by chris.de...@gmail.com on 14 Aug 2012 at 9:43

Attachments:

@GoogleCodeExporter
Copy link
Author

Awesome Chris - you made my day :-)

Regards

Morten Ross
http://www.ross.no/communicate

Original comment by mor...@ross.no on 15 Aug 2012 at 11:56

@GoogleCodeExporter
Copy link
Author

This is exactly what the fault is.  Is this likely to get patched?

Original comment by nozze...@gmail.com on 17 Aug 2012 at 7:20

@GoogleCodeExporter
Copy link
Author

Thianks a lot. Very useful to me.

Original comment by wangyp...@gmail.com on 11 Sep 2012 at 8:27

@GoogleCodeExporter
Copy link
Author

I'm still having this problem after making the above changes.  Any suggestions?

Original comment by richards...@gmail.com on 6 Feb 2013 at 5:20

@GoogleCodeExporter
Copy link
Author

me too still getting it. now change after above line replacing.

Original comment by shezee...@gmail.com on 24 Feb 2013 at 7:55

@GoogleCodeExporter
Copy link
Author

Changes don't have any effect for me too. Anybody got any other solution to the 
probem?

Original comment by ivan999i...@gmail.com on 26 Feb 2013 at 12:46

@GoogleCodeExporter
Copy link
Author

For whom they still have problem, try to download attached gapi.class.php file 
and replace with your old one.

Original comment by suncod...@gmail.com on 28 Feb 2013 at 10:07

@GoogleCodeExporter
Copy link
Author

It stopped working yesterday I think, and replacing with attached file found 
here does not resolve the problem.


Original comment by mor...@ross.no on 28 Feb 2013 at 1:03

@GoogleCodeExporter
Copy link
Author

Also if I made this changes to 1.3 version, the examples are working:

@@ -29,7 +29,7 @@
   const http_interface = 'auto'; //'auto': autodetect, 'curl' or 'fopen'

   const client_login_url = 'https://www.google.com/accounts/ClientLogin';
-  const account_data_url = 
'https://www.google.com/analytics/feeds/accounts/default';
+  const account_data_url = 
'https://www.googleapis.com/analytics/v2.4/management/accounts/~all/webpropertie
s/~all/profiles';
   const report_data_url = 'https://www.google.com/analytics/feeds/data';
   const interface_name = 'GAPI-1.3';
   const dev_mode = false;
@@ -267,7 +267,7 @@
     $account_root_parameters['generator'] = strval($xml->generator);
     $account_root_parameters['generatorVersion'] = strval($xml->generator->attributes());

-    $open_search_results = 
$xml->children('http://a9.com/-/spec/opensearchrss/1.0/');
+    $open_search_results = 
$xml->children('http://a9.com/-/spec/opensearch/1.1/');

     foreach($open_search_results as $key => $open_search_result)
     {
@@ -322,7 +322,7 @@
     $report_root_parameters['generator'] = strval($xml->generator);
     $report_root_parameters['generatorVersion'] = strval($xml->generator->attributes());

-    $open_search_results = 
$xml->children('http://a9.com/-/spec/opensearchrss/1.0/');
+    $open_search_results = 
$xml->children('http://a9.com/-/spec/opensearch/1.1/');

     foreach($open_search_results as $key => $open_search_result)
     {

Original comment by dan.ohne...@gmail.com on 21 Mar 2013 at 5:21

@GoogleCodeExporter
Copy link
Author

It works for me. Comment #10

Original comment by AndroidM...@gmail.com on 26 Apr 2013 at 2:27

@GoogleCodeExporter
Copy link
Author

#10 comment worked for me too. thanks.

Original comment by bueno.te...@gmail.com on 4 Jun 2013 at 1:09

@GoogleCodeExporter
Copy link
Author

#10 comment worked for me also!!

Original comment by countvi...@gmail.com on 26 Jun 2013 at 5:53

@GoogleCodeExporter
Copy link
Author

[deleted comment]

1 similar comment
@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

worked for me aswell

Original comment by kalaipri...@gmail.com on 29 Aug 2013 at 5:21

@GoogleCodeExporter
Copy link
Author

Comment #10! :)

Original comment by hrvoje.g...@gmail.com on 29 Aug 2013 at 9:39

@GoogleCodeExporter
Copy link
Author

worked for me also!!

Original comment by gruposi...@gmail.com on 4 Oct 2013 at 8:58

@GoogleCodeExporter
Copy link
Author

Word me as well! Thanks for that #10

Original comment by kandiweb...@gmail.com on 7 Jul 2014 at 12:42

@GoogleCodeExporter
Copy link
Author

Awesome! thanks a lot.

Original comment by sezertu...@gmail.com on 1 Aug 2014 at 11:33

@GoogleCodeExporter
Copy link
Author

Thanks! XD 

Original comment by cleopatr...@gmail.com on 27 Aug 2014 at 1:09

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

No branches or pull requests

2 participants