gpt4 book ai didi

google-analytics - 错误的用户数返回

转载 作者:行者123 更新时间:2023-12-03 17:01:35 25 4
gpt4 key购买 nike

我发现通过 API 跨一年的查询报告的 ga:sessions、ga:users、ga:pageviews 与 GA 网站的相同日期范围之间存在不一致。

我已经能够通过分别请求每个月并对值求和来精确匹配 ga:sessions 和 ga:pageviews,但是在 ga:users 的情况下,我仍然看到 GAPI 返回的数字和 GA 网站之间的数字大相径庭.

当我把当月的数字加起来时,这个数字实际上比当年的数字要大,而且这两个数字都高于 GA 网站上报告的值。

GA 可以为“用户”使用什么维度/指标?

最佳答案

我怀疑您对 sampling level 有疑问.如果您提出的请求在这种情况下返回足够多的数据,请选择一整年的数据。服务器将返回采样的结果。

Sampling

Google Analytics calculates certain combinations of dimensions and metrics on the fly. To return the data in a reasonable time, Google Analytics may only process a sample of the data.

You can specify the sampling level to use for a request by setting the samplingLevel parameter.

If a Core Reporting API response contains sampled data, then the containsSampledData response field will be true. In addition, 2 properties will provide information about the sampling level for the query: sampleSize and sampleSpace. With these 2 values you can calculate the percentage of sessions that were used for the query. For example, if sampleSize is 201,000 and sampleSpace is 220,000 then the report is based on (201,000 / 220,000) * 100 = 91.36% of sessions.



当从 api 请求时,使用默认采样级别,这是为了提高请求的速度。您可以通过发送指定要在请求中使用的采样级别来更改它。
samplingLevel=DEFAULT 
Optional.Use this parameter to set the sampling level (i.e. the number of sessions 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.

关于google-analytics - 错误的用户数返回,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23733373/

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