如何解决Google Analytics API中Ruby查询时维度与指标不兼容的问题?

更新于
2026-10-09 19:20:45
1阅读来源:SEO问题
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计253个文字,预计阅读时间需要2分钟。

如何解决Google Analytics API中Ruby查询时维度与指标不兼容的问题?

从我的GA电子商业中检索尽可能多的不同指标。我正在使用Google API Ruby客户端。持续收到错误: Selected dimensions and metrics cannot be queried together. 例如,对此请求:re

我必须从我的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开发人员参考来查看可以在查询中一起使用的指标和维度

如何解决Google Analytics API中Ruby查询时维度与指标不兼容的问题?

本文共计253个文字,预计阅读时间需要2分钟。

如何解决Google Analytics API中Ruby查询时维度与指标不兼容的问题?

从我的GA电子商业中检索尽可能多的不同指标。我正在使用Google API Ruby客户端。持续收到错误: Selected dimensions and metrics cannot be queried together. 例如,对此请求:re

我必须从我的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开发人员参考来查看可以在查询中一起使用的指标和维度

如何解决Google Analytics API中Ruby查询时维度与指标不兼容的问题?