How to track searches?

The site I’m building has a jquery based search input that hides or shows elements that match whatever you type in:

There’s no submit button - results are displayed in real time.
Is there any way to track what users are typing into this box? Something to do with custom variables maybe?

Hi there,

To track such events, we recommend to use Event Tracking Event Tracking - Analytics Platform - Matomo