Google Analytics API TotalEvents query

强颜欢笑 提交于 2019-12-25 04:56:24

问题


I'm trying to get a total count for a give event,however I get a number much bigger(10-20 times bigger), than I see on the GA website, what am I doing wrong? (api v3)

here is the segment

metric:

ga:totalEvents

segment:

dynamic::ga:eventCategory==mycategory;ga:eventAction==myaction;ga:eventLabel==mylabel

note that I get wrong results with the query explorer as well.


回答1:


You are using a segment instead of a filter.

Segments are session based so it will include all events in a session if it matches you specification. So essentially if I triggered the event you want plus other events they will all be included in the total events field.

What you need to do Is remove the segment and add a filter, the filter will include only the data you request.

Hope that helps



来源:https://stackoverflow.com/questions/19984057/google-analytics-api-totalevents-query

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