Google Analytics API 错误“无法同时查询所选维度和指标." [英] Google Analytics API error "Selected dimensions and metrics cannot be queried together."

查看:18
本文介绍了Google Analytics API 错误“无法同时查询所选维度和指标."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须一次从我的 GA 电子商务中检索尽可能多的不同指标.为此,我正在使用 google api ruby​​ 客户端.并不断收到错误:

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." 

例如,对于这个请求:

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

这篇关于Google Analytics API 错误“无法同时查询所选维度和指标."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆