ga:totalEvents by ga:eventCategory, ga:eventLabel, and ga:date not returning correct values

2,864 views
Skip to first unread message

Galax Womack

unread,
Sep 7, 2014, 3:01:21 PM9/7/14
to google-analytics...@googlegroups.com
I'm trying to get the ga:totalEvents for a particular ga:eventLabel over a date range. When I run the below query the returned values do not match the graph I see through the Analytics dashbord.

sort=ga:date,

dimensions=ga:date

metrics=ga:totalEvents

filters=ga:eventCategory==xxx,ga:eventLabel==xxx

segment=gaid::-1

start_date=2014-08-08

end_date=2014-09-07



Mike Sullivan

unread,
Sep 8, 2014, 9:47:13 AM9/8/14
to google-analytics...@googlegroups.com
I just posted an article about event metrics on Friday: http://www.analyticsedge.com/2014/09/misunderstood-metrics-events/

It may help you discover what your problems might be.


I will also note that when using the API, if you want the default (All Visits) segment, DO NOT SPECIFY gaid::-1. Leave the parameter out of the query. Sometimes it causes GA to deliver different results, particularly with the Users metric.

Pete

unread,
Sep 8, 2014, 12:42:44 PM9/8/14
to google-analytics...@googlegroups.com
Nice article Mike.

FYI you shouldn't see any discrepancy when you apply the default (All Sessions) segment vs. not using it. A while ago your statement was true but you shouldn't see that happen anymore. If you do then let us know.

pete

Mike Sullivan

unread,
Sep 8, 2014, 12:49:24 PM9/8/14
to google-analytics...@googlegroups.com
Thanks for the update, Pete. Good to know. So many things have changed in the API over the past couple of years.

Galax Womack

unread,
Sep 8, 2014, 2:25:33 PM9/8/14
to google-analytics...@googlegroups.com
Thank you for the information, Mike. I read through your article, but I'm having an issue you didn't directly address. For me the problem is that the values I get back from the API are actually much higher than what the web interface is reporting for any one of the dates in the range I am asking for.

Mike Sullivan

unread,
Sep 8, 2014, 3:05:09 PM9/8/14
to google-analytics...@googlegroups.com
Devil is in the details...I overlooked a simple character in your message -- the comma in the filter.

Your filter is looking for eventCategory=xxx OR eventLabel=xxx, which means the number you would get is for events that EITHER have the specified Category OR the total for events that have just the label.  

If you change it to a semicolon, you would get only events that match both -- is that what you wanted?

Galax Womack

unread,
Sep 8, 2014, 3:09:36 PM9/8/14
to google-analytics...@googlegroups.com
Thank you Mike, That was the solution.
Reply all
Reply to author
Forward
0 new messages