Multi-variable search reporting w/ Events

Hi all,

We’re having trouble creating reports based on a sequence of Event activity. We have an application which allows our users to generate complex search tools. These search tools can end up with 3-10 factors in the search form. For example, if you’re building a search tool that searches people, you might create a search form with options like:

Annual Income
Has Picture

Then, within those results, users can take actions, which are important to our customers. Actions like “Click on Phone Number”, “Click on Results Website”, “View More details”.

We need to generate reports on these actions broken down by the options chosen in the search form. E.g. count of “Click on Phone Number” events by “Gender” search events.

We trigger Matomo events to track this activity. We trigger a “Search” event when the user clicks search and we include the parameters in the Event Name as a JSON-encoded string like:
Event Action: Search
Event Name: {“postal_code”:"",“keyword”:"",“Category”:“Platinum”}

We also trigger an event like this for each category selected (so separate events based on the search options)
Event Action: Category
Event Name: Platinum

If you searched for Gender = Female, Category = Platinum we would trigger 2 events:

Event Action: Category
Event Name: Platinum

Event Action: Category
Event Name: Female

Our challenge is to create a report that shows the number of “Click on Phone Number” events performed in the context of a “Platinum” search.

As far as I can tell, these are just tracked as Events in sequence. So the way to report on “Click on Phone Number” events performed in the context of a “Platinum” search would be to look at “Click on Phone Number” events that occured directly after at Search action with name = {“postal_code”:"",“keyword”:"",“Category”:“Platinum”}.

Is there any way to report this data? Is there a better way to track this data? How else should we establish the search parameters as the event “context” to make it easier/possible to generate reports?