andeedee / gapi-google-analytics-php-interface

Automatically exported from code.google.com/p/gapi-google-analytics-php-interface
0 stars 0 forks source link

Error when using 'uniquePageviews' and 'visits' - Fine when using them separately #20

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
$ga->requestReportData(ga_profile_id,'pagePath',array('pageviews','uniquePagevie
ws','visits'));
2.
3.

What is the expected output? What do you see instead?
Fatal error: Uncaught exception 'Exception' with message 'GAPI: Failed to
request report data. Error: "Illegal combination of dimensions and metrics"

What version of the product are you using? On what operating system?
Using it on web server (freeBSD i think)

Please provide any additional information below.

Original issue reported on code.google.com by ja...@rentedsmile.com on 7 Oct 2009 at 11:48

GoogleCodeExporter commented 9 years ago
i just received a similar error message...

"GAPI: Failed to request report data. Error: "Illegal combination of dimensions 
and
metrics""

...when i tried to include "visitors" as a metric:

$ga->requestReportData(ga_profile_id,array('hostname'),array('pageviews','visits
','visitors'),null,'hostname
=@ example.com','2009-10-01','2009-10-31');

the above works with just 'pageviews' and 'visits'. i can create a custom 
report in
GA that allows for "hostname" dimension with these three metrics. so why can't i
retrieve the same using GAPI?

thank you!

Original comment by indiege...@gmail.com on 1 Nov 2009 at 9:24

GoogleCodeExporter commented 9 years ago
I get a similar error when trying to query for pagePath

$filter = '/contact-us.php';

$ga->requestReportData(ga_profile_id,'pagePath',array('pageviews','uniquePagevie
ws','visits'),'-visits',$filter);

GAPI: Failed to request report data. Error: "Invalid value for filters 
parameter: /contact-us.php"

how do I get stats about a page?  this should be a basic operation right?

Original comment by sfrpweb...@gmail.com on 24 Nov 2009 at 11:57

GoogleCodeExporter commented 9 years ago
Hi indiegenus,

The restrict the ga:visitors with only time related dimension, see:
http://code.google.com/apis/analytics/docs/gdata/gdataReferenceValidCombos.html

You can try their testing playground here (will ask to connect your real ga 
account):
http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html

Valid Combination for visitors:
Dimension: ga:date,ga:day
Metrics: ga:visitors

visitors is a very limited bit in GA API call

Original comment by andrew.c...@gtempaccount.com on 17 Feb 2010 at 11:47