Trouble with DataTable structure

Hey guys,

I’m currenty developing a widget which should display e.g. a table to provide information about the usage of special parts of our target application.
Two examples are the Extended Search form and the filtering form in the result list.

The desired output should look like this:

View 1)
Search Criteria|Used per visit
Criteria XY | 12
Criteria ZA | 2

View 2)
Filter|Used per visit
Criteria PQ | 0
Criteria RS | 399

The question is:
How should the structure of the object / array look like which I have to pass through a function of DataTable sothat I can select either “Search Criteria” or “Filter” with their referring key value pairs as table content?

Thank you very much in advance!

Maybe you could use built-in Event Tracking feature for this? I think it may work: Event Tracking - Analytics Platform - Matomo