API: UserId based Event tracking results


(Mads Møller) #1

I need a list of users with a total count of specific actions they have completed. e.g. Downloaded a book, liked a page etc. These actions have been captured using Event Tracking.

Now, How do I get this correctly out of Matomo?
This is what I need: Screenshot by Lightshot
https://image.prntscr.com/image/QyLnD94PQxmdIQZeUiT9rg.png

A simple list of users and total counts of actions.

Have tried the following without any luck:

'method' => 'Events.getCategory',
'segment' => 'eventAction==LikedPage',
'pivotBy' => 'UserId.UserId',
'pivotByColumn' => '1'

or should i use Live.getLastVisitsDetails with some custom pivot or secondaryDimension ?

Im quite clueless how to achieve this?

Any help would be awesome.


(Roddy A. Stegemann) #2

Hi, Madas!

Can you not segment visitors by event, and then run a different segment for each event?

Roddy


(Mads Møller) #3

Hi Roddy,

Thanks for the suggestion.

I could, but that would be very inefficient due to I have 4500+ users. So creating 4500 segments would be a killer for Matomo and its database structure.
I merely want to combine the event data from piwik_log_link_visit_action with the userId of piwik_log_visit.

There must be a way to do this simple analytics extraction based on user?


(Roddy A. Stegemann) #4

Hi, Mads!

Can you identify a field/column that the two tables share in common, if so, then you could export each table separately and match the data of the two tables by the just-mentioned field/column.

The only other possibility of which I am aware is a custom variable that would assign a visitor ID to each event. Unfortunately, I am confused about the way Matomo assigns visitor IDs in general, and would very much appreciate your reporting back to us should you attempt this route.

Roddy