Google Analytics API不会返回与Google Analytics仪表板相同的数据 [英] Google Analytics API not returning same data as Analytics dashboard
问题描述
我正在尝试编写一个Google Analytics API查询,该查询仅返回去年每个月的唯一身份访问者月度数。
我使用Analytics API资源管理器来编写查询,我已验证了该ID并帐户已正确验证。我使用ga:month维度来逐月获取数据。
这些数字完全不像我在Analytics(分析)仪表板上看到的数据。
我很困惑。我看不到我在Google Analytics仪表板中指定的内容与我在API查询中输入的内容有什么不同,或者为什么我应该得到如此大不相同的数字。
编辑:我推断问题在于2013年到2014年的开始日期和结束日期。如果我的开始日期和结束日期都在2013年,那么数字是正确的。但如果从2013年到2014年跨越,数字是不正确的。不知道如何解决它。
samplingLevel
samplingLevel = DEFAULT
可选。使用此参数设置报告查询的采样级别(即用于计算结果的访问次数
)。允许的值与web界面一致
,并且包括:
•DEFAULT - 返回具有平衡速度和准确性的样本大小的响应。
•FASTER - 以较小的样本量返回快速响应。
•HIGHER_PRECISION - 使用大样本量返回更准确的响应,但
可能导致响应速度变慢。
如果未提供,则将使用DEFAULT采样级别。
I'm trying to write a Google Analytics API query that simply returns the monthly unique visitors for each month over the last year.
This is the data I see in the Google Analytics dashboard.
I've used the Analytics API explorer to write the query, I've verified the ID and account is authed correctly. I'm using the ga:month dimension to get the data month-by-month.
This is the query, and the resultant data
These numbers are nothing at all like the ones I see on the Analytics dashboard.
I'm very confused. I can't see what is different between what I specify in the Google Analytics dashboard and what I've entered in the API query, or why I should get such wildly different numbers.
Edit: I've deduced that the problem lies when the start and end date span across 2013 to 2014. If my start and end date are both in 2013, the numbers are correct. But if it spans across from 2013 to 2014, the numbers are incorrect. Not sure how to fix it.
I suspect you are having an issue with 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 API不会返回与Google Analytics仪表板相同的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!