I have to retrieve as many different metrics from my GA ecommerce as I can all at once. I'm using google api ruby client for that. And keep getting an error:
"message"=>"Selected dimensions and metrics cannot be queried together."
for example, for this request:
result = client.execute(api_method: api_method.data.ga.get, parameters: {
'ids' => 'ga:95561781',
'start-date' => Date.new(2006,1,1).to_s,
'end-date' => Date.today.to_s,
'dimensions' => 'ga:source,ga:medium,ga:country,ga:transactionId,ga:affiliation,ga:productSku,ga:productName',
'metrics' => 'ga:sessions,ga:transactionRevenue,ga:transactions,ga:uniquePurchases,ga:totalValue,ga:transactionTax'
})
How do I know what request metrics and dimensions I can combine and what not? And how can I retrieve as many data as I can?
Not all dimensions and metrics can be queried together.
Selected dimensions and metrics cannot be queried together
Means that your request contains dimensions or metrics that can not be mixed.
You may use the Dimensions and Metrics developer reference to see which metrics and dimensions can be used together in your query
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