GA total results is significantly less with hour dimension than with date dimension

血红的双手。 提交于 2019-12-13 18:01:08

问题


I am using the GA API running two queries over 1 year's worth of data:

Query1:

Get apiQuery = analytics.data().ga()
 .get("ga:" + profileId,
 "2013-03-08",
 "2014-03-09",
 "ga:visits")
 .setDimensions("ga:campaign,ga:keyword,ga:date")
 .setSort("ga:campaign,ga:keyword")
 .setFilters("ga:medium==cpc")
 .setMaxResults(1000);

Query2:

Get apiQuery = analytics.data().ga()
 .get("ga:" + profileId,
 "2013-03-08",
 "2014-03-09",
 "ga:visits")
 .setDimensions("ga:campaign,ga:keyword,ga:date,ga:hour")
 .setSort("ga:campaign,ga:keyword")
 .setFilters("ga:medium==cpc")
 .setMaxResults(1000);

The only difference is the extra hour dimension.

The first query returns 651322 results The second query returns 91592 results

This doesn't make sense to me - I would expect approx 651322*24 = 15M results to be returned.

Does anyone know why this would be?

Thanks for any help,

Josh


回答1:


It sounds to me like your data has been sampled.

samplingLevel string no The desired sampling level. Allowed Values:

 •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.

Note: If I remember right the API should return some variable with your data. It tells you that the data was sampled: try looking for something like containsSampledData, sampleSize, or sampleSpace. I cant remember which one it is right this minute.



来源:https://stackoverflow.com/questions/22308677/ga-total-results-is-significantly-less-with-hour-dimension-than-with-date-dimens

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!