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
It sounds to me like your data has been sampled.
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.