Different segments returning the same result set - Google Analytics
I have these two queries (only the segments differ)
/analytics/feeds/data?ids=ga:...&dimensions=ga:date&metrics=ga:visits&segme开发者_JAVA百科nt=gaid%3A%3A-1&start-date=2011-05-16&end-date=2011-06-14&max-results=1000
/analytics/feeds/data?ids=ga:...&dimensions=ga:date&metrics=ga:visits&segment=gaid%3A%3A-4&start-date=2011-05-16&end-date=2011-06-14&max-results=1000
where the second should return different (smaller) results than the first. But both deliver the same results. What am I doing wrong?
Advanced segments have only been added in v2 of the Google Analytics API. This version is apparently not used by default. You need to explicitly request the second version by either adding the GData-Version: 2
header or by including v=2
as a parameter of the query.
See the Google Analytics API Docs for more information.
精彩评论