Google Analytics API错误“选定的维度和指标不能一起查询。” [英] Google Analytics API error "Selected dimensions and metrics cannot be queried together."

查看:217
本文介绍了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." 

例如,对于此请求:

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

这篇关于Google Analytics API错误“选定的维度和指标不能一起查询。”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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