简体   繁体   English

尝试从 Google Analytics API 中提取受众数据

[英]Trying to extract audience data from Google Analytics API

quick question here : I am using Google Analytics reporting API v4 to perform some extractions from GA data, all working as desired except for one set of Audience data.这里有一个简单的问题:我正在使用 Google Analytics 报告 API v4 从 GA 数据中执行一些提取,除了一组受众数据之外,所有这些都按需要工作。

Basically I'm querying Audience data with the following dimensions and metrics(also as described here : https://developers.google.com/analytics/devguides/reporting/core/dimsmets#view=detail&group=audience ) :基本上,我使用以下维度和指标查询受众数据(也如此处所述: https : //developers.google.com/analytics/devguides/reporting/core/dimsmets#view=detail&group=audience ):

Metrics :
    ga:visits

Dimensions :
    ga:dateHourMinute
    ga:dataSource
    ga:userAgeBracket
    ga:userGender
    ga:interestInMarketCategory

If I send a request with this combination, data is returned normally.如果我用这个组合发送请求,数据会正常返回。 However, if I add one more dimension of interest such ga:city , the API doesn't throws any errors, but also does not return any data .但是,如果我再添加一个感兴趣的维度,例如ga:city ,API 不会抛出任何错误,也不会返回任何数据

Weird thing is that for other combination of dimensions/metrics with ga:city simply works correctly.奇怪的是,对于其他维度/指标与ga:city组合,它可以正常工作。

Any ideas on why it is not returning data, perhaps, how to make this work would be greatly appreciated since I'm stuck with this for some days :-|关于为什么不返回数据的任何想法,也许,如何进行这项工作,将不胜感激,因为我已经坚持了几天:-|

Thanks in advance everyone !提前谢谢大家!

According to docs ga:visits in API V4 is deprecated, use ga:sessions instead.根据文档ga:visits in API V4 已弃用,请改用ga:sessions

Try with this combination:试试这个组合:

metrics:

ga:sessions

Dimensions

ga:dateHourMinute
ga:dataSource
ga:userAgeBracket
ga:userGender
ga:interestInMarketCategory
ga:city

For privacy reasons, and maybe because they do not want yout to be able to extract data to another system, Google does not allow that you narrow down data too accurately.出于隐私原因,也许是因为他们不希望您能够将数据提取到另一个系统,Google 不允许您过于准确地缩小数据范围。

They do not want you to be able to guess private data (interests, gender, age bracket...) from a specific user.他们不希望您能够从特定用户那里猜测私人数据(兴趣、性别、年龄段……)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM