Get Search Events by category with keyword

Hello!

I’m trying to view my site’s search events in a format like this:

|    DATE    | CATEGORY |   KEYWORD    |
| 2024-01-05 |   all    | how do I xyz |
| 2024-01-02 | contacts |   jane doe   |
| 2024-01-01 |   all    | what is xyz  |

I can’t seem to find any way in the dashboard or through the API to pull search events that includes both the category and the keyword.

Any ideas?

Hi matomouser2,

It sounds like you’re looking for a way to retrieve search events with both category and keyword. While Matomo’s dashboard may not directly show this, you can achieve it using the API.

You might want to use the Events.getEvents method, filtering by category and keyword. Here’s a sample API request format:

plaintext

Copy code

https://your-matomo-url/index.php?module=API&method=Events.getEvents&idSite=yourSiteId&period=day&date=last30&format=JSON&token_auth=yourToken

After retrieving the data, you can filter it in your application to get the specific format you want. Make sure to replace your-matomo-url, yourSiteId, and yourToken with your actual values.

Let me know if you need more help with this!

Thank you for the response, but from what I can see, a “Events.getEvents” method doesn’t exist in the API. None of the “Events” methods seem to return what you’re describing.

Am I missing something?

1 Like

Hi @matomouser2
I think this is not possible except if you use directly the Live.getLastVisitsDetails API:
https://developer.matomo.org/api-reference/reporting-api#Live
But you can also ask for feature request: