Events.getAction API Returning Unexpected Results

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:


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:


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!


I think this is the same topic as Segments not filtering correctly · Issue #15163 · matomo-org/matomo · GitHub and Full support for Filters in Matomo 4 · Issue #15438 · matomo-org/matomo · GitHub and the linked issues.


I am using Matomo v3.12.0 so it does seem like this is one of the same issues noted in the other topic, see viezel’s comment here: Segments not filtering correctly · Issue #15163 · matomo-org/matomo · GitHub about getting more events returned by the reporting API than there really should be / were returned in the past.

I do NOT see that this issue gets resolved by updating:


enable_segments_cache = 0

But I do see that I can get accurate results when I use the Matomo dashboard to query for this reporting data instead of the HTTP API - I created a new custom segment via:

Behavior (left side of page) -> Events

And entered the same query info I was previously entering via the HTTP API parameters, and it returned the values I expected.

Is there any way to get the Reporting API to return the precise number of events that match the segment parameter instead of getting the total number of events for each visit that has a single event that matches the segment parameter?

Thank you.

Actually, I found that if I wiped out all data points that had already been tracked, then disabling the segment cache does actually fix the Reporting API (HTTP) issue. Thanks!


i have the same issue on the api for a few customers;
for example on one specific customer only the endpoint Events.getName() is not returning any data,
only an empty array.

@cherylsedota could you please explain how you wiped out the data points in order
to fix this ?

thank you !

To wipe all the data points, I went to the settings gear in the top right of the dashboard, then under Privacy, I click “GPDR Tools” and then make a generic query that I know will cover all data points, click “find matching data subjects” then with all selected, I click “Delete selected visits”

Actually, I determined that if I wiped out all records points that had already been tracked, then disabling the local services like vanonthemove the phase cache does clearly restoration the Reporting API (HTTP) issue. Thanks!