我试图编写一个Google AnalyticsAPI查询,该查询只返回去年每个月的每月唯一身份访问者数。
This is the data I see in the Google Analytics dashboard.
我已使用Google Analytics资源管理器资源管理器编写查询,我已经验证了ID和帐户是否已正确验证。我使用ga:month维度逐月获取数据。
This is the query, and the resultant data
这些数字与我在Analytics仪表板上看到的数字完全不同。
我很困惑。我无法看到我在Google Analytics信息中心指定的内容与我在API查询中输入的内容之间的区别,或者为什么我应该获得如此截然不同的数字。
编辑:我已经推断出问题出在2013年到2014年的开始和结束日期。如果我的开始和结束日期都在2013年,那么数字是正确的。但如果它从2013年到2014年跨越,则数字不正确。不知道如何解决它。
答案 0 :(得分:2)
我怀疑您遇到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.