gpt4 book ai didi

google-analytics - Google Analytics API 未返回与 Analytics 仪表板相同的数据

转载 作者:行者123 更新时间:2023-12-03 15:37:21 30 4
gpt4 key购买 nike

我正在尝试编写一个 Google Analytics API 查询,它只返回去年每个月的每月唯一身份访问者。

This is the data I see in the Google Analytics dashboard.

我已经使用 Analytics API 浏览器编写了查询,我已经验证了 ID 并且帐户已正确授权。我正在使用 ga:month 维度来逐月获取数据。

This is the query, and the resultant data

这些数字与我在 Analytics 仪表板上看到的完全不同。

This is a graph of that data.

我很困惑。我看不出我在 Google Analytics 仪表板中指定的内容与我在 API 查询中输入的内容有什么不同,也看不出为什么我会得到如此不同的数字。

编辑:我推断问题出在开始日期和结束日期跨越 2013 年到 2014 年时。如果我的开始日期和结束日期都在 2013 年,则数字是正确的。但如果跨越 2013 年到 2014 年,则数字不正确。不知道如何解决它。

最佳答案

我怀疑您遇到了 Sampling level 的问题

samplingLevel

samplingLevel=DEFAULT
Optional.Use this parameter to set the sampling level (i.e. the number of visits
used to calculate the result) for a reporting query. The allowed values are consistent
with the web interface and include:
•DEFAULT — Returns response with a sample size that balances speed and accuracy.
•FASTER — Returns a fast response with a smaller sample size.
•HIGHER_PRECISION — Returns a more accurate response using a large sample size, but
this may result in the response being slower.

If not supplied, the DEFAULT sampling level will be used.

关于google-analytics - Google Analytics API 未返回与 Analytics 仪表板相同的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22639479/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com