Quantcast
Channel: Support & Bugs - Matomo forums
Viewing all articles
Browse latest Browse all 5706

Events.getAction API Returning Unexpected Results

$
0
0

@cherylsedota wrote:

I am adding analytics to an existing desktop application. I am tracking events using Matomo’s HTTP API: Tracking HTTP API: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3

Here is a sample event I am tracking - I am using the event category, event action, event URL, event name, event value (numeric) and page scope custom variables:

http://localhost/matomo.php?idsite=1&rec=1&url=http://mysiteurl.com/page1/subpage1&e_c=MyEventCategory&e_a=MyEventAction&e_v=500&e_n=MyEventName&cvar={“1”:[“MyCustomVarName1”,“MyCustomVarValue1”],“2”:[“MyCustomVarName2”,“MyCustomVarValue2”]}

We end up tracking around 10-20 “events” like this during a single “visit” on average.

When I try to use the Events.getAction Reporting API, I am finding that the values returned are not what I expect. For example, I want to report on how many individual events have MyCustomVarName1 set to MyCustomVarValue1. I put together a Reporting API query like this:

http://localhost/index.php?module=API&method=Events.getAction&idSite=1&period=year&date=today&format=JSON&token_auth=anonymous&flat=1&segment=customVariablePageName1==MyCustomVarName1;customVariablePageValue1==MyCustomVarValue1

The event counts returned are higher than I expected, and some of the events being returned do NOT have that custom variable set. From what I can discern, if there is a single event in the visit that has that custom variable set, then all events in that visit are “counted” by this query.

Please advise. Thanks!
Cheryl

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5706

Trending Articles