I am just trying to get product sales by number of items sold and the total revenue. I am using Google APIs client library for PHP: https://github.com/google/google-api-php-client.git
I am able to get one metric per product, eg I can list all the products that had a purchase in the last week. Or I can get the total revenue of sales per product in the last week. What I am trying to do is get both at the same time.
So what I tried was...
$sessions = new Google_Service_AnalyticsReporting_Metric();
$sessions->setExpression("ga:itemQuantity,ga:itemRevenue");
FYI the rest of the code is pretty much exactly the same as per the https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/service-php#3_setup_the_sample example, I have obviously added in my details and it all works fine if I do just ga:itemQuantity or ga:itemRevenue.
Any documentation I ready says to just comma separate the metrics but it just dies, the whole page doesn't even load so I get no errors etc..
Is what I want to do possible? If so how do I go about doing it?