ruby - 谷歌分析 API 错误 "Selected dimensions and metrics cannot be queried together."

标签 ruby google-analytics google-analytics-api

我必须一次从我的 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/

相关文章:

ruby - 将数据写入文件的最有效方法

ruby - 如何计算 Ruby 中数组中数组的数量?

ruby - Jruby Warbler 在 Tomcat 上为 Sinatra 生成了 war ——未找到查看文件

android - 广播 INSTALL_REFERRER Intent 问题

android - 适用于 Android 的 Google Analytics V3 : Service unavailable (code=1), 使用本地商店

google-analytics - Google实验API-获取报告

R - 谷歌分析包

ruby - 如何更改 vim ruby​​ 版本

google-analytics - 如何创建包含 2 个主机名的 Google Analytics 过滤器?

google-analytics - 如何从谷歌分析 API 获取少数 (10) 个 URL 的页面浏览量?