how to track user search activity on website in sharepoint online

I am owner of shrepoint website and i have implemented modern search using pnp modern search plugin

Now i have requirement, i have to store what user has searched for in a list (need to store search string along with timestamp in a list)

how to do that, please help