1
votes

When using the API, results for the metric "ga:uniqueEvents" are consistently lower then shown in the webinterface. The results for "ga:totalEvents" are the same as in the webinterface. Is there a extra filter in the API or what else can cause this ?

Example request: https://www.googleapis.com/analytics/v3/data/ga?ids=ga:....&start-date=2016-10-01&end-date=2016-10-01&metrics=ga:totalEvents, ga:uniqueEvents&dimensions=ga:eventCategory, ga:eventLabel&sort=ga:eventLabel&filters=ga:eventCategory==%category name%

1
Wild guess: I think the category name in filters in the API might be case sensitive. so if you have Button, button, and BuTTON. only the one you request comes back. Or is it the other way around Website isn't case sensitive and the API is.DaImTo
I am tracking the events from one place so the naming of the category is consistent, thanks anywayJeroen

1 Answers

1
votes

result mismatch occurs when either you are using a very big date range or many dimensions in single requests because of which sampling kicks in.

as i can see you are requesting for a single day,the probability that sampling is being done is very low( it is possible if you have lots of data in that account) , The other reason is you could be requesting immediate data, you should take into consideration that it takes about 48 hours for the data to get processed .

To conform if the data you are getting from the api is processed check for a parameter something like isGoldenData in the response. if its not-there it conforms that the data is yet unprocessed.