我必须一次从我的 GA 电子商务中检索尽可能多的不同指标。我正在为此使用 google api ruby 客户端。并不断收到错误:
"message"=>"Selected dimensions and metrics cannot be queried together."
例如,对于这个请求:
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'
})
我如何知道我可以组合哪些请求指标和维度,哪些不可以?我怎样才能检索尽可能多的数据?
最佳答案
并非所有维度和指标都可以一起查询。
Selected dimensions and metrics cannot be queried together
表示您的请求包含不能混合的维度或指标。
您可以使用 Dimensions and Metrics开发人员引用以查看哪些指标和维度可以在您的查询中一起使用
关于ruby - 谷歌分析 API 错误 "Selected dimensions and metrics cannot be queried together.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29152101/